Skip to content

Instantly share code, notes, and snippets.

@trkyshorty
Last active May 29, 2022 18:34
Show Gist options
  • Save trkyshorty/39248bb770575aa2f7abcc93bc82a6a4 to your computer and use it in GitHub Desktop.
Save trkyshorty/39248bb770575aa2f7abcc93bc82a6a4 to your computer and use it in GitHub Desktop.
import ctypes
from mem_edit import Process
KO_PTR_CHR = 0x10131C0
KO_OFF_MAX_HP = 0x6B8
pid = Process.get_pid_by_name('KnightOnLine.exe')
with Process.open_process(pid) as p:
KO_CHR_ADDR = p.read_memory(KO_PTR_CHR, ctypes.c_int())
CHARACTER_MAX_HP = p.read_memory(KO_CHR_ADDR.value + KO_OFF_MAX_HP, ctypes.c_int())
print(CHARACTER_MAX_HP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment