Don't use pack Q, it's not endian safe.  ```Rex::Text.pack_int64le(packet_size+40)```