I tried to make a registersymbol but the line of code:
movsxd rdx,dword ptr [rsi+18]
it is inverted how do I make registersymbol in this case?
here's what I tried to do:
Spoiler
Code: Select all
{ Game : Carcassonne.exe
[ENABLE]
//aobscan(PointsA,48 63 56 18 48 8B C8 83 38 00 49 BB 40) // should be unique
assert(HUDScreen:OnPlayerScoreModified+62,48 63 56 18 48 8B C8 83 38 00 49 BB ?0) // should be unique
alloc(newmem,$1000,HUDScreen:OnPlayerScoreModified+62)
label(code)
label(return)
//alloc(setPoints,8)
label(setPoints)
registersymbol(setPoints)
newmem:
mov rdx,[setPoints]
code:
movsxd rdx,dword ptr [rsi+18]
mov rcx,rax
jmp return
setPoints:
dd (int)100
HUDScreen:OnPlayerScoreModified+62:
jmp newmem
nop 2
return:
//registersymbol(PointsA)
[DISABLE]
HUDScreen:OnPlayerScoreModified+62:
db 48 63 56 18 48 8B C8
unregistersymbol(*)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: HUDScreen:OnPlayerScoreModified+62
HUDScreen:OnPlayerScoreModified+37: 41 FF D3 - call r11
HUDScreen:OnPlayerScoreModified+3a: 85 C0 - test eax,eax
HUDScreen:OnPlayerScoreModified+3c: 0F 84 37 00 00 00 - je HUDScreen:OnPlayerScoreModified+79
HUDScreen:OnPlayerScoreModified+42: 49 8B 87 18 02 00 00 - mov rax,[r15+00000218]
HUDScreen:OnPlayerScoreModified+49: 48 8B C8 - mov rcx,rax
HUDScreen:OnPlayerScoreModified+4c: 48 8B D7 - mov rdx,rdi
HUDScreen:OnPlayerScoreModified+4f: 83 38 00 - cmp dword ptr [rax],00
HUDScreen:OnPlayerScoreModified+52: 49 BB A0 58 CE 26 61 02 00 00 - mov r11,System.Collections.Generic.Dictionary`2[TKey_REF,TValue_REF]:get_Item
HUDScreen:OnPlayerScoreModified+5c: 41 FF D3 - call r11
HUDScreen:OnPlayerScoreModified+5f: 83 3E 00 - cmp dword ptr [rsi],00
// ---------- INJECTING HERE ----------
HUDScreen:OnPlayerScoreModified+62: 48 63 56 18 - movsxd rdx,dword ptr [rsi+18]
// ---------- DONE INJECTING ----------
HUDScreen:OnPlayerScoreModified+66: 48 8B C8 - mov rcx,rax
HUDScreen:OnPlayerScoreModified+69: 83 38 00 - cmp dword ptr [rax],00
HUDScreen:OnPlayerScoreModified+6c: 49 BB 40 51 63 2D 61 02 00 00 - mov r11,HUDPlayer:SetPoints
HUDScreen:OnPlayerScoreModified+76: 41 FF D3 - call r11
HUDScreen:OnPlayerScoreModified+79: 48 8B 75 E8 - mov rsi,[rbp-18]
HUDScreen:OnPlayerScoreModified+7d: 48 8B 7D F0 - mov rdi,[rbp-10]
HUDScreen:OnPlayerScoreModified+81: 4C 8B 7D F8 - mov r15,[rbp-08]
HUDScreen:OnPlayerScoreModified+85: 48 8D 65 00 - lea rsp,[rbp+00]
HUDScreen:OnPlayerScoreModified+89: 5D - pop rbp
HUDScreen:OnPlayerScoreModified+8a: C3 - ret
}
Normally I do this:
Spoiler
Code: Select all
{ Game : Carcassonne.exe
[ENABLE]
//aobscan(PointsA,48 63 56 18 48 8B C8 83 38 00 49 BB 40) // should be unique
assert(HUDScreen:OnPlayerScoreModified+62,48 63 56 18 48 8B C8 83 38 00 49 BB ?0) // should be unique
alloc(newmem,$1000,HUDScreen:OnPlayerScoreModified+62)
label(code)
label(return)
label(setPoints)
registersymbol(setPoints)
newmem:
mov rdx,[setPoints]
code:
mov [rsi+18],rdx
//movsxd rdx,dword ptr [rsi+18]
mov rcx,rax
jmp return
setPoints:
dd (int)100
HUDScreen:OnPlayerScoreModified+62:
jmp newmem
nop 2
return:
//registersymbol(PointsA)
[DISABLE]
HUDScreen:OnPlayerScoreModified+62:
db 48 63 56 18 48 8B C8
unregistersymbol(*)
dealloc(newmem)
But in this game it doesn't work
thx