Page 1 of 1

infinite wood aob script Help!

Posted: Thu Nov 02, 2023 5:48 pm
by Kinantot420
Hi i tried having infinite aob script wood resource but it keep going to Zero intead of increading i lose everyting heres the code i used. the game is northgard

[ENABLE]


aobscan(Wood,F2 49 0F 10 42 58 F2 48 0F 11 45 D8 F2 48 0F 10) // should be unique
alloc(newmem,$1000,Wood)

label(code)
label(return)

newmem:

code:
//movsd xmm0,[r10+58]
add [r10+58],999
jmp return

Wood:
jmp newmem
nop
return:
registersymbol(Wood)

[DISABLE]

Wood:
db F2 49 0F 10 42 58

unregistersymbol(Wood)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 76CAA01353FB

76CAA01353D2: 48 89 6C 24 F8 - mov [rsp-08],rbp
76CAA01353D7: 48 83 C4 30 - add rsp,30
76CAA01353DB: 89 45 CC - mov [rbp-34],eax
76CAA01353DE: F2 0F 2A E0 - cvtsi2sd xmm4,eax
76CAA01353E2: F2 48 0F 11 65 D8 - movsd [rbp-28],xmm4
76CAA01353E8: F2 48 0F 10 C4 - movsd xmm0,xmm4
76CAA01353ED: 48 81 C4 D0 00 00 00 - add rsp,000000D0
76CAA01353F4: 5D - pop rbp
76CAA01353F5: 48 C3 - ret
76CAA01353F7: 4C 8B 55 10 - mov r10,[rbp+10]
// ---------- INJECTING HERE ----------
76CAA01353FB: F2 49 0F 10 42 58 - movsd xmm0,[r10+58]
// ---------- DONE INJECTING ----------
76CAA0135401: F2 48 0F 11 45 D8 - movsd [rbp-28],xmm0
76CAA0135407: F2 48 0F 10 C0 - movsd xmm0,xmm0
76CAA013540C: 48 81 C4 D0 00 00 00 - add rsp,000000D0
76CAA0135413: 5D - pop rbp
76CAA0135414: 48 C3 - ret
76CAA0135416: 48 8B 45 10 - mov rax,[rbp+10]
76CAA013541A: 48 8B 88 D8 00 00 00 - mov rcx,[rax+000000D8]
76CAA0135421: 48 89 8D 48 FF FF FF - mov [rbp-000000B8],rcx
76CAA0135428: 48 85 C9 - test rcx,rcx
76CAA013542B: 75 1E - jne 76CAA013544B
}

I also tried this moving to a new memory but still doesnt work
code:
//movsd xmm0,[r10+58]
mov [r10+58],rax
add [r10+58],999

heres the free memory
RAX=0000000000000000
RBX=0000000000000000

Re: infinite wood aob script Help!

Posted: Fri Nov 03, 2023 11:08 am
by LeFiXER
Try this:

Code: Select all

[ENABLE]
aobscan(Wood,F2 49 0F 10 42 58 F2 48 0F 11 45 D8 F2 48 0F 10) // should be unique
alloc(newmem,$1000,Wood)
alloc(max,8)
label(code)
label(return)
lable(max)

// It's a good idea to place changes under the newmem section so that you can refer to what code is different from the original in future
// because you may just forget what what original and what was not.

max:
  dq (float)9999.0

newmem: 
movsd xmm15,[max]
movsd [r10+58],xmm15

code:
movsd xmm0,[r10+58]
jmp return

Wood:
jmp newmem
nop
return:
registersymbol(Wood)
registersymbol(max)
[DISABLE]

Wood:
db F2 49 0F 10 42 58

unregistersymbol(Wood)
unregistersymbol(max)
dealloc(newmem)
dealloc(max)
Also, you should use code tags [ code ] ... [ / code ] (no spaces)

Re: infinite wood aob script Help!

Posted: Thu Jan 11, 2024 12:24 pm
by oyyzj
@Kinantot420: I will only point out your error, so you could understand and learn.

your code below:
------------------------------------
newmem:

code:
//movsd xmm0,[r10+58] <--- you NOP'ed this, which is the function code to write "wood" into xmm0 which is used in later instructions somewhere to actually update your "wood". since you NOP this whole functions code, the game will take "zero" and write into xmm0, which later instruction take the "zero" from xmm0 and update your "wood". the proof is which you wrote it yourself that you lost your "wood" because of your script.
add [r10+58],999 <--- this is OK, you write your desired value into stack but that's all of it. the game then don't know what do to with it afterwards.
jmp return
-----------------------------------

simple fix:

newmem:
add [r10+58],999 <--- write your desired value into stack first.
code:
movsd xmm0,[r10+58] <--- then let game write your changed stack into xmm0, game should take care of the rest for you.
jmp return

---------------------------------

try it out and see if it works for you. since i don't have the game to check myself if the simple fix will work.

BR