Minor fix, minor function cleanup

This commit is contained in:
Alberto Ortega 2015-03-19 18:32:48 +01:00
parent d03750ae28
commit 7da8b35d13
2 changed files with 9 additions and 19 deletions

View File

@ -7,6 +7,7 @@
#include "types.h" #include "types.h"
#include "gensandbox.h" #include "gensandbox.h"
#include "utils.h"
int gensandbox_mouse_act() { int gensandbox_mouse_act() {
POINT position1, position2; POINT position1, position2;
@ -75,16 +76,14 @@ int gensandbox_common_names() {
char* szSingleDrive = szLogicalDrives; char* szSingleDrive = szLogicalDrives;
while(*szSingleDrive) while(*szSingleDrive)
{ {
snprintf(filename, MAX_PATH, "%ssample.exe",szSingleDrive); if (GetDriveType(szSingleDrive) != DRIVE_REMOVABLE ) {
exists = pafish_exists_file(filename); snprintf(filename, MAX_PATH, "%ssample.exe",szSingleDrive);
if (exists) exists = pafish_exists_file(filename);
return TRUE; if (exists) return TRUE;
snprintf(filename, MAX_PATH, "%smalware.exe",szSingleDrive);
snprintf(filename, MAX_PATH, "%smalware.exe",szSingleDrive); exists = pafish_exists_file(filename);
exists = pafish_exists_file(filename); if (exists) return TRUE;
if (exists) }
return TRUE;
szSingleDrive += strlen(szSingleDrive) + 1; szSingleDrive += strlen(szSingleDrive) + 1;
} }
} }
@ -133,10 +132,3 @@ int gensandbox_sleep_patched() {
else return TRUE; else return TRUE;
} }
int gensandbox_rdtsc() {
uint64_t ret, ret2;
asm volatile ( "rdtsc" : "=A"(ret) );
asm volatile ( "rdtsc" : "=A"(ret2) );
return (ret2 - ret) > 1000 ? TRUE : FALSE;
}

View File

@ -16,6 +16,4 @@ int gensandbox_drive_size2();
int gensandbox_sleep_patched(); int gensandbox_sleep_patched();
int gensandbox_rdtsc();
#endif #endif