Ok, calling some functions with CreateRemoteThread() has been crashing with me since the new patch. So here is another way to get the current HP for use in an autopotter.
This method hooks the gethp() function of the new version of co, instead of calling it.
VERY IMPORTANT
Run This First at the Log On Screen to make sure the code does not execute over the coding being replaced while its being replaced (This needs to be done because i write the code byte by byte)
Other than that, the next time u run it on the same conquer process, it will recognize the hook was already established and will not overwrite the hook (it will make use of it instead)
Also note, this is currently configured to press F10 when ur HP is less than 1000.
PHP Code:
#include "NomadMemory.au3"
$PID = ProcessExists("Conquer.exe")
If $PID == 0 Then
MsgBox(0, "Error", "Conquer must be running first.")
Exit
EndIf
$MemID = _MemoryOpen($PID)
Global $HP_ADDR
If _MemoryRead(0x0056953E, $MemID, "byte") == -23 Then
$num = _MemoryRead(0x0056953F, $MemID, 'dword')
$HP_ADDR = BitAnd($num + 0x0056953E + 5, 0xFFFFFFFF) - 4
Else
$HP_ADDR = AllocMemory(24, $PID)
; Fill in the code we're gonna overwrite in the cave.
$Code = "0f84" & RelativePos($HP_ADDR+5, 0x00569554) ; je 00569554
$Code = $Code & "48" ; dec eax
$Code = $Code & "0f84" & RelativePos($HP_ADDR+5+StringLen($Code)/2, 0x00569549) ; je 00569549
; Put in our copy code (to copy the HP value)
$Code = $Code & "8915" & Int2Hex($HP_ADDR, 8) ; mov [$HP_ADDR],edx
; Then our jump back code
$Code = $Code & "e9" & RelativePos($HP_ADDR+23, 0x00569543) ; jmp 00569543
; Write our code
For $i = 0 To StringLen($Code)/2-1
_MemoryWrite($HP_ADDR+4+$i, $MemID, Dec(StringMid($Code, $i * 2 + 1, 2)), "byte")
Next
; Patch the jump
$Code = "e9" & RelativePos(0x0056953E, $HP_ADDR+4)
For $i = 0 To StringLen($Code)/2-1
_MemoryWrite(0x0056953E+$i, $MemID, Dec(StringMid($Code, $i * 2 + 1, 2)), "byte")
Next
EndIf
HotKeySet("!x", "ExitProg")
While 1
$HP = _MemoryRead($HP_ADDR, $MemID)
ToolTip(Hex($HP_ADDR) & ":AutoPotter Running (" & $HP & "). Alt+X to exit.", 20, 20)
If $HP < 1000 Then
Send("{F10}")
EndIf
Sleep(500)
WEnd
it's good i try use ur code on Spanish version and find address and change it ur code but still can't read HP can help me , i think problem when write code in empty address !!
i test it on English version 6 times wok fine in 4 and 2 times fail, i don't need u make another for Spanish
i just need tell me what my wrong after i change a memory , i need learn not get tool
Well, what i did for it was i used CE to find the HP memory address using a binary search. Then after finding this (non-static) value, i went right click "Find was accesses this address", and it gave me a line of assembly from the conquer process "MOV EDX,[EDI]", and i added a breakpoint to that line, and i noticed it was being executed once per frame. So i used autoit to allocate some memory, write some code into that allocated memory that restores the assembly instructions that my 5 byte jump will overwrite as well as storing the HP value in a static location, then at the end of the code in the allocated memory i had another jmp instruction that jumps back to just after my jump to my ram code. That way i was hooking that EDX value to retrieve the current HP... but its not working 100% of the time, so i was wrong to assume that the conquer code will always cross that path every frame.
[C++]Hooks 03/25/2010 - Coding Tutorials - 12 Replies so... ich denke mal, dass ich euch eine der wichtigsten teile in sachen gamehacking hier erklären kann, oder zumindest versuchen zu erklären:p
fangen wir mal damit an, was ich benutze:
-Visual Studio 2008 Professional + Visual Assist X
-IDA Pro Free
-ein game
los gehts:
erstellt euch eine struktur, wodrin ihr informationen über einen hook speichert.
bei mir sieht das so aus:
[c++]hooks 11/02/2009 - C/C++ - 2 Replies brauche hilfe bei meinen hooks!
ms detours will ich nich benutzen (vorallem weil die nich für meine zwecke laufen :D), ausserdem um weiterzu lernen eigenes system schreiben!
mein problem is wenn ich in einer funktion die ersten 5 bytes mit jmp dword überschreibe, und z.b. das 2 byte auch nen jmp dword ist, bleibt am ende 1 byte über!
in meiner subfunc speicher ich die register mit pushad, call , popad, den überschriebenen code hier einfügen, und dann jmp ....
Hooks mit VB? 04/22/2007 - .NET Languages - 21 Replies Nabend,
Ich versuch mich momentan den Tinytoon Hook hiermit zum implementieren, da mich Forceshock langsam.... :eek:
Wär nett wenn jemand noch sinnvolle Beispiele dazu hätte, ua. selbst Erfahrung damit hat.
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long ...