Fixed version of Ghidra SRE for better reverse-engineering Siemens phones
Find a file
2026-08-30 17:23:22 +03:00
.github/workflows Include Windows launchers in release archives 2026-08-30 17:23:22 +03:00
patches Fix patch application on Windows 2026-08-28 13:47:48 +03:00
.gitattributes Fix patch application on Windows 2026-08-28 13:47:48 +03:00
.gitignore First commit 2026-08-09 10:25:26 +03:00
build.sh Include Windows launchers in release archives 2026-08-30 17:23:22 +03:00
README.md Fix C166 TASKING far-pointer recovery 2026-08-28 12:27:49 +03:00
release.sh Add release tagging script 2026-08-09 10:29:18 +03:00

Ghidra Patched

A Ghidra fork with fixes for reverse engineering Siemens phones.

Differences from stock Ghidra

  • TASKING Classic Large segmented far pointers for processor specifications declaring the exact c166.abi=tasking-classic-large property:
    • Converts typed PAGE:OFFSET joins into far pointers.
    • Preserves physical addresses through p-code folding.
    • Keeps native-width physical-address constants distinct from four-byte TASKING PAGE:OFFSET encodings during pointer and symbol recovery.
    • Resolves strings and symbols and makes decompiler tokens navigate to physical addresses.
    • Hides representation-only pointer casts and width conversions.
    • Distinguishes TASKING Classic C166 function pointers from data pointers in both decompiler flow and stored Data values: pointers to a Function Definition retain their raw 24-bit SEGMENT:OFFSET value, while ordinary pointers use the C166 PAGE:OFFSET calculation.
    • Keeps other processor and compiler models on the stock segmented-pointer behavior, including x86-16 and Z80 specifications with farpointer="yes".
    • Hides representation-only masks and casts when a TASKING far pointer is formed from an R0-relative user-stack address.
    • Reconstructs page-local EXTP accesses from proven far-data pointer halves as ordinary constant or scalar-indexed pointer arithmetic, including nested fields, adjacent post-increment loads, lock-step control flow, and reverse PAGE/OFFSET stack spills, while preserving declared nested-pointer pointee types across split word loads.
    • Rejects function-pointer and scalar call results before folding physical R5:R4 halves into a far-data pointer.
    • Rejoins branch-selected split PAGE:OFFSET returns when every leaf is a zero constant or adjacent word-load pair, preserving the inferred pointer type without folding arbitrary scalar phi pairs.
    • Preserves ordered duplicate destinations in manually supplied switch-table overrides and retries index recovery when the complete table-load path becomes available, preventing code addresses from becoming case labels.
    • Raises the type-recovery pass budget from 7 to 20 only for the exact c166.abi=tasking-classic-large profile; all other architectures retain the upstream limit.
  • Extends Auto Structure for TASKING Classic Large far-data pointers, including split PAGE:OFFSET globals and indexed array elements, and retypes the actual four-byte global pointer instead of a selected 16-bit index variable.
  • ARM5T false BL bug: disables standalone Thumb-1 BL/BLX halfwords on ARM5T so erased flash (FF FF) is not analyzed as calls. Complete 32-bit calls and ARM4T behavior are preserved.
  • Preserves automatic hidden-return metadata for multipart pointers in the C166 TASKING Classic large model.
  • Preserves TASKING C166 Classic Large indirect R4 returns as logical double or aggregate values without adding a hidden return parameter; the protocol producers and native decompiler consumers are gated by the exact processor-spec ABI property.

Build

Requires JDK 21, Python 3, and a native C/C++ toolchain.

./build.sh

Sources are cached in build/; the host-platform ZIP is written to dist/.

Prebuilt archives: Releases.