NAME=help
FILE=-
CMDS=<<EOF
!!../bin/r2flutter -h
?e ===
!!sh -c "p=../src/r2/core_flutter.dylib; [ -f \"\$p\" ] || p=../src/r2/core_flutter.so; r2 -NN -q -i \"\$p\" -qc \"r2flutter -h\" -"
?e ===
!!../bin/r2flutter | sed -n '1p'
?e ===
!!sh -c "p=../src/r2/core_flutter.dylib; [ -f \"\$p\" ] || p=../src/r2/core_flutter.so; r2 -NN -q -i \"\$p\" -qc r2flutter -"
EOF
EXPECT=<<EOF
Usage: ../bin/r2flutter [options] <libapp_path_or_dir>
Modifiers:
  -h                    Show help
  -j                    Output in JSON format
  -q                    Compact output; suppress non-essential detail
  -r                    Output r2 commands for the selected action
  -n                    Heuristic fallback for unknown functions; may assign wrong names
  -v                    Verbose (stderr debug info)
  -vv                   More verbose (dump headers)
  -V                    Show version
Actions:
  -A                    Analyze Dart snapshot and apply flags/comments
  -AA                   Analyze with field extraction enabled
  -AAA                  Run Dart-aware code analysis and recover code refs
  -c                    Print extracted class information
  -f                    Print all extracted functions (addr name)
  -H                    Print Dart AOT snapshot header info
  -HH                   Print extended snapshot header and cluster layout
  -HHH                  Decode selected cluster payloads for diagnostics
  -i                    Print instruction table entries to stdout
  -O <addr|pp+off>      Decode Dart tagged/object pointer or ObjectPool PP slot
  -p                    Print reconstructed ObjectPool PP value
  -R                    Print radare2 script for snapshot analysis
  -S                    Print best-effort recovered SBOM/components
  -T                    Print string-based type names
  -x                    Print metadata/data-image xrefs; with -z, include string refs/ax in -r
  -z                    Print reliable ObjectPool-referenced strings (-q prints values only)
  -zz                   Print all fuzzy/carved extracted strings (-xzz includes refs/ax in -r)
Options:
  -l <N>                Limit output to N items
  -m <file>             Load Flutter obfuscation map JSON
===
Usage: r2flutter [-jqrnv] [-l N] [-m file] <action>
| r2flutter          show same -h help message
| r2flutter -j <act> output JSON for dump actions
| r2flutter -q <act> compact output; quiet analysis logs
| r2flutter -r <act> output r2 commands for dump actions
| r2flutter -n       use heuristic name-pool fallback; names may be wrong
| r2flutter -v       increase parser verbosity
| r2flutter -l N     limit function/instruction-table/xref output
| r2flutter -m file  load Flutter obfuscation map JSON
| r2flutter -A       analyze dart snapshot and apply flags/comments
| r2flutter -AA      analyze with field extraction enabled
| r2flutter -AAA     run Dart-aware code analysis and recover code refs
| r2flutter -c       dump classes
| r2flutter -C       apply Dart classes, fields, methods and types
| r2flutter -f       dump recovered functions
| r2flutter -H       dump Dart AOT snapshot header info
| r2flutter -HH      dump Dart AOT snapshot header and cluster layout
| r2flutter -HHH     decode selected cluster payloads for diagnostics
| r2flutter -h       show this help
| r2flutter -i       dump instruction table entries
| r2flutter -O addr  decode Dart tagged/object pointer or ObjectPool PP slot
| r2flutter -p       print reconstructed ObjectPool PP value
| r2flutter -R       dump full radare2 script (like standalone -R)
| r2flutter -S       dump best-effort recovered SBOM/components
| r2flutter -T       dump string-based type names
| r2flutter -V       show version
| r2flutter -x       dump metadata/data-image xrefs; with -z, include string refs/ax in -r
| r2flutter -z       dump reliable ObjectPool-referenced strings (-q prints values only)
| r2flutter -zz      dump all fuzzy/carved strings (-xzz includes refs/ax in -r)
===
Usage: ../bin/r2flutter [options] <libapp_path_or_dir>
===
Usage: r2flutter [-jqrnv] [-l N] [-m file] <action>
| r2flutter          show same -h help message
| r2flutter -j <act> output JSON for dump actions
| r2flutter -q <act> compact output; quiet analysis logs
| r2flutter -r <act> output r2 commands for dump actions
| r2flutter -n       use heuristic name-pool fallback; names may be wrong
| r2flutter -v       increase parser verbosity
| r2flutter -l N     limit function/instruction-table/xref output
| r2flutter -m file  load Flutter obfuscation map JSON
| r2flutter -A       analyze dart snapshot and apply flags/comments
| r2flutter -AA      analyze with field extraction enabled
| r2flutter -AAA     run Dart-aware code analysis and recover code refs
| r2flutter -c       dump classes
| r2flutter -C       apply Dart classes, fields, methods and types
| r2flutter -f       dump recovered functions
| r2flutter -H       dump Dart AOT snapshot header info
| r2flutter -HH      dump Dart AOT snapshot header and cluster layout
| r2flutter -HHH     decode selected cluster payloads for diagnostics
| r2flutter -h       show this help
| r2flutter -i       dump instruction table entries
| r2flutter -O addr  decode Dart tagged/object pointer or ObjectPool PP slot
| r2flutter -p       print reconstructed ObjectPool PP value
| r2flutter -R       dump full radare2 script (like standalone -R)
| r2flutter -S       dump best-effort recovered SBOM/components
| r2flutter -T       dump string-based type names
| r2flutter -V       show version
| r2flutter -x       dump metadata/data-image xrefs; with -z, include string refs/ax in -r
| r2flutter -z       dump reliable ObjectPool-referenced strings (-q prints values only)
| r2flutter -zz      dump all fuzzy/carved strings (-xzz includes refs/ax in -r)
EOF
RUN
