I wasn't planning on sharing it, which is why it's an injection at a specific location rather than an aobscan or aobscanregion. It's barely tested... This is just a simple fix, though.
Code: Select all
{ Game : valheim.exe
Author : Sigan
}
define(address,Player:UpdateAwake+14)
define(bytes,F3 0F 10 86 6C 06 00 00)
[ENABLE]
assert(address,bytes)
alloc(newmem,$1000,Player:UpdateAwake+14)
globalalloc(_localPlayer,4)
label(code)
label(return)
newmem:
mov [_localPlayer],rsi
code:
movss xmm0,[rsi+0000066C]
jmp return
address:
jmp newmem
nop 3
return:
[DISABLE]
address:
db bytes
// movss xmm0,[rsi+0000066C]
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: Player:UpdateAwake+14
24BDEC1C669: 00 00 - add [rax],al
24BDEC1C66B: 00 00 - add [rax],al
24BDEC1C66D: 00 00 - add [rax],al
24BDEC1C66F: 00 55 48 - add [rbp+48],dl
Player:UpdateAwake+2: 8B EC - mov ebp,esp
Player:UpdateAwake+4: 48 83 EC 30 - sub rsp,30
Player:UpdateAwake+8: 48 89 75 F8 - mov [rbp-08],rsi
Player:UpdateAwake+c: 48 8B F1 - mov rsi,rcx
Player:UpdateAwake+f: F3 0F 11 4D F0 - movss [rbp-10],xmm1
Player:UpdateAwake+14: F3 0F 10 86 6C 06 00 00 - movss xmm0,[rsi+0000066C]
// ---------- INJECTING HERE ----------
Player:UpdateAwake+1c: F3 0F 5A C0 - cvtss2sd xmm0,xmm0
// ---------- DONE INJECTING ----------
Player:UpdateAwake+20: 66 0F 57 C9 - xorpd xmm1,xmm1
Player:UpdateAwake+24: 66 0F 2F C8 - comisd xmm1,xmm0
Player:UpdateAwake+28: 0F 8A F5 00 00 00 - jp Player:UpdateAwake+123
Player:UpdateAwake+2e: 0F 87 EF 00 00 00 - ja Player:UpdateAwake+123
Player:UpdateAwake+34: F3 0F 10 86 6C 06 00 00 - movss xmm0,[rsi+0000066C]
Player:UpdateAwake+3c: F3 0F 5A C0 - cvtss2sd xmm0,xmm0
Player:UpdateAwake+40: F3 0F 10 4D F0 - movss xmm1,[rbp-10]
Player:UpdateAwake+45: F3 0F 5A C9 - cvtss2sd xmm1,xmm1
Player:UpdateAwake+49: F2 0F 58 C1 - addsd xmm0,xmm1
Player:UpdateAwake+4d: F2 0F 5A E8 - cvtsd2ss xmm5,xmm0
}
Yours, on the other hand, has this line:
Code: Select all
// ORIGINAL CODE - INJECTION POINT: Player:.cctor+a4
When I looked at that location, mine didn't have line a4, but a3. Based on the way your script is written, that shouldn't have mattered, but oh well. I probably could have injected my script there. Meh...
And, regarding mods, I only started using a couple mods today. This problem has been consistent prior to mods, however, on this most recent table, and most recent version of Valheim.
Edit: Just noticed you updated your ct to v2.3. I've been using v2.1.