Skip to content

Instantly share code, notes, and snippets.

@withzombies
Last active June 3, 2016 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save withzombies/6ec09980aca1f11e97f441e9dae34be9 to your computer and use it in GitHub Desktop.
Save withzombies/6ec09980aca1f11e97f441e9dae34be9 to your computer and use it in GitHub Desktop.
# get_parameter_at takes the architecture, the caller site, a calling
# convention (None = cdecl), and a parameter number
canary_frame = main.get_parameter_at(bv.arch, memcmp.address, None, 0)
canary_address = main.get_parameter_at(bv.arch, memcmp.address, None, 1)
canary_width = main.get_parameter_at(bv.arch, memcmp.address, None, 2)
canary = bv.read(canary_address.value, canary_width.value)
print "Canary: {0}".format(canary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment