Guide 025 min readFrameAssembly v3.1.2
llms-full.txt

Reverse .pcap -> Scrub Secrets -> Rebuild .pcap

Decompile binary captures into plain .frasm text, wipe customer IPs and internal hostnames with find-and-replace, and recompile with fresh checksums.

TL;DR — What Matters Here
  • frameassembly reverse decompiles binary .pcap and .pcapng traces into editable .frasm text across all 81 protocols.
  • Swap an IP once inside host1, and every packet in that flow updates its IP header and L4 pseudo-header checksum.
  • Unlike hex editors or tcprewrite, changing Layer 7 text (qname, sni, hosthdr) recalculates outer lengths and TCP seq numbers automatically.

1. Why Hex Editors & tcprewrite Betray You

Vendor TAC wants a packet capture of your broken auth flow — except your raw .pcap is stuffed with internal 10.x subnets, MAC OUIs, SNMP community strings, and "payroll.corp.internal" inside DNS and TLS SNI.

tcprewrite can swap outer Layer 3 IPs, right up until you notice your internal hostnames are still sitting in plaintext inside Layer 7 payloads. Hex-edit those strings and you immediately wreck IP total lengths, TCP sequence offsets, and transport checksums. Going .pcap -> .frasm -> .pcap fixes the whole stack at once.

2. The 3-Step Loop: reverse -> Edit Text -> Rebuild

Point frameassembly reverse at any .pcap or .pcapng (or drop the file onto the browser Playground — zero bytes ever leave your tab). FrameAssembly dissects every frame, groups endpoints into host1, host2, ..., preserves inter-packet wait gaps, and writes clean .frasm text.

Run find-and-replace in your favorite editor, then recompile a fresh, checksum-clean .pcap.

sanitized_case.frasm13 lines
Open in Playground
// Reversed capture after scrubbing production IPs and internal hostnames
host host1 { ip 10.254.1.10 mac 02:00:00:00:00:01 }
host host2 { ip 10.254.1.53 mac 02:00:00:00:00:02 }
host host3 { ip 10.254.2.80 mac 02:00:00:00:00:03 }
compile {
host1 -> host2 dns query txid 0x8821 qname "app.sanitized-example.test" qtype "A" vlan 100 wait 2ms
host1 <- host2 dns response txid 0x8821 qname "app.sanitized-example.test" qtype "A" rdata "10.254.2.80" ansttl 300 vlan 100 wait 4ms
host1 -> host3 tcp syn srcport 54320 dstport 443 win 65535 mss 1460 vlan 100 wait 1ms
host1 <- host3 tcp syn ack win 65535 mss 1460 vlan 100 wait 1ms
host1 -> host3 tcp ack vlan 100 wait 1ms
host1 -> host3 tls clienthello sni "app.sanitized-example.test" alpn "h2" vlan 100
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Decompile customer_incident.pcap -> sanitized_case.frasm
frameassembly reverse customer_incident.pcap sanitized_case.frasm

# 2. Scrub IPs, VLANs, or hostnames in any editor, then preview the packet table
frameassembly show sanitized_case.frasm

# 3. Recompile -> clean .pcap with recalculated lengths and checksums
frameassembly sanitized_case.frasm sanitized_case.pcap

3. Edits That Used to Take 80 Lines of Python

Once a binary trace is .frasm text, surgery is just text editing:

What You WantWhat You Edit in .frasmWhat the Compiler Fixes for You
Scrub customer subnetsSwap ip and mac inside host1, host2, ...Ethernet MACs, IPv4/IPv6 headers, and TCP/UDP/ICMPv6 pseudo-header checksums
Insert or strip VLAN / QinQ tagsAdd, tweak, or delete vlan 200 or qinq 500 innervlan 20Outer EtherTypes (0x8100 / 0x88a8) and wire frame byte lengths
Wipe hostnames or secretsEdit qname, sni, hosthdr, uri, community, or userL7 TLV/header lengths, IP total length, and downstream TCP seq / acknum
Stretch or compress timingChange wait 500us to wait 50msCumulative .pcap / .pcapng timestamps on every subsequent frame
Preserve unknown payloadsLeave or edit hexpayload "..."Keeps custom or proprietary wire bytes byte-for-byte intact
IPsec ESP Decompilation Note (esp <-> ipsec)

When reversing IP protocol 50 traffic, reverse emits canonical esp preserving spi, seq, and encrypted payload bytes cleanly.