Rating: 5.0

We've used this regular expression for searching in decrypted (base64) data:
`re.search('[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9]', txt)`

Full python code for traversing otr files:

```
import os, hashlib, zlib, base64, re

def crc32(txt):
return zlib.crc32(txt)% 2**32

def readInt4(num):
return ord(num[0]) + (ord(num[1]) << 8) + (ord(num[2]) << 16) + (ord(num[3]) << 24)

def readFlag(data, offset, length):
flag = []
for i in range(length/8):
f = ord(data[offset+i])
for j in range(8):
if (f & (1 << 8 - j - 1)) != 0:
flag.append(True)
else:
flag.append(False)
return flag

def applyFlag(txt, flag):
out = ''
for i in range(len(flag)):
if flag[i]:
out += txt[i].upper()
else:
out += txt[i]
return out

def readSection(fname, data, offset, descOffset):
isDesc = descOffset == offset
name = data[offset:offset+8]
offset += 8
length = readInt4(data[offset:offset+4])
offset += 4
crcFlag = readInt4(data[offset:offset+4])
offset += 4
crcData = readInt4(data[offset:offset+4])
offset += 4

flagTxt = data[offset:offset+length/8]
dataFull = data[offset:offset+length/8+length]

flag = readFlag(data, offset, length)
offset += length / 8

txt = data[offset:offset+length]

crc = 1 + (crc32(dataFull) ^ 0xFFFFFFFF)

if not isDesc:
txt = applyFlag(txt, flag)
txt = base64.b64decode(txt)
if re.search('[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9]', txt) != None:
print txt

return offset + length

def readotr(fname):
data = open(fname, 'rb').read()
magic = data[:6]
if magic != '\x30\x74\x74\x33\x72\x1a':
raise Exception('otr')
sections = readInt4(data[6:10])
descOffset = readInt4(data[10:14])
creation = readInt4(data[14:18])
#readSection(fname, data, offset) # description

offset = 18
for i in range(sections):
offset = readSection(fname, data, offset, descOffset)

def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()

for f in sorted(os.listdir('otr/')):
fname = 'otr/'+f
readotr(fname)
```

Output:
`41.74664519820109, -74.08989937955397 - I'm pretty hungry...`

Google it - there is the Gilded Otter restaurant

The flag is:

`CTF{GILDED OTTER}`