forked from Public-Mirror/Textractor
minor fixes
This commit is contained in:
parent
679317b5f5
commit
4310e97236
@ -16,6 +16,7 @@
|
||||
#include "const.h"
|
||||
#include "ithsys/ithsys.h"
|
||||
#include "disasm/disasm.h"
|
||||
#include "growl.h"
|
||||
//#include "winseh/winseh.h"
|
||||
|
||||
//#define ConsoleOutput(...) (void)0 // jichi 9/17/2013: I don't need this ><
|
||||
@ -317,8 +318,6 @@ DWORD TextHook::UnsafeSend(DWORD dwDataBase, DWORD dwRetn)
|
||||
dwRetn = 0;
|
||||
|
||||
*(ThreadParam*)pbData = { GetCurrentProcessId(), dwAddr, dwRetn, dwSplit };
|
||||
*((DWORD *)pbData + 1) = dwRetn;
|
||||
*((DWORD *)pbData + 2) = dwSplit;
|
||||
if (dwCount) {
|
||||
DWORD unused;
|
||||
|
||||
@ -432,7 +431,7 @@ int TextHook::UnsafeInsertHookCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DWORD old;
|
||||
LPVOID addr = (void*)hp.address;
|
||||
VirtualProtect(addr, sizeof(inst), PAGE_EXECUTE_READWRITE, &old);
|
||||
|
@ -15,6 +15,7 @@ extern DWORD trigger;
|
||||
|
||||
// jichi 9/25/2013: This class will be used by NtMapViewOfSectionfor
|
||||
// interprocedure communication, where constructor/destructor will NOT work.
|
||||
|
||||
class TextHook
|
||||
{
|
||||
int InsertHookCode();
|
||||
@ -25,11 +26,11 @@ class TextHook
|
||||
int RemoveReadCode();
|
||||
int SetHookName(LPCSTR name);
|
||||
public:
|
||||
HookParam hp;
|
||||
LPSTR hook_name;
|
||||
int name_length;
|
||||
BYTE recover[0x68 - sizeof(HookParam)];
|
||||
BYTE original[0x10];
|
||||
HookParam hp;
|
||||
|
||||
unsigned __int64 Address() const { return hp.address; }
|
||||
DWORD Type() const { return hp.type; }
|
||||
|
@ -65,7 +65,7 @@ void CreatePipe()
|
||||
case HOST_COMMAND_NEW_HOOK:
|
||||
{
|
||||
auto info = *(InsertHookCmd*)buffer;
|
||||
NewHook(info.hp, info.name);
|
||||
NewHook(info.hp, info.name, 0);
|
||||
}
|
||||
break;
|
||||
case HOST_COMMAND_REMOVE_HOOK:
|
||||
|
Loading…
x
Reference in New Issue
Block a user