-
Notifications
You must be signed in to change notification settings - Fork 2
/
gaa_test.c
40 lines (32 loc) · 995 Bytes
/
gaa_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include "get_api_address.h"
int main(void)
{
typedef VOID (WINAPI *exit_t)(UINT);
exit_t ep;
LPCVOID page;
ep = (exit_t)get_api_address("ExitProcess", NULL, &page);
if (ep != NULL) {
typedef DWORD (WINAPI *gtc_t)(VOID);
gtc_t gtc;
puts("ExitProcess found, searching GetTickCount by one shot");
gtc = (gtc_t)get_api_address("GetTickCount", page, NULL);
if (gtc != NULL) {
DWORD start, end, delta;
puts("FOUND by one shot!!!");
start = gtc();
/* Some code... */
end = gtc();
if (start <= end) {
delta = end - start;
}
else { /* Fix overflow */
delta = (DWORD)(-1) - start + end + 1;
}
if (delta > 1000U) {
ep(1); /* Too much time, i'm debugged, exit 1 */
}
}
}
return 0;
}