title: How does sscanf work? (in assembly)
body: <p>I'm in the process of trying to decode some assembly code generated from a binary.  There's a call to the <code>sscanf</code> function in the code:</p>
  
  <pre><code> 400f08:       e8 13 fc ff ff          callq  400b20 &lt;sscanf@plt&gt;
   400f0d:       89 45 fc                mov    %eax,-0x4(%rbp)
  </code></pre>
  
  <p>Can you tell me how <code>sscanf</code> works in assembly?  I'm pretty sure the number of arguments is stored in <code>%eax</code>....does it push the input into the stack in reverse order?  So say my input is <code>0 1</code>, after running sscanf, <code>%eax</code>=2 and the stack looks like:</p>
  
  <pre><code>1
  0  &lt;----%rsp (top of the stack)
  </code></pre>
  
  <p>Is this correct?
  Thanks!</p>