diff --git a/vnr/ithsys/ithsys.cc b/vnr/ithsys/ithsys.cc index 3b49610..128f51f 100644 --- a/vnr/ithsys/ithsys.cc +++ b/vnr/ithsys/ithsys.cc @@ -129,7 +129,7 @@ size_t IthGetCurrentModulePath(wchar_t *buf, size_t len) HANDLE hHeap; // used in ith/common/memory.h #endif // ITH_HAS_HEAP -DWORD currentProcessId; +DWORD current_process_id; DWORD debug; BYTE launch_time[0x10]; LPVOID page; @@ -238,7 +238,7 @@ public: AcquireLock(); DWORD pid,addr,len; if (hProc == NtCurrentProcess()) - pid = ::currentProcessId; + pid = ::current_process_id; else { PROCESS_BASIC_INFORMATION info; NtQueryInformationProcess(hProc, ProcessBasicInformation, &info, sizeof(info), &len); @@ -287,7 +287,7 @@ public: DWORD pid,addr,len; AcquireLock(); if (hProc==NtCurrentProcess()) - pid = ::currentProcessId; + pid = ::current_process_id; else { PROCESS_BASIC_INFORMATION info; NtQueryInformationProcess(hProc,ProcessBasicInformation,&info,sizeof(info),&len); @@ -733,7 +733,7 @@ BOOL IthInitSystemService() mov ecx,[eax+0x20] mov eax,[eax+0x30] mov peb,eax - mov currentProcessId,ecx + mov current_process_id,ecx } debug = peb->BeingDebugged; LowFragmentHeap = 2; diff --git a/vnr/ithsys/ithsys.h b/vnr/ithsys/ithsys.h index 4457f43..87c67f3 100644 --- a/vnr/ithsys/ithsys.h +++ b/vnr/ithsys/ithsys.h @@ -63,7 +63,7 @@ void CheckThreadStart(); extern HANDLE hHeap; // used in ith/common/memory.h #endif // ITH_HAS_HEAP -extern DWORD currentProcessId; +extern DWORD current_process_id; extern DWORD debug; extern BYTE LeadByteTable[]; extern LPVOID page; diff --git a/vnr/vnrhook/src/hijack/texthook.h b/vnr/vnrhook/src/hijack/texthook.h index 775600c..91015c7 100644 --- a/vnr/vnrhook/src/hijack/texthook.h +++ b/vnr/vnrhook/src/hijack/texthook.h @@ -23,7 +23,7 @@ extern int currentHook; extern WCHAR dll_mutex[]; //extern WCHAR dll_name[]; extern DWORD trigger; -//extern DWORD currentProcessId; +//extern DWORD current_process_id; // jichi 6/3/2014: Get memory range of the current module extern DWORD processStartAddress, diff --git a/vnr/vnrhook/src/main.cc b/vnr/vnrhook/src/main.cc index ff73fdb..71b0c1b 100644 --- a/vnr/vnrhook/src/main.cc +++ b/vnr/vnrhook/src/main.cc @@ -69,7 +69,7 @@ HANDLE hFile, hMutex, hmMutex; -//DWORD currentProcessId; +//DWORD current_process_id; extern DWORD enter_count; //extern LPWSTR current_dir; extern DWORD engine_type; @@ -147,12 +147,12 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID unused) switch (fdwReason) { case DLL_PROCESS_ATTACH: { - static bool attached = false; - if (attached) // already attached + static bool attached_ = false; + if (attached_) // already attached { return TRUE; } - attached = true; + attached_ = true; 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 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. 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]; - 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); } { 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; ::hMutex = IthCreateMutex(dll_mutex, TRUE, &exists); // jichi 9/18/2013: own is true, make sure the injected dll is singleton if (exists) diff --git a/vnr/vnrhook/src/pipe.cc b/vnr/vnrhook/src/pipe.cc index ce76a57..b527ff6 100644 --- a/vnr/vnrhook/src/pipe.cc +++ b/vnr/vnrhook/src/pipe.cc @@ -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++) { @@ -167,7 +167,7 @@ void ConsoleOutput(LPCSTR text) // BYTE buffer[0x80]; // BYTE *buff; // 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; // if (sum > 0x80) { // buff = new BYTE[sum];