Files
2026-08-27 11:22:43 -06:00

16 lines
672 B
C

#include <windows.h>
#include <stdio.h>
#include "badger_exports.h"
// WINADVAPI WINBOOL WINAPI Advapi32$GetUserNameA(LPSTR lpBuffer, LPDWORD pcbBuffer);
// below definition should start with 'Advapi32$'. This is a bug. Ideally this should crash the badger
// since 2.1 release, invalid functions which cannot be found in the BOF will be printed to screen
WINADVAPI WINBOOL WINAPI GetUserNameA(LPSTR lpBuffer, LPDWORD pcbBuffer);
void coffee(char** argv, int argc, WCHAR** dispatch) {
CHAR username[MAX_PATH] = { 0 };
DWORD usernameLength = MAX_PATH;
GetUserNameA(username, &usernameLength);
BadgerDispatch(dispatch, "[+] Char Username: %s\n", username);
}