//alloc(newmem,4048,"DiabloImmortal.exe"+18CCCA0)
alloc(newmem,2048,"DiabloImmortal.exe"+196E1E0)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:


push rax // address
push rdx // address
mov rax,newmem+500 // address 0x0 value vtmem
mov rdx,[rbx+rcx]

cmp [rbx+rcx],65646C45 // Elder Rift
jne exit01
cmp [rbx+rcx+4],69522072 // Elder Rift
jne exit01
mov [rax+8*0],1
mov [rax+8*1],rdx
exit01:

cmp [rbx+rcx],74736557 // Westmarch
jne exit02
cmp [rbx+rcx+4],6372616D // Westmarch
jne exit02
mov [rax+8*0],2
mov [rax+8*1],rdx
exit02:

cmp [rbx+rcx],6C616843 // Challenge Rift
jne exit03
cmp [rbx+rcx+A],74666952 // Challenge Rift
jne exit03
mov [rax+8*0],3
mov [rax+8*1],rdx
exit03:
pop rdx
pop rax

exit:

back01:
movzx eax,byte ptr [rbx+rcx]
mov [rcx],al
lea rcx,[rcx+01]
sub r8,01
jne back01 // fix "DiabloImmortal.exe"+1DF5090+A:

// [rbx+rcx] = text name map

jmp returnhere

//"DiabloImmortal.exe"+18CCCA0:
"DiabloImmortal.exe"+196E1E0:

jmp newmem
nop
returnhere:

//7FF6F709509A
//7FF6F70950A0
//7FF6F70950A8
