Go / Rust Binary Reverse Engineering
Overview
Go and Rust binaries break generic reverse-engineering assumptions. They are
statically linked, carry their own runtimes, and when stripped they leave
massive symbol tables behind (Go's pclntab, Rust's panic strings) that
generic disassemblers ignore. The language-specific shortcut is: recognize
the runtime, recover the metadata, then read the business logic — never wade
through runtime library code.
This skill covers runtime recognition, pclntab/function-name recovery with
GoReSym/redress, and idiomatic decompilation recovery for both languages,
plus a dynamic-analysis note for Go's unusual stack/scheduler behavior. It
complements (does not replace) the generic Ghidra/IDA workflow in
analyzing-go-golang-with-ghidra and similar skills.
Source: cherry-picked and translated from zhaoxuya520/reverse-skill
(skills/go-rust-reverse, MIT license); reference notes
(go-rust-notes.md) inlined.
When to Use
Trigger phrases:
- "reverse this stripped Go binary"
- "recover function names from pclntab"
- "analyze Rust malware"
- "GoReSym on this ELF"
- "language-specific RE of a Go/Rust sample"
- "find the main entry of a Go binary"
Use this skill when:
- The sample is a Go or Rust compiled artifact (confirmed via
file, string
inspection, or runtime fingerprints).
- Symbols are stripped and you need function names or the
main entry back.
- You want to skip runtime-library noise and go straight to business logic.
Prerequisites
file, strings/rabin2 for triage.
- GoReSym (and/or redress, or a Go-aware IDA plugin) for Go metadata.
- Ghidra or IDA with Go/Rust plugins for decompilation; radare2 for quick
string work.
Artifact-Evidence Routing
For a shipped local executable, use reverse-engineer-anything-with-rea as the
artifact-evidence front door when the answer depends on embedded metadata, decompiled
code, or observed behavior. Preserve the SHA-256 and evidence references, then return to
the phases below for Go/Rust-specific interpretation. A missing pclntab or unsupported
format is an unresolved limitation, not proof that the binary is not Go/Rust.
Workflow
Phase 1: Triage — Identify the Runtime
- Confirm the language before anything else:
go.buildid section,
runtime. symbol residue, main.main references, or Rust panic
strings / rust_begin_unwind.
- Record the language-runtime evidence explicitly — it drives every later
step.
Phase 2: Go — Recover Metadata
- Go: locate
go.buildid, residual runtime symbols, and the pclntab
(program counter line table).
- Run GoReSym / redress / an IDA Go plugin to restore function names from
pclntab.
- Anchor on
runtime.main and main.main first, then work outward.
- Decompilation notes: recognize how
interface, slice, and string
values render in the decompiler; follow crypto/* and net/http import
paths to locate network or encryption logic.
Phase 3: Rust — String-Drive the Analysis
- Rust: collect
src/ path strings, crate-path hints, and panic strings
first — they are the best roadmap in a stripped Rust binary.
- Watch for generics instantiation bloat; locate string xrefs to jump from
user-visible text to the code that renders it.
- Async/tokio state machines need cross-referencing of the state enum and
poll loop — do not try to read them linearly.
- Look for
Option/Result handling blocks as behavioral landmarks.
Phase 4: Dynamic (Optional)
- Frida still works; account for Go's goroutine stacks and scheduler — break
on log/config strings first rather than arbitrary addresses.
- Log- and configuration-string-driven breakpoints give the fastest
orientation in both languages.
Phase 5: Business Logic
- With names (Go) or string anchors (Rust) recovered, read the business
logic: C2, persistence, exfiltration, or protocol handling.
- Record which function names are recovered vs inferred (equivalent mapping
is an acceptable fallback when pclntab recovery is partial).
Hands-On Example
Triage a stripped Go binary and confirm its runtime before metadata recovery
(Phase 1 — Triage). Ensure the toolchain exists with apt install golang-go
(Debian/Kali; go 1.24 verified here), then list symbols directly:
go tool nm ./sample | grep -E ' main\.main| runtime\.main'
# a35100 T main.main
# a361c0 T main.main.CountFlags.CountFlags.func1
go tool nm (output above verified against a real Go binary) gives an
instant stripped-vs-not read: a symbol-rich result means the binary was NOT
stripped and Go-aware tooling can recover full metadata without pclntab
parsing. Pair it with file ./sample for the runtime fingerprint.
Verification
Run this self-check before claiming completion:
When NOT to Use
- C/C++ binaries with normal symbols — generic RE is faster.
- Go binaries already handled by a dedicated Go workflow — use this skill as
the additive pclntab/GoReSym layer, not a duplicate.
- Malware-family Go/Rust samples with a single-toolchain playbook — start
from
reverse-engineering-rust-malware (Rust malware, IDA/Ghidra +
sandbox/IOCs) or analyzing-golang-malware-with-ghidra (Go + Ghidra
scripts); this skill is the toolchain-agnostic, non-malware path.
- Fully dynamic-only tasks where no static recovery adds value.
Anti-Rationalization Table
| Rationalization |
Reality |
| "I'll just open it in Ghidra." |
A stripped Go/Rust binary without pclntab recovery is a wall of runtime noise; you will burn hours in runtime.*. Recover metadata first. |
| "The Go toolchain names are useless anyway." |
main.main, crypto/*, net/http and the pclntab function table are exactly the roadmap you need. |
| "I'll read the whole binary." |
String-driven (Rust) and anchor-driven (Go) analysis covers the business logic with a fraction of the surface. |
| "Panic strings are just noise." |
In stripped Rust binaries, panic strings and src/ paths are frequently the only surviving source map. |
| "Dynamic analysis is the same as C." |
Go's goroutine stacks and scheduler break naive Frida assumptions; break on strings, not addresses. |
1---2name: go-rust-reverse3description: 'Use when reverse engineer Go and Rust binaries: recognize the language4 runtime from go.buildid, runtime symbols, or panic strings, recover function tables5 and names from pclntab, and rebuild symbols with GoReSym or redress before Ghidra/IDA6 analysis. Use when analyzing stripped Go/Rust malware, ELF/PE binaries with non-standard7 symbol layouts, or runtime-library-heavy samples.'8domain: cybersecurity9subdomain: malware-analysis10tags:11- go12- rust13- reverse-engineering14- malware-analysis15- pclntab16- ghidra17- ida18- symbol-recovery19version: '1.0'20author: oyi7721license: Apache-2.022nist_csf:23- DE.AE-0224- RS.AN-0325- ID.RA-0126category: cybersecurity27metadata:28 source: https://skillmd.com/skills/oyi77/go-rust-reverse29---303132# Go / Rust Binary Reverse Engineering3334## Overview3536Go and Rust binaries break generic reverse-engineering assumptions. They are37statically linked, carry their own runtimes, and when stripped they leave38massive symbol tables behind (Go's pclntab, Rust's panic strings) that39generic disassemblers ignore. The language-specific shortcut is: recognize40the runtime, recover the metadata, then read the business logic — never wade41through runtime library code.4243This skill covers runtime recognition, pclntab/function-name recovery with44GoReSym/redress, and idiomatic decompilation recovery for both languages,45plus a dynamic-analysis note for Go's unusual stack/scheduler behavior. It46complements (does not replace) the generic Ghidra/IDA workflow in47`analyzing-go-golang-with-ghidra` and similar skills.4849Source: cherry-picked and translated from `zhaoxuya520/reverse-skill`50(`skills/go-rust-reverse`, MIT license); reference notes51(`go-rust-notes.md`) inlined.5253## When to Use5455**Trigger phrases:**56- "reverse this stripped Go binary"57- "recover function names from pclntab"58- "analyze Rust malware"59- "GoReSym on this ELF"60- "language-specific RE of a Go/Rust sample"61- "find the main entry of a Go binary"6263Use this skill when:6465- The sample is a Go or Rust compiled artifact (confirmed via `file`, string66 inspection, or runtime fingerprints).67- Symbols are stripped and you need function names or the `main` entry back.68- You want to skip runtime-library noise and go straight to business logic.6970## Prerequisites7172- `file`, `strings`/`rabin2` for triage.73- GoReSym (and/or redress, or a Go-aware IDA plugin) for Go metadata.74- Ghidra or IDA with Go/Rust plugins for decompilation; radare2 for quick75 string work.76## Artifact-Evidence Routing7778For a shipped local executable, use `reverse-engineer-anything-with-rea` as the79artifact-evidence front door when the answer depends on embedded metadata, decompiled80code, or observed behavior. Preserve the SHA-256 and evidence references, then return to81the phases below for Go/Rust-specific interpretation. A missing pclntab or unsupported82format is an unresolved limitation, not proof that the binary is not Go/Rust.83## Workflow8485### Phase 1: Triage — Identify the Runtime8687- Confirm the language before anything else: `go.buildid` section,88 `runtime.` symbol residue, `main.main` references, or Rust `panic`89 strings / `rust_begin_unwind`.90- Record the language-runtime evidence explicitly — it drives every later91 step.9293### Phase 2: Go — Recover Metadata9495- Go: locate `go.buildid`, residual `runtime` symbols, and the pclntab96 (program counter line table).97- Run GoReSym / redress / an IDA Go plugin to restore function names from98 pclntab.99- Anchor on `runtime.main` and `main.main` first, then work outward.100- Decompilation notes: recognize how `interface`, `slice`, and `string`101 values render in the decompiler; follow `crypto/*` and `net/http` import102 paths to locate network or encryption logic.103104### Phase 3: Rust — String-Drive the Analysis105106- Rust: collect `src/` path strings, crate-path hints, and panic strings107 first — they are the best roadmap in a stripped Rust binary.108- Watch for generics instantiation bloat; locate string xrefs to jump from109 user-visible text to the code that renders it.110- Async/tokio state machines need cross-referencing of the state enum and111 poll loop — do not try to read them linearly.112- Look for `Option`/`Result` handling blocks as behavioral landmarks.113114### Phase 4: Dynamic (Optional)115116- Frida still works; account for Go's goroutine stacks and scheduler — break117 on log/config strings first rather than arbitrary addresses.118- Log- and configuration-string-driven breakpoints give the fastest119 orientation in both languages.120121### Phase 5: Business Logic122123- With names (Go) or string anchors (Rust) recovered, read the business124 logic: C2, persistence, exfiltration, or protocol handling.125- Record which function names are recovered vs inferred (equivalent mapping126 is an acceptable fallback when pclntab recovery is partial).127128## Hands-On Example129130Triage a stripped Go binary and confirm its runtime before metadata recovery131(Phase 1 — Triage). Ensure the toolchain exists with `apt install golang-go`132(Debian/Kali; go 1.24 verified here), then list symbols directly:133134```bash135go tool nm ./sample | grep -E ' main\.main| runtime\.main'136# a35100 T main.main137# a361c0 T main.main.CountFlags.CountFlags.func1138```139140`go tool nm` (output above verified against a real Go binary) gives an141instant stripped-vs-not read: a symbol-rich result means the binary was NOT142stripped and Go-aware tooling can recover full metadata without pclntab143parsing. Pair it with `file ./sample` for the runtime fingerprint.144145## Verification146147Run this self-check before claiming completion:148149- [ ] Language runtime evidence is documented (go.buildid / runtime symbols /150 panic strings / crate paths).151- [ ] `runtime.main`/`main.main` (Go) or the primary string anchors (Rust)152 are located.153- [ ] Function names are recovered via GoReSym/redress, or an equivalent154 mapping is explicitly labeled as inferred.155- [ ] Network/encryption paths (`crypto/*`, `net/http`, TLS usage) are156 identified.157- [ ] The recovered business logic (C2, persistence, exfil, protocol) is158 cross-referenced to the decompiled evidence.159160## When NOT to Use161162- C/C++ binaries with normal symbols — generic RE is faster.163- Go binaries already handled by a dedicated Go workflow — use this skill as164 the additive pclntab/GoReSym layer, not a duplicate.165- Malware-family Go/Rust samples with a single-toolchain playbook — start166 from `reverse-engineering-rust-malware` (Rust malware, IDA/Ghidra +167 sandbox/IOCs) or `analyzing-golang-malware-with-ghidra` (Go + Ghidra168 scripts); this skill is the toolchain-agnostic, non-malware path.169- Fully dynamic-only tasks where no static recovery adds value.170171## Anti-Rationalization Table172173| Rationalization | Reality |174|---|---|175| "I'll just open it in Ghidra." | A stripped Go/Rust binary without pclntab recovery is a wall of runtime noise; you will burn hours in `runtime.*`. Recover metadata first. |176| "The Go toolchain names are useless anyway." | `main.main`, `crypto/*`, `net/http` and the pclntab function table are exactly the roadmap you need. |177| "I'll read the whole binary." | String-driven (Rust) and anchor-driven (Go) analysis covers the business logic with a fraction of the surface. |178| "Panic strings are just noise." | In stripped Rust binaries, panic strings and `src/` paths are frequently the only surviving source map. |179| "Dynamic analysis is the same as C." | Go's goroutine stacks and scheduler break naive Frida assumptions; break on strings, not addresses. |