Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not positive, but I'm using the <a href="http://docs.python.org/2/library/struct.html#struct.unpack" rel="nofollow">documentation</a> to take a stab at it.</p> <p>Looking at the docs, we're going to return a tuple based on the format string:</p> <blockquote> <p>Unpack the string (presumably packed by pack(fmt, ...)) according to the given format. The result is a tuple even if it contains exactly one item. The string must contain exactly the amount of data required by the format (len(string) must equal calcsize(fmt)).</p> </blockquote> <p>The item coming in (<code>b</code>) is <em>probably</em> a byte buffer (represented as a string) - looking at the examples they are represented the the <code>\x</code> escape, <a href="http://www.python.org/dev/peps/pep-0223/" rel="nofollow">which consumes</a> the next two characters as hex.</p> <p>It appears the format string is </p> <pre><code>'&gt;%dI' % (len(b) / 4) </code></pre> <p>The <code>%</code> and <code>%d</code> are going to put a number into the format string, so if the length of b is 32 the format string becomes</p> <pre><code>`&gt;8I` </code></pre> <p>The first part of the format string is <code>&gt;</code>, which the <a href="http://docs.python.org/2/library/struct.html#byte-order-size-and-alignment" rel="nofollow">documentation</a> says is setting the byte order to big-endian and size to standard.</p> <p>The <code>I</code> says it will be an unsigned int with size 4 (<a href="http://docs.python.org/2/library/struct.html#format-characters" rel="nofollow">docs</a>), and the 8 in front of it means it will be repeated 8 times.</p> <pre><code>&gt;IIIIIIII </code></pre> <hr> <p>So I think this is saying: take this byte buffer, make sure it's a multiple of 4 by appending as many <code>0x00</code>s as is necessary, then unpack that into a tuple with as many unsigned integers as there are blocks of 4 bytes in the buffer. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload