title: how to read two digit from a file, XOR it with (0x91) and print to screen?
body: <p>i try to read file of bytes written in hex for example: (909090) which is nop nop nop in assembly, i want to xor each two digit as a byte with the 0x91.</p>
  
  <p>how do i print the value in hex? now it prints just numbers with no meaning.</p>
  
  <p>in general i want to build a packer to my assembly code.</p>
  
  <pre><code>def add_prefix(a):
      a = str(a)
      a = '0x' + a
      a = int(a, 16)
      return a
  
  fr = open('C:\code.txt', 'r')
  word = ''
  b = ''
  for line in fr:
      b += line
  
  count = 0
  
  for char in b:
      char = str(char)
      word += char
      if count%2 == 0:
          word = int(str(add_prefix(word)^91), 16)
          print word
          word = ""
  </code></pre>