mirror of
https://github.com/siemens-mobile-hacks/ghidra-patched.git
synced 2026-11-25 23:57:23 +00:00
Fixed version of Ghidra SRE for better reverse-engineering Siemens phones
| .github/workflows | ||
| patches | ||
| .gitattributes | ||
| .gitignore | ||
| build.sh | ||
| README.md | ||
| release.sh | ||
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-largeproperty:- Converts typed
PAGE:OFFSETjoins into far pointers. - Preserves physical addresses through p-code folding.
- Keeps native-width physical-address constants distinct from four-byte
TASKING
PAGE:OFFSETencodings 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
Datavalues: pointers to a Function Definition retain their raw 24-bitSEGMENT:OFFSETvalue, while ordinary pointers use the C166PAGE:OFFSETcalculation. - 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
EXTPaccesses 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:R4halves into a far-data pointer. - Rejoins branch-selected split
PAGE:OFFSETreturns 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-largeprofile; all other architectures retain the upstream limit.
- Converts typed
- 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
BLbug: disables standalone Thumb-1BL/BLXhalfwords 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
doubleor 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.