個hook function run左4000 iterations,然後crash?
本帖最後由 luckiejacky 於 2016-8-26 11:07 編輯
我已save左所有register before entry
restore when exit
應該可以同平時一樣禁行?
我用minhook
應該中間D functions改左個stack frame?
https://github.com/TsudaKageyu/minhook- char __fastcall hooked_game_thunk(void* a1, void* a2)
- {
- try {
- __asm {
- pushad
- }
- DWORD mess = ((struct game_message*)a2)->Message_Base;
- stringstream oss;
- oss << mess << endl;
- logfile2->shared_print(0, oss.str());
- __asm {
- popad
- }
- return original_game_thunk(a1, a2);
- }
- catch (std::exception e)
- {
- MessageBox(0, e.what(), e.what(), 0);
- return 0;
- }
- }
複製代碼 |
|
|