rest of investigative reversing 3

This commit is contained in:
Maxime Vorwerk
2024-06-10 14:51:39 +02:00
parent 882f478c94
commit 1883e33073
18 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#!/home/maxime/.pyvenv/bin/python3
with open("encoded.bmp", 'rb') as f:
img = f.read()
buffer_zone = 732
flag_size = 50
enc_size = flag_size * 9
enc_buffer = img[buffer_zone:buffer_zone + enc_size]
flag_buffer = [''] * flag_size
for i in range(flag_size):
enc_offset = i * 9
char = 0
for j in range(8):
char |= (enc_buffer[enc_offset+j] & 1) << j
flag_buffer[i] = chr(char)
print(''.join(flag_buffer))