import re
data = open('/opt/rustbolit/rustbolit','rb').read()
print("binary size", len(data))
for needle in [b'struct JobJson with 2 elements', b'struct Envelope with 2 elements',
               b'struct RawConfig with 1 element', b'struct RawTable']:
    idx = data.find(needle)
    print("==", needle.decode(), "at", hex(idx) if idx>=0 else "NOT FOUND")
# Dump context around JobJson msg
idx = data.find(b'struct JobJson with 2 elements')
start = max(0, idx-400)
chunk = data[start:idx+40]
print("--- strings near JobJson msg (rodata) ---")
for m in re.finditer(rb'[\x20-\x7e]{2,}', chunk):
    print(hex(start+m.start()), repr(m.group().decode()))
