Skip to content

Commit

Permalink
re a0rtega#45 Add uptime test
Browse files Browse the repository at this point in the history
  • Loading branch information
a0rtega committed Dec 22, 2015
1 parent 6b27791 commit eac42ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pafish/gensandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,8 @@ int gensandbox_less_than_onegb() {
return (statex.ullTotalPhys/1024) < 1048576 ? TRUE : FALSE;
}

int gensandbox_uptime() {
/* < ~12 minutes */
return GetTickCount() < 0xAFE74 ? TRUE : FALSE;
}

2 changes: 2 additions & 0 deletions pafish/gensandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ int gensandbox_one_cpu_GetSystemInfo();

int gensandbox_less_than_onegb();

int gensandbox_uptime();

#endif
4 changes: 4 additions & 0 deletions pafish/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ int main(void)
&gensandbox_less_than_onegb,
"Sandbox traced by checking if pysical memory is less than 1Gb",
"hi_sandbox_pysicalmemory_less_1Gb");
exec_check("Checking operating system uptime using GetTickCount()",
&gensandbox_uptime,
"Sandbox traced by checking operating system uptime using GetTickCount()",
"hi_sandbox_uptime");

/* Hooks detection tricks */
print_check_group("Hooks detection");
Expand Down

0 comments on commit eac42ca

Please sign in to comment.