Cheat Engine aobscan in Autoit

11/26/2013 23:59 EthnicX#1
Moin Leute, ich wollte mal nachfragen ob es in Autoit möglich ist, eine Cheat Engine aob script zu injecten.

Hier ist der Script den ich gerne injecten würde:
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
label(whatever)
registersymbol(whatever)
aobscan(aob1,D9 5F 34 D9 47 30 D9 47 24 DE C1 D9 5F 30 D9 47 34 D9 47 10 83 EC 08 83 EC 04 D9 1C 24 83 EC 04)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:


exit:
jmp returnhere

aob1:
whatever:
jmp newmem
nop
nop
nop
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
whatever:
db D9 5F 34 D9 47 30 D9 47 24 DE C1 D9 5F 30 D9 47 34 D9 47 10 83 EC 08 83 EC 04 D9 1C 24 83 EC 04
unregistersymbol(whatever)
Wie könnte man das realisieren?
11/27/2013 19:26 berkay2578#2
Code:
#include <NomadMemory.au3>

$MemOpen = _MemoryOpen(ProcessExists("targetprocess.exe"))
$aob = _AOBScan($MemOpen, "D9 5F 34 D9 47 30 D9 47 24 DE C1 D9 5F 30 D9 47 34 D9 47 10 83 EC 08 83 EC 04 D9 1C 24 83 EC 04")
_MemoryClose($MemOpen)
MsgBox(0, "", $aob)

Func _AOBScan($handle, $sig)
	$sig = StringRegExpReplace($sig, "[^0123456789ABCDEFabcdef.]", "")
	$start_addr = 0x00400000
	$end_Addr = 0x0FFFFFFF
	For $addr = $start_addr To $end_Addr Step 51200 - (StringLen($sig) / 2)
		StringRegExp(_MemoryRead($addr, $handle, "byte[51200]"), $sig, 1, 2)
		If Not @error Then
			Return StringFormat("0x%.8X", $addr + ((@extended - StringLen($sig) - 2) / 2))
		EndIf
	Next
	Return 0
EndFunc   ;==>_AOBScan
05/23/2017 22:50 Crowmer#3
Uraltthread, aber vielleicht weiß es ja jemand: Wie mache ich das mit 64 Bit? Z.B. mit der KDMemory oder KryMemory? Nomad ist ja 32 Bit only glaube ich...

Ich beantworte mir das mal selbst. :)

Code:
#AutoIt3Wrapper_UseX64=y ; 64 Bit application
#RequireAdmin
#include "Functions\KDMemory.au3"
Const $processName = "Tutorial-x86_64.exe"
Const $moduleName = $processName
$processId = ProcessExists($processName)
$handles = _KDMemory_OpenProcess($processId)
ConsoleWrite("Opened " & $ProcessName & " with PID " & $handles[0] & @CRLF)
$modbase = _KDMemory_GetModuleBaseAddress ( $handles, $moduleName)
ConsoleWrite("Base address of module: "& $modbase & @CRLF)
$pattern = '29 93 90 07 00 00'
$startAddress = $modbase 
$endAddress   = "0x7FFFFFFFFFFFFFFF"
$err = "none"
$s2codeadd = _KDMemory_FindAddress($handles, $pattern, $startAddress, $endAddress, $err)
ConsoleWrite("Address of step 2 code: 0x" & Hex($modbase + $s2codeadd[1] - $modbase) & @CRLF)
$s2codeadd[1] = "0x" & Hex($modbase + $s2codeadd[1] - $modbase)
$memoryData = _KDMemory_ReadProcessMemory($handles, $s2codeadd[1], 'BYTE[' & 8 & ']')
ConsoleWrite(Hex($s2codeadd[1]) & " : " & $memoryData[1] & @CRLF)
Jetzt muss ich nur noch Speicher mit meinen Opcodes bestücken und bei $s2codeadd den Jump injecten.

Hat hierfür eventuell jemand einen Tipp?
08/21/2022 04:43 Fernando_Liro#4
hello, in case you skip some houses ? how would it work? for example ?? 00 11 22 ?9 44 bd, could you make it work?