Thank you for the awsome guide!
Last edited by xMythx; 02-18-2011 at 06:49 PM.
Nice guide, except the point that GETWOWBASEADDRESS wasn't written by your friendly helper, but by me ;p The code you got there seems to be decompiled from WoWtf (capslock variablenames and so on) . I originally wrote this function for jonny when 4.0.1 gone live.
paste-code - easily share snippets. - by Anonymous
Here is the real version, looks ways nicer like this if you ask me
However, don't wanna cry around for such a basic function, nice guide, +rep!
Edit: Apples > Oranges ;O
Last edited by IceFire32; 02-21-2011 at 07:54 AM.
Hi! My name is Devon and I’m an alcoholic. Moving on…
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/319172-guide-how-make-wow-bot-complete-newbs.html
AutoIt is disgusting imo, so I didn't look very closely, but at a glance it seems like your code leaks the snapshot handle if the WoW process isn't found.
Also, in your call to 'CreateToolhelp32Snapshot' you embed the constant 0x8. Give it a damn name! Magic numbers are so annoying when you're reading someone elses code.
K quick fix(to his function):
And your right magic numbers are stupid ^_^Code:Func GetWoWBaseAddress($PID = 0); <--You do not have to enter a pid at the same time wingetprocess might not necessarily have a failure. If $PID = 0 Then $PID = WinGetProcess("World of Warcraft", "") EndIf If $PID <> -1 Then ;<--Failure of wingetprocess is -1 $hSnap = DllCall("Kernel32.dll", "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 0x8, "DWORD", $PID) ; Create MODULEENTRY32 structure $stModule = DllStructCreate("DWORD dwSize;DWORD th32ModuleID;DWORD th32ProcessID;" & _ "DWORD GlblcntUsage;DWORD ProccntUsage;ptr modBaseAddr;" & _ "DWORD modBaseSize;HANDLE hModule;WCHAR szModule[256];" & _ "WCHAR szExePath[260]") DllStructSetData($stModule, "dwSize", DllStructGetSize($stModule)) ; Set size $ret = DllCall("Kernel32.dll", "BOOLEAN", "Module32FirstW", "HANDLE", $hSnap[0], "ptr", DllStructGetPtr($stModule)) If ($ret[0] = False) Then DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $hSnap[0]) Return 0 Else $ret[0] = True Do If DllStructGetData($stModule, "szModule") = "Wow.exe" Then DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $hSnap[0]) Return DllStructGetData($stModule, "modBaseAddr") EndIf $ret = DllCall("Kernel32.dll", "BOOLEAN", "Module32NextW", "HANDLE", $hSnap[0], "ptr", DllStructGetPtr($stModule)) Until $ret[0] = False EndIf Else MsgBox(0, "Error", "Process not found") Exit EndIf EndFunc ;==>GetWoWBaseAddress
Hi! My name is Devon and I’m an alcoholic. Moving on…
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/319172-guide-how-make-wow-bot-complete-newbs.html
You're right (like nearly always ;p), it leaked the handle and au3 is disgusting, I don't use it myself, "apples" ftw. Like I said before, I wrote it for jonny.
paste-code - easily share snippets. - by Ende!
Fixed version.
I think my fix is a little more convenient because it can tell the difference between if the process is not found and if you did not put in a PID for the function. It would help with fixing bugs IMO. Either way it fixes the leak XD
And thanks again for the function it's awesome! ^_^
Hi! My name is Devon and I’m an alcoholic. Moving on…
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/319172-guide-how-make-wow-bot-complete-newbs.html
Hooker.cpp - hadesmem - Project Hosting on Google Code:
PVOID pPresent = pSwapChainVMT[8];
I love how it's 8
Last edited by bad6oy30; 02-22-2011 at 09:36 PM.
The code you're referencing is part of a PoC project. I use some very nasty very awful hacks in parts of the injected portion of Hades at the moment. The project is in the alpha stage at the moment and so it's alpha quality code, I make no apologies for that.
I was previously using COM interface wrapping, but then ditched that and changed to detours because of problems with IDXGIFactory1 creation. However, you already knew that, because I told you in a PM when you were asking for my help with your DX11 hooking. You obviously just want to be obnoxious.
That being said, the left hand side of the assignment will tell you exactly what that magic number is (Present's VMT index), whereas in the code above I was critiquing the only way to know what the magic number represented was to refer to MSDN.
Last edited by Cypher; 02-23-2011 at 12:31 AM.
Destroyed.