Skip to content

Instantly share code, notes, and snippets.

@0xgalz
Last active November 14, 2023 03:41
Show Gist options
  • Select an option

  • Save 0xgalz/d4ff107925184d59673cd986cbed2e59 to your computer and use it in GitHub Desktop.

Select an option

Save 0xgalz/d4ff107925184d59673cd986cbed2e59 to your computer and use it in GitHub Desktop.
import idc
import ida_frame
import ida_struct
def get_local_var_value_64(loc_var_name):
frame = ida_frame.get_frame(idc.here())
loc_var = ida_struct.get_member_by_name(frame, loc_var_name)
loc_var_ea = loc_var.soff + idc.GetRegValue("RSP")
loc_var_value = idc.read_dbg_qword(loc_var_ea) # In case the variable is 32bit, use get_wide_dword() instead.
return loc_var_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment