undo overzealous changes

This commit is contained in:
Akash Mozumdar 2018-05-20 17:07:42 -04:00
parent 65ec2d5be0
commit 6dab2871eb
5 changed files with 15 additions and 15 deletions

View File

@ -129,7 +129,7 @@ size_t IthGetCurrentModulePath(wchar_t *buf, size_t len)
HANDLE hHeap; // used in ith/common/memory.h HANDLE hHeap; // used in ith/common/memory.h
#endif // ITH_HAS_HEAP #endif // ITH_HAS_HEAP
DWORD currentProcessId; DWORD current_process_id;
DWORD debug; DWORD debug;
BYTE launch_time[0x10]; BYTE launch_time[0x10];
LPVOID page; LPVOID page;
@ -238,7 +238,7 @@ public:
AcquireLock(); AcquireLock();
DWORD pid,addr,len; DWORD pid,addr,len;
if (hProc == NtCurrentProcess()) if (hProc == NtCurrentProcess())
pid = ::currentProcessId; pid = ::current_process_id;
else { else {
PROCESS_BASIC_INFORMATION info; PROCESS_BASIC_INFORMATION info;
NtQueryInformationProcess(hProc, ProcessBasicInformation, &info, sizeof(info), &len); NtQueryInformationProcess(hProc, ProcessBasicInformation, &info, sizeof(info), &len);
@ -287,7 +287,7 @@ public:
DWORD pid,addr,len; DWORD pid,addr,len;
AcquireLock(); AcquireLock();
if (hProc==NtCurrentProcess()) if (hProc==NtCurrentProcess())
pid = ::currentProcessId; pid = ::current_process_id;
else { else {
PROCESS_BASIC_INFORMATION info; PROCESS_BASIC_INFORMATION info;
NtQueryInformationProcess(hProc,ProcessBasicInformation,&info,sizeof(info),&len); NtQueryInformationProcess(hProc,ProcessBasicInformation,&info,sizeof(info),&len);
@ -733,7 +733,7 @@ BOOL IthInitSystemService()
mov ecx,[eax+0x20] mov ecx,[eax+0x20]
mov eax,[eax+0x30] mov eax,[eax+0x30]
mov peb,eax mov peb,eax
mov currentProcessId,ecx mov current_process_id,ecx
} }
debug = peb->BeingDebugged; debug = peb->BeingDebugged;
LowFragmentHeap = 2; LowFragmentHeap = 2;

View File

@ -63,7 +63,7 @@ void CheckThreadStart();
extern HANDLE hHeap; // used in ith/common/memory.h extern HANDLE hHeap; // used in ith/common/memory.h
#endif // ITH_HAS_HEAP #endif // ITH_HAS_HEAP
extern DWORD currentProcessId; extern DWORD current_process_id;
extern DWORD debug; extern DWORD debug;
extern BYTE LeadByteTable[]; extern BYTE LeadByteTable[];
extern LPVOID page; extern LPVOID page;

View File

@ -23,7 +23,7 @@ extern int currentHook;
extern WCHAR dll_mutex[]; extern WCHAR dll_mutex[];
//extern WCHAR dll_name[]; //extern WCHAR dll_name[];
extern DWORD trigger; extern DWORD trigger;
//extern DWORD currentProcessId; //extern DWORD current_process_id;
// jichi 6/3/2014: Get memory range of the current module // jichi 6/3/2014: Get memory range of the current module
extern DWORD processStartAddress, extern DWORD processStartAddress,

View File

@ -69,7 +69,7 @@ HANDLE
hFile, hFile,
hMutex, hMutex,
hmMutex; hmMutex;
//DWORD currentProcessId; //DWORD current_process_id;
extern DWORD enter_count; extern DWORD enter_count;
//extern LPWSTR current_dir; //extern LPWSTR current_dir;
extern DWORD engine_type; extern DWORD engine_type;
@ -147,12 +147,12 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID unused)
switch (fdwReason) { switch (fdwReason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
{ {
static bool attached = false; static bool attached_ = false;
if (attached) // already attached if (attached_) // already attached
{ {
return TRUE; return TRUE;
} }
attached = true; attached_ = true;
DisableThreadLibraryCalls(hModule); DisableThreadLibraryCalls(hModule);
@ -163,7 +163,7 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID unused)
// No longer checking if SystemService fails, which could happen on non-Japanese OS // No longer checking if SystemService fails, which could happen on non-Japanese OS
IthInitSystemService(); IthInitSystemService();
swprintf(hm_section, ITH_SECTION_ L"%d", currentProcessId); swprintf(hm_section, ITH_SECTION_ L"%d", current_process_id);
// jichi 9/25/2013: Interprocedural communication with vnrsrv. // jichi 9/25/2013: Interprocedural communication with vnrsrv.
hSection = IthCreateSection(hm_section, HOOK_SECTION_SIZE, PAGE_EXECUTE_READWRITE); hSection = IthCreateSection(hm_section, HOOK_SECTION_SIZE, PAGE_EXECUTE_READWRITE);
@ -185,12 +185,12 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID unused)
{ {
wchar_t hm_mutex[0x100]; wchar_t hm_mutex[0x100];
swprintf(hm_mutex, ITH_HOOKMAN_MUTEX_ L"%d", currentProcessId); swprintf(hm_mutex, ITH_HOOKMAN_MUTEX_ L"%d", current_process_id);
::hmMutex = IthCreateMutex(hm_mutex, FALSE); ::hmMutex = IthCreateMutex(hm_mutex, FALSE);
} }
{ {
wchar_t dll_mutex[0x100]; wchar_t dll_mutex[0x100];
swprintf(dll_mutex, ITH_PROCESS_MUTEX_ L"%d", currentProcessId); swprintf(dll_mutex, ITH_PROCESS_MUTEX_ L"%d", current_process_id);
DWORD exists; DWORD exists;
::hMutex = IthCreateMutex(dll_mutex, TRUE, &exists); // jichi 9/18/2013: own is true, make sure the injected dll is singleton ::hMutex = IthCreateMutex(dll_mutex, TRUE, &exists); // jichi 9/18/2013: own is true, make sure the injected dll is singleton
if (exists) if (exists)

View File

@ -72,7 +72,7 @@ DWORD WINAPI PipeManager(LPVOID unused)
} }
} }
WriteFile(::hookPipe, &::currentProcessId, sizeof(::currentProcessId), nullptr, nullptr); WriteFile(::hookPipe, &::current_process_id, sizeof(::current_process_id), nullptr, nullptr);
for (int i = 0, count = 0; count < ::currentHook; i++) for (int i = 0, count = 0; count < ::currentHook; i++)
{ {
@ -167,7 +167,7 @@ void ConsoleOutput(LPCSTR text)
// BYTE buffer[0x80]; // BYTE buffer[0x80];
// BYTE *buff; // BYTE *buff;
// len = wcslen(str) << 1; // len = wcslen(str) << 1;
// t = swprintf((LPWSTR)(buffer + 8),L"%d: ",currentProcessId) << 1; // t = swprintf((LPWSTR)(buffer + 8),L"%d: ",current_process_id) << 1;
// sum = len + t + 8; // sum = len + t + 8;
// if (sum > 0x80) { // if (sum > 0x80) {
// buff = new BYTE[sum]; // buff = new BYTE[sum];