Wiki / Port and reverse

Clean-room and deep mode#

The mode decides how closely PortCode may examine the original.

Clean-room (default)Deep
Observe from outside: run it, feed inputs, compare outputsyesyes
Read its documentation and public filesyesyes
Disassemble, decompile, emulate, hexdumpnoyes
Inspect Unity, .NET and IL2CPP internalsnoyes
Chip in the app▣ clean-room◉ deep

Switching#

portcode --deep          # start in deep mode
portcode --clean-room    # explicitly clean-room (the default)

In the app: /deep and /clean. You can also set "mode": "deep" in portcode.json.

What is enforced#

The deep tools (disasm, emulate, decompile, functions, hexdump, unity, dotnet, unity_assets) refuse to run in clean-room mode and say how to switch. bash also refuses commands that look inside programs (disassemblers, decompilers, debuggers, and the like) in clean-room mode.

The deep tools#

ToolFor
disasmdisassembly with Capstone (x86, ARM, ARM64, MIPS, RISC-V, PPC…)
emulaterun a function or decoder in isolation with Unicorn
decompilePseudo-C from Ghidra, run headless (needs a JDK)
functionslist the functions of a binary
hexdumpbytes at an address
unitya Unity project, Mono or IL2CPP
dotnettypes, methods, strings and decompilation of C# and .NET (ILSpy)
unity_assetsscenes, TextAssets and MonoBehaviour data

Engines install on request, after you approve, into an engines/ folder next to the binary, and every download has a published sha256 that is checked. See Engines.

The workbench#

/workbench (deep mode) shows functions, Pseudo-C, disassembly, hex and the evidence log side by side. j and k move, 1 2 3 switch the view, / filters, and a asks the agent about the selected function.

The strict two-session method#

  1. portcode --deep -a reverse: study the original and write docs/SPEC.md in your own words.
  2. portcode --clean-room -a port: build the port from that spec only.

The second session never sees the original's internals, which is what "clean room" means.

Edit this page on GitHub