And i need some small help again)
I start work from tutorial in "Contributing to Ares". Start new project in MSVC 2008, select DLL(without MFC), and wrote some code:
#include <YRPP.h>
#include <MacroHelpers.h>
DEFINE_HOOK(71A92A, _Temporal_AvoidFriendlies, 5)
{
GET(TemporalClass *, Temp, ESI);
HouseClass *hv = Temp->Target->Owner;
HouseClass *ho = Temp->Owner->Owner;
return ho->IsAlliedWith(hv) ? 0x71A97D : 0;
}
Then i build all this(add StaticInits.cpp to project and configure paths), copy dll to ra2 folder, create inj file:
71A92A = _Temporal_AvoidFriendlies, 5
Then i start synerge but again nothing happen =(.
LOG:
[17:41:19] Syringe 0.6.0.0
[17:41:19] ===============
[17:41:19] WinMain: lpCmdLine = ""D:\Games\RA2\gamemd.exe""
[17:41:19] WinMain: Trying to load executable file "D:\Games\RA2\gamemd.exe"...
[17:41:19] SyringeDebugger::RetrieveInfo: Retrieving info from the executable file...
[17:41:19] SyringeDebugger::LoadControlFile: Control file successfully loaded.
[17:41:19] exe = D:\Games\RA2\gamemd.exe
[17:41:19] pImLoadLibrary = 0x007E1220
[17:41:19] pImGetProcAddress = 0x007E1250
[17:41:19] pcEntryPoint = 0x007CD80F
[17:41:19] SyringeDebugger::LoadControlFile: Opening D:\Games\RA2\gamemd.exe to determine imports.
[17:41:19] WinMain: SyringeDebugger::FindDLLs();
[17:41:19] SyringeDebugger::FindDLLs: Recognized DLL: "exmachine.dll"
[17:41:19] SyringeDebugger::FindDLLs: Done (1 hooks added).
[17:41:19] WinMain: SyringeDebugger::Run("");
[17:41:19] SyringeDebugger::Run: Running process to debug. cmd = "D:\Games\RA2\gamemd.exe "
[17:41:19] SyringeDebugger::Run: Allocating 0x1000 bytes ...
[17:41:19] SyringeDebugger::Run: pAlloc = 0x00140000
[17:41:19] SyringeDebugger::Run: Filling allocated space with zero...
[17:41:19] SyringeDebugger::Run: Setting addresses...
[17:41:19] SyringeDebugger::Run: Writing DLL loader & caller code...
[17:41:19] SyringeDebugger::Run: pcLoadLibrary = 0x00140001
[17:41:19] SyringeDebugger::Run: Entering debug loop...
[17:41:20] SyringeDebugger::HandleException: Loaded ProcAddress: exmachine.dll - _Temporal_AvoidFriendlies - 0x01151020
[17:41:20] SyringeDebugger::HandleException: Finished retrieving proc addresses.
[17:41:20] SyringeDebugger::HandleException: Creating code hooks.
[17:41:20] SyringeDebugger::Run: Done.
[17:41:20] WinMain: SyringeDebugger::Run finished.
[17:41:20] WinMain: Exiting on success.
What i do wrong? -_-
And i have one question, what debbuger you use(fo disassembling)? I ask that because i don't know how start gamemd.exe from olly debugger. I know, i can start RAMD2.exe, but how debug in this case?)
I start work from tutorial in "Contributing to Ares". Start new project in MSVC 2008, select DLL(without MFC), and wrote some code:
#include <YRPP.h>
#include <MacroHelpers.h>
DEFINE_HOOK(71A92A, _Temporal_AvoidFriendlies, 5)
{
GET(TemporalClass *, Temp, ESI);
HouseClass *hv = Temp->Target->Owner;
HouseClass *ho = Temp->Owner->Owner;
return ho->IsAlliedWith(hv) ? 0x71A97D : 0;
}
Then i build all this(add StaticInits.cpp to project and configure paths), copy dll to ra2 folder, create inj file:
71A92A = _Temporal_AvoidFriendlies, 5
Then i start synerge but again nothing happen =(.
LOG:
[17:41:19] Syringe 0.6.0.0
[17:41:19] ===============
[17:41:19] WinMain: lpCmdLine = ""D:\Games\RA2\gamemd.exe""
[17:41:19] WinMain: Trying to load executable file "D:\Games\RA2\gamemd.exe"...
[17:41:19] SyringeDebugger::RetrieveInfo: Retrieving info from the executable file...
[17:41:19] SyringeDebugger::LoadControlFile: Control file successfully loaded.
[17:41:19] exe = D:\Games\RA2\gamemd.exe
[17:41:19] pImLoadLibrary = 0x007E1220
[17:41:19] pImGetProcAddress = 0x007E1250
[17:41:19] pcEntryPoint = 0x007CD80F
[17:41:19] SyringeDebugger::LoadControlFile: Opening D:\Games\RA2\gamemd.exe to determine imports.
[17:41:19] WinMain: SyringeDebugger::FindDLLs();
[17:41:19] SyringeDebugger::FindDLLs: Recognized DLL: "exmachine.dll"
[17:41:19] SyringeDebugger::FindDLLs: Done (1 hooks added).
[17:41:19] WinMain: SyringeDebugger::Run("");
[17:41:19] SyringeDebugger::Run: Running process to debug. cmd = "D:\Games\RA2\gamemd.exe "
[17:41:19] SyringeDebugger::Run: Allocating 0x1000 bytes ...
[17:41:19] SyringeDebugger::Run: pAlloc = 0x00140000
[17:41:19] SyringeDebugger::Run: Filling allocated space with zero...
[17:41:19] SyringeDebugger::Run: Setting addresses...
[17:41:19] SyringeDebugger::Run: Writing DLL loader & caller code...
[17:41:19] SyringeDebugger::Run: pcLoadLibrary = 0x00140001
[17:41:19] SyringeDebugger::Run: Entering debug loop...
[17:41:20] SyringeDebugger::HandleException: Loaded ProcAddress: exmachine.dll - _Temporal_AvoidFriendlies - 0x01151020
[17:41:20] SyringeDebugger::HandleException: Finished retrieving proc addresses.
[17:41:20] SyringeDebugger::HandleException: Creating code hooks.
[17:41:20] SyringeDebugger::Run: Done.
[17:41:20] WinMain: SyringeDebugger::Run finished.
[17:41:20] WinMain: Exiting on success.
What i do wrong? -_-
And i have one question, what debbuger you use(fo disassembling)? I ask that because i don't know how start gamemd.exe from olly debugger. I know, i can start RAMD2.exe, but how debug in this case?)