-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathentry.c
More file actions
executable file
·20 lines (16 loc) · 899 Bytes
/
Copy pathentry.c
File metadata and controls
executable file
·20 lines (16 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <windows.h>
#include <stdio.h>
#include "beacon.h"
void go(char* args, int length)
{
// 1. Kernel32: GetCurrentProcessId returns a DWORD directly
BeaconPrintf(CALLBACK_OUTPUT, "[Kernel32] GetCurrentProcessId() returns: %d", GetCurrentProcessId());
// 2. Msvcrt: rand() returns an int (Standard C function)
BeaconPrintf(CALLBACK_OUTPUT, "[Msvcrt] rand() returns: %d", rand());
// 3. Ucrt: atoi() returns an int (Standard C function)
// Note: The linker decides if this comes from UCRT or MSVCRT based on your library order
BeaconPrintf(CALLBACK_OUTPUT, "[Ucrt] atoi(\"12345\") returns: %d", atoi("12345"));
// 4. Advapi32: GetSidLengthRequired returns a DWORD length
// This avoids the complexity of buffer management just for a link test
BeaconPrintf(CALLBACK_OUTPUT, "[Advapi32] GetSidLengthRequired(1) returns: %d", GetSidLengthRequired(1));
}