Use raw HP diffs with simple BattleParam scanner
This commit is contained in:
@@ -20,21 +20,21 @@ start:
|
||||
get_data_ptr_ret:
|
||||
pop ebx # ebx = suffix payload
|
||||
|
||||
mov esi, [ebx] # scan_start, scans for signature address, not table base
|
||||
mov esi, [ebx] # scan_start
|
||||
mov edx, [ebx + 4] # scan_end
|
||||
mov ecx, [ebx + 8] # signature_size
|
||||
sub edx, ecx # scan limit = end - sig_size
|
||||
lea edi, [ebx + 16] # signature ptr
|
||||
|
||||
scan_again:
|
||||
mov edx, [ebx + 4] # scan_end
|
||||
mov ecx, [ebx + 12] # signature_size
|
||||
sub edx, ecx # scan limit = end - sig_size
|
||||
cmp esi, edx
|
||||
ja not_found
|
||||
|
||||
xor ebp, ebp
|
||||
lea edi, [ebx + 20] # signature ptr
|
||||
|
||||
compare_again:
|
||||
cmp ebp, ecx
|
||||
jae found_signature
|
||||
jae found_table
|
||||
|
||||
mov al, [esi + ebp]
|
||||
cmp al, [edi + ebp]
|
||||
@@ -47,14 +47,11 @@ next_candidate:
|
||||
inc esi
|
||||
jmp scan_again
|
||||
|
||||
found_signature:
|
||||
# esi = signature address; table base = esi - signature_offset
|
||||
mov ebp, esi
|
||||
sub ebp, [ebx + 8] # ebp = BattleParam table base
|
||||
|
||||
mov ecx, [ebx + 16] # patch entry count
|
||||
mov edi, [ebx + 12] # signature_size
|
||||
lea edi, [ebx + edi + 20] # patch entries after header+signature
|
||||
found_table:
|
||||
# esi = BattleParamEntry_on.dat base
|
||||
mov ecx, [ebx + 12] # patch entry count
|
||||
mov edi, [ebx + 8] # signature_size
|
||||
lea edi, [ebx + edi + 16] # patch entries after header+signature
|
||||
|
||||
patch_again:
|
||||
test ecx, ecx
|
||||
@@ -62,14 +59,14 @@ patch_again:
|
||||
|
||||
mov edx, [edi] # offset from table base
|
||||
mov al, [edi + 4] # byte value
|
||||
mov [ebp + edx], al
|
||||
mov [esi + edx], al
|
||||
|
||||
add edi, 5
|
||||
dec ecx
|
||||
jmp patch_again
|
||||
|
||||
done:
|
||||
mov eax, ebp # return found table base
|
||||
mov eax, esi # return found table base
|
||||
jmp return
|
||||
|
||||
not_found:
|
||||
@@ -88,10 +85,9 @@ get_data_ptr:
|
||||
# Server suffix starts here:
|
||||
# uint32_t scan_start
|
||||
# uint32_t scan_end
|
||||
# uint32_t signature_offset
|
||||
# uint32_t signature_size
|
||||
# uint32_t patch_entry_count
|
||||
# signature bytes from table+signature_offset
|
||||
# signature bytes from table start
|
||||
# repeated patch entries:
|
||||
# uint32_t offset
|
||||
# uint8_t value
|
||||
|
||||
Reference in New Issue
Block a user