Skip to content

Instantly share code, notes, and snippets.

@Tony3-sec
Last active July 27, 2017 15:36
Show Gist options
  • Select an option

  • Save Tony3-sec/a1d13f2131a0956029294f8e2473f36a to your computer and use it in GitHub Desktop.

Select an option

Save Tony3-sec/a1d13f2131a0956029294f8e2473f36a to your computer and use it in GitHub Desktop.
>>> ord('c') ^ 0x52
49
>>> 99 ^ 0x52
49
>>> 99 ^ int('0x' + '52', 16)
49
>>> ord('\x14') ^ 0x52
70
>>> hex(0x12 ^ 0x50)
'0x42'
>>> hex(int('12', 16) ^ int('50', 16))
'0x42'
>>> hex(0x12ef ^ 0xabcd)
'0xb922'
>>> hex(int("12ef", 16) ^ int("abcd", 16))
'0xb922'
>>> int('0x' + '52', 16)
82
>>> 0x52
82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment