@googuns_lulz was inspired by other @googuns_ Twitter bots.

Some parts of its messages are random, but some are defined.

Message Parser

Copy and paste a tweet:

v2.0 Format

128 bytes (91.4% of all 140 bytes) contain information (are not red/green in the table). v2.0 was released near the end of 2017.

Offset Length Description Entered
0x00 0 0x8 8 64-bit UNIX timestamp ^ data[61:69]
0x08 8 0x1 1 version (0x20)
0x09 9 0x37 55 undefined
0x40 64 0x08 8 checksum
0x48 72 0x41 65 undefined
0x89 137 0x3 3 zero (0x000000)
Derived Value
UNIX timestamp
checksum

The checksum is such that the XOR of the 64-bit words (18 in total) of data + data[136:] is zero.

checksum = data[:8] ^ data[8:16] ^ data[8:16] ^ data[16:24] ^ data[24:32] ^ data[32:40] ^ data[40:48] ^ data[48:56] ^ data[56:64] ^ 0 ^ data[72:80] ^ data[80:88] ^ data[88:96] ^ data[96:104] ^ data[104:112] ^ data[112:120] ^ data[120:128] ^ data[128:136] ^ ((data[136:] << 32) ^ data[136:])

v1.1 Format

64 bytes (91.4% of all 70 bytes) contain information (are not red/green in the table). v1.1 was released in Mar 2017.

All valid messages in v1.1 or v1 Format are guaranteed to be invalid in the other. Compared to v1, v1.1 has less redundancy.

Offset Length Description Entered
0x00 0 0x8 8 64-bit UNIX timestamp ^ data[9:17] ^ data[32:40]
0x08 8 0x1 1 ~hash1[0]
0x09 9 0x1 1 hash0[1]
0x0A 10 0x34 52 undefined
0x3E 62 0x1 1 version (0x01)
0x3F 63 0x4 4 undefined
0x43 67 0x3 3 zero (0x000000)
Derived Value
UNIX timestamp
hash0 = sha256(data[10:])
hash1 = sha1(data[:8])

v1 Format

24 bytes (34.3% of all 70 bytes) contain information. v1 was released in Oct 2016.

Offset Length Description Entered
0x00 0 0x8 8 transformed 64-bit timestamp*
0x08 8 0xC 10 hash1[:10]
0x12 18 0xC 10 hash1[:10] xor (A+B+C)**
0x1C 28 0x2 2 undefined
0x1E 30 0x20 32 hash2
0x3E 62 0x1 1 version (0x01)
0x3F 63 0x4 4 undefined
0x43 67 0x3 3 zero (0x000000)
Derived Value
hash1 = sha1(data[:8])
hash2 = sha256(data[:30] + data[62:])
A + B + C
UNIX timestamp
* transformed 64-bit timestamp = (([UNIX timestamp] <<< A) ^ B ^ 0x420B16B00B5F1337) >>> C
 A: 1 random byte
 B: 8 random bytes
 C: 1 random byte

 constant explanation:
  42 - reference to The Hitchhiker's Guide to the Galaxy by Douglas Adams
  0 - first separator
  0xB16B00B5 - reference to Microsoft and Linux
  F - last separator
  1337 - exercise for the reader
** originally supposed to be `hash1[10:] xor (A+B+C)`

Notation

All fields are big endian.
<<< = rol and >>> = ror (bitwise rotations).
^ = bitwise XOR (exclusive OR).
~ = bitwise negation.
+ = concatenation.
data[a:b] = slice from data[a] to data[b-1], with a=0 and b=data.length by default; empty slice if a=b.