Confusing hook..
Hi.
I'm currently losing my mind trying to hook a function so any help at all would be greatly appreciated.
First off, I don't want to use a DLL because I want to try something different for once.
So far what I've done is, allocate some memory so I can write my own function, and create a jump at the beginning of the function I'm hooking. This is where I got confused. I now want to use this function I'm hooking in my own function, how would I do this?
Since I created a jump at the beginning it's just going to keep coming back to my own function.
So, my question is. Is there a way to hook a function but still use that function normally somewhere else in the same process?
Also, another question somewhat related to this. Is there a way to find out how big the function is automatically? When I say automatically I don't mean with some Windows function. I mean, is there some way to tell many bytes a function has up to the next 'RETN' instruction?
I was thinking of reading the bytes until it finds 'C3' but if you guys have any other suggestions that would be nice. (Not sure if C3 correct for 'RETN').
I hope you understand what I'm asking for here, it's rather confusing.
Thank you.
I'm currently losing my mind trying to hook a function so any help at all would be greatly appreciated.
First off, I don't want to use a DLL because I want to try something different for once.
So far what I've done is, allocate some memory so I can write my own function, and create a jump at the beginning of the function I'm hooking. This is where I got confused. I now want to use this function I'm hooking in my own function, how would I do this?
Since I created a jump at the beginning it's just going to keep coming back to my own function.
So, my question is. Is there a way to hook a function but still use that function normally somewhere else in the same process?
Also, another question somewhat related to this. Is there a way to find out how big the function is automatically? When I say automatically I don't mean with some Windows function. I mean, is there some way to tell many bytes a function has up to the next 'RETN' instruction?
I was thinking of reading the bytes until it finds 'C3' but if you guys have any other suggestions that would be nice. (Not sure if C3 correct for 'RETN').
I hope you understand what I'm asking for here, it's rather confusing.
Thank you.

