title: Hex string as input to scanf in gdb
body: <p>Can we give input string by it's hex value in gdb. For example, a simple program</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      char buffer[20];
      fscanf(stdin, "%s", buffer);
      printf("%s", buffer);
  }
  </code></pre>
  
  <p>Debugging it:</p>
  
  <pre><code>ravi@ravi-desktop:~$ gdb -q ./a.out
  Reading symbols from /home/ravi/a.out...done.
  (gdb) list 1
  1   #include &lt;stdio.h&gt;
  2   
  3   int main() {
  4       char buffer[20];
  5       fscanf(stdin, "%s", buffer);
  6       printf("%s", buffer);
  7   }
  (gdb) r
  Starting program: /home/ravi/a.out 
  \x41\x41\x41\x41
  \x41\x41\x41\x41
  Program exited with code 014.
  (gdb) quit
  </code></pre>
  
  <p>I want to input four <code>A</code>'s as input using hex value <code>\x41</code> but it's considering each character separately.</p>
  
  <p><strong>The real requirement is I'm playing with Shellcode in Stack-based Buffer Overflow, and I need to input shellcode in hex at a time of debugging.</strong></p>
  
  <p>Can anybody help me here.</p>
  
  <p>Thank you
  Ravi</p>