These are chat archives for EasyHook/EasyHook

29th
May 2017
Nikolaj Mariager
@TinkerWorX
May 29 2017 18:54
@spazzarama I think I found the cause of my crashes with the injection.
I was injecting it at a random place, which meant I was injecting a 5 byte jump at a location with 1+3+3 byte instructions, which meant the 3rd instruction would get sliced up.
Can I force the hook to use a bit more space in any way? Force it to make a 7 byte patch so the instructions are properly saved.
I guess I should try and confirm if that was the actual cause of the problem before trying to make it work :P
Justin Stenning
@spazzarama
May 29 2017 21:08
@TinkerWorX easyhook already checks for this, it disassembles the instructions to determine their length and will increase the size up to the end of the instruction to be moved.
Nikolaj Mariager
@TinkerWorX
May 29 2017 21:09
hmm
I wonder why it isn't working then.
Should I be using any special kind of signature for the function? Calling convention?
Justin Stenning
@spazzarama
May 29 2017 21:10
I'll have to have a try, unfortunately very busy atm. For the handler? Just whatever I think
Nikolaj Mariager
@TinkerWorX
May 29 2017 21:12
Yeah, it's okay. I guess I'll stop for today. I'll see if I can get a debugger attached and follow the injected assembly and see where/why it fails.
Justin Stenning
@spazzarama
May 29 2017 21:13
Perhaps something isn't being backed up beforehand (register)
Nikolaj Mariager
@TinkerWorX
May 29 2017 21:13
I was under the assumption that EasyHook backed up everything? Something like PushAD or similar?
Justin Stenning
@spazzarama
May 29 2017 21:15
Your handler has not parameters right?
Nikolaj Mariager
@TinkerWorX
May 29 2017 21:15
Nope, just a void Handler(); with calltype set to __cdecl
I've tried with __stdcall as well.
Nikolaj Mariager
@TinkerWorX
May 29 2017 21:24
I'll fiddle some more with it tomorrow. Thanks for getting back to me. I'll let you know if I figure out what the problem is.
Justin Stenning
@spazzarama
May 29 2017 21:30
Try a few other locations, eg taking out the start of a loop might not work
Thx, I'll try to find some time but prob not this week