I have made an .exe application in C# and now I want to call my own functions inside of it by injecting a .DLL with EasyHook.
But since I hard-coded the function in my application I need to get the address of the function through the .exe instead of the .DLL. Normall, if you hook a method inside a .dll you do this:
ChangeNumberHook = LocalHook.Create(LocalHook.GetProcAddress("CallMyFunctions.dll", "ChangeNumber"), new DChangeNumber(ChangeNumber_Hooked), this);
But since I got a .exe I need to get the function from the .exe, I use a program to view a process' modules and function names, but when I click in the CallMyFunction.exe module inside the process I don't ge a list of available methods. When I click any
other .dll I do ge the functions I can hook. So even though I can't see it I still tried to hook it:
ChangeNumberHook = LocalHook.Create(LocalHook.GetProcAddress("CallMyFunctions.exe", "ChangeNumber"), new DChangeNumber(ChangeNumber_Hooked), this);
But I get an exception saying the method does not exist. So how do I call custom functions that are not inside a .DLL? I've tried to open CallMyFuncions with IDA and see where my function is located to copy the address from there and hard-code it in the injected
.DLL. What looked like this:
ChangeNumberHook = LocalHook.Create(
But this crashes my CallMyFunctions.exe app and messageboxes me with: "Assertion failed!". Can someone tell me how I can solve this problem?
Thanks in advance,