Compare commits

...

1888 commits

Author SHA1 Message Date
Ryan Kurtz
ccefcc1f70 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-29 12:01:19 -04:00
Ryan Kurtz
b0f3dea8d6 GP-0: More WhatsNew improvements 2025-09-29 11:53:54 -04:00
Ryan Kurtz
e4e2df4a09 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-29-25' 2025-09-29 10:43:51 -04:00
Ryan Kurtz
97dcd914e8 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-29 10:42:33 -04:00
Ryan Kurtz
90e9d803f8 GP-0: New code block format in html produced from markdown 2025-09-29 10:40:55 -04:00
dragonmacher
5c5f577560 Test fixes 2025-09-29 10:33:10 -04:00
Ryan Kurtz
16401d6231 GP-0: WhatsNew corrections 2025-09-29 09:49:24 -04:00
ghidra1
0234da5db5 GP-1 Correct NPE with symbol filter restore 2025-09-29 09:43:03 -04:00
Ryan Kurtz
a3b327c411 Merge remote-tracking branch 'origin/GP-1-dragonmacher-tool-restore-fix' 2025-09-29 05:15:02 -04:00
Ryan Kurtz
15760581ad Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-29 05:14:16 -04:00
Ryan Kurtz
d7bfd098b9 Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_extensions--SQUASHED' into Ghidra_12.0 2025-09-29 05:12:09 -04:00
Ryan Kurtz
605d579070 GP-0: Fixing enablement of installed extensions in dev mode 2025-09-29 05:11:39 -04:00
dragonmacher
6660cc75f1 Fix for recent tool xml restoring change 2025-09-26 20:03:31 -04:00
Ryan Kurtz
e8ba7c3e45 Merge remote-tracking branch 'origin/GP-5992-dragonmacher-options-age-off--SQUASHED' 2025-09-26 13:01:48 -04:00
Ryan Kurtz
96506554e7 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-26 12:57:42 -04:00
Ryan Kurtz
cde92ede12 Merge branch 'GP-6021_ryanmkurtz_pyghidra' into Ghidra_12.0
(Closes #8524)
2025-09-26 12:55:27 -04:00
Ryan Kurtz
951f5a5daa GP-6021: PyGhidra stdout/stderr scripting console fixes 2025-09-26 12:51:32 -04:00
dragonmacher
b4ba97c3d2 GP-5992 - Added the ability age-off options instead of relying only on registration 2025-09-26 11:33:51 -04:00
ghidra1
c16396d235 Merge branch 'Ghidra_12.0' 2025-09-26 11:04:51 -04:00
ghidra1
2b5ba24327 GP-6008 Corrected regression bug for VT function stringable Imported
priority check
2025-09-26 11:02:35 -04:00
ghidra1
5ea1b04604 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-25 13:54:11 -04:00
ghidra1
531d53f8f8 Merge remote-tracking branch 'origin/patch' into Ghidra_12.0 2025-09-25 13:53:31 -04:00
ghidra1
9a20684330 GP-5526 Simplified fix for CreateThunkFunctionCmd 2025-09-25 13:52:42 -04:00
ghidra1
5ceb49b11f Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-25 13:11:59 -04:00
ghidra1
fb66e26452 Merge remote-tracking branch 'origin/patch' into Ghidra_12.0 2025-09-25 13:10:48 -04:00
ghidra1
cae8caac14 GP-5526 Correct CreateThunkCmd NPE 2025-09-25 13:03:49 -04:00
Ryan Kurtz
1ded9bcb80 Merge remote-tracking branch 'origin/GP-6005_ryanmkurtz_vs' into
Ghidra_12.0 (#2305)
2025-09-25 09:58:05 -04:00
Ryan Kurtz
9ad9d0d3db Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-25 05:26:54 -04:00
Ryan Kurtz
0fb3a8f8a9 Merge remote-tracking branch 'origin/patch' into Ghidra_12.0 2025-09-25 05:25:30 -04:00
emteere
136a28d603 GP-5526 bug fix for .plt.sec and pattern matching optimization 2025-09-25 05:22:34 -04:00
Ryan Kurtz
bcd9130aee Merge remote-tracking branch 'origin/GP-5989_ForceUnionException' into
Ghidra_12.0 (Closes #7466)
2025-09-25 05:04:27 -04:00
caheckman
72344ce13e GP-5989 Fix ForceUnionAction "Could not recover p-code op" 2025-09-24 19:06:45 +00:00
Ryan Kurtz
a51cfb7c09 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-24 14:33:50 -04:00
Ryan Kurtz
8802befa22 Merge remote-tracking branch 'origin/GP-5526_emteere_bugfix--SQUASHED' into Ghidra_12.0 2025-09-24 14:20:56 -04:00
Ryan Kurtz
961ab7b76e Merge remote-tracking branch
'origin/GP-5998_emteere_VS2022_stack_check_cookie_Issue--SQUASHED' into
Ghidra_12.0 (Closes #2743)
2025-09-24 14:18:25 -04:00
Ryan Kurtz
d1c6a1cd06 Merge remote-tracking branch
'origin/GP-5287_emteere_ENDBR_patterns--SQUASHED' into Ghidra_12.0
(#8516)
2025-09-24 14:13:50 -04:00
emteere
dc069a18c6 GP-5287 Added ENDBR jump target checking instructions as function start patterns for x86 gcc binaries 2025-09-24 18:06:03 +00:00
emteere
69ed84a069 GP-5526 bug fix for .plt.sec and pattern matching optimization 2025-09-24 18:03:10 +00:00
emteere
0815f463f5 GP-5998 Added security_check_cookie function patterns and callfixup for VS2022 based binaries. 2025-09-24 18:01:43 +00:00
Ryan Kurtz
48a86b945a GP-0: Finding dev mode extensions in all application root dirs 2025-09-24 13:04:54 -04:00
Ryan Kurtz
f41f7c9eab Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-24 11:18:29 -04:00
Ryan Kurtz
14bdf2bbe5 Merge remote-tracking branch
'origin/GP-3139_James_add_apple_arm64_cspec' into Ghidra_12.0
(Closes #8032, Closes #2723)
2025-09-24 11:15:39 -04:00
ghidra1
4a1a373193 GP-0 SourceType javadoc update 2025-09-24 09:37:55 -04:00
ghidra1
5df99853af Merge remote-tracking branch 'origin/GP-6006_ghidra1_added_new_source_type' into Ghidra_12.0 2025-09-24 09:18:53 -04:00
ghidra1
ed4ad257f2 Merge remote-tracking branch 'origin/GP-6008_ghidra1_SourceTypePriorityUse--SQUASHED' into Ghidra_12.0 2025-09-24 09:18:36 -04:00
ghidra1
a3bd708160 GP-6008 Changed SourceType examination to base upon priorty instead of specific value equality when appropriate 2025-09-24 09:16:04 -04:00
Ryan Kurtz
350817be2d Merge remote-tracking branch 'origin/GP-5981_ryanmkurtz_jython' into Ghidra_12.0 2025-09-24 09:06:13 -04:00
Ryan Kurtz
03ee787325 GP-5981: Giving Jython scripts invoked via runScript() a fresh set of
locals
2025-09-24 08:54:11 -04:00
Ryan Kurtz
aacd763b25 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-24 05:57:55 -04:00
Ryan Kurtz
6c1a1b4600 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-23-25' into Ghidra_12.0 2025-09-24 05:55:44 -04:00
dragonmacher
9e9de7c4f5 Test fixes 2025-09-23 16:53:02 -04:00
ghidragon
e346c30205 GP-6006 Added a new source type called 'AI' 2025-09-23 15:18:03 -04:00
Ryan Kurtz
f59313131d Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-23 11:49:01 -04:00
Ryan Kurtz
cc4a4e5ed2 Merge remote-tracking branch 'origin/GP-6014_ryanmkurtz_osgi' into
Ghidra_12.0 (#6455)
2025-09-23 11:45:46 -04:00
Ryan Kurtz
52b4d46cb3 GP-0: Detecting VSCode in Windows system installer location
(Closes #8514)
2025-09-23 11:42:46 -04:00
Ryan Kurtz
b7a5878e35 GP-0: Explicitly enable native access to make new JDK 25 FlatLaf
warnings go away
2025-09-23 09:29:56 -04:00
Ryan Kurtz
cca597318e GP-6014: Setting minimum java version in OSGi bundles, and adding
"Bundle Location ID" hidden column
2025-09-23 09:01:21 -04:00
Ryan Kurtz
dfd1df25ed Merge remote-tracking branch 'origin/GP-0_ghizard_What's_New_Edits' into Ghidra_12.0 2025-09-22 12:08:18 -04:00
ghizard
eefa8881ec GP-0 - What's New Edits 2025-09-22 12:00:42 -04:00
Ryan Kurtz
b70fcc57ee Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-22 09:22:51 -04:00
Ryan Kurtz
1f0bd4a9e2 GP-0: Fixing Mach-O stub processing on blank symbols (Closes #8513) 2025-09-22 09:21:15 -04:00
Ryan Kurtz
0b102836d3 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-22 05:56:15 -04:00
Ryan Kurtz
78008fae1e Merge remote-tracking branch 'origin/GP-6010_ghizard_PDB_Fix_issue_where_function_args_record_is_NOTYPE' into Ghidra_12.0 2025-09-22 05:54:09 -04:00
Ryan Kurtz
29ba2ca46d GP-0: Upping Gradle Wrapper to 9.1.0 2025-09-22 05:49:16 -04:00
ghizard
799226dd3a GP-6010 - PDB - Fixed issue where function args list was NOTYPE 2025-09-19 13:42:10 -04:00
ghidra1
2e05cc5d2a Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-19 11:04:10 -04:00
ghidra1
edea7dfd65 Revert "GP-6006 Creating a new source type called 'Speculative' which marks symbol names that are less trustworthy than analysis"
This reverts commit 41d9b7431e.
2025-09-19 11:02:20 -04:00
Ryan Kurtz
b4a7848a30 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-18 14:13:00 -04:00
Ryan Kurtz
91a9a66a25 Merge remote-tracking branch 'origin/GP-6006_ghidragon_added_new_source_type--SQUASHED' into Ghidra_12.0 2025-09-18 14:10:48 -04:00
ghidragon
41d9b7431e GP-6006 Creating a new source type called 'Speculative' which marks symbol names that are less trustworthy than analysis 2025-09-18 14:10:16 -04:00
Ryan Kurtz
1ae4378cfd Merge remote-tracking branch 'origin/GP-5999_dev747368_fix_coff_NPE' 2025-09-18 13:10:53 -04:00
Ryan Kurtz
2d9d764f10 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-18 13:09:26 -04:00
Ryan Kurtz
6bb33b0025 GP-6005: The Windows build can now use prerelease versions of Visual
Studio with the new -PvswherePrerelease arg
2025-09-18 12:50:13 -04:00
Ryan Kurtz
05a72b569a GP-0: Updating WhatsNew 2025-09-18 08:11:21 -04:00
Ryan Kurtz
1b0ad6e28f Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-18 06:08:59 -04:00
Ryan Kurtz
363c1cd4fd Merge remote-tracking branch 'origin/GP-1_ghidragon_another_tiny_mistake_in_toggle_variables' into Ghidra_12.0 2025-09-18 06:04:52 -04:00
Ryan Kurtz
3d9610afce Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-18 06:00:17 -04:00
dev747368
81b8b160be GP-5999 fix NPE in Coff archive fs when opening almost empty file 2025-09-17 23:54:14 +00:00
ghidragon
48f2a03469 GP-1 fixed another mistake in the open/close variables action 2025-09-17 16:12:00 -04:00
ghidra1
cfab7b13df Merge remote-tracking branch 'origin/patch' into Ghidra_12.0 2025-09-17 14:57:10 -04:00
ghidra1
0b88d55bea Merge remote-tracking branch
'origin/GP-5995_ghidra1_DynamicPointerLabels' into patch (Closes #8510)
2025-09-17 14:55:39 -04:00
ghidra1
dba7f462a2 GP-5995 Corrected default label for circular pointer references 2025-09-17 14:52:14 -04:00
Ryan Kurtz
5bad4f187d Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-17 12:12:00 -04:00
Ryan Kurtz
ac64335ae1 Merge remote-tracking branch 'origin/GP-1-dragonmacher-action-key-binding-fix' into Ghidra_12.0 2025-09-17 12:08:50 -04:00
Ryan Kurtz
1942e0e95e Merge remote-tracking branch 'origin/GP-1_bug_fixes_related_to_toggle_variables_feature' into Ghidra_12.0 2025-09-17 12:08:21 -04:00
Ryan Kurtz
bdec6a0834 Merge remote-tracking branch
'origin/GP-5306_ghidorahrex_PR-5718_srichmo1_avr32_icall_pr'
(Closes #5718)
2025-09-17 09:37:58 -04:00
Ryan Kurtz
2043734ed0 Merge remote-tracking branch
'origin/GP-5243_ghidorahrex_PR-7170_gemesa_siemens-infineon-tricore'
(Closes #7170)
2025-09-17 09:36:22 -04:00
Ryan Kurtz
bf71cc4b8c Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-17 08:23:15 -04:00
Ryan Kurtz
8804b99713 GP-0: Adding more detail to OSGi exception output (#6455) 2025-09-17 08:21:15 -04:00
dragonmacher
e5e7f0a8ff Updated file chooser to register actions 2025-09-16 17:06:41 -04:00
ghidra1
e11d881e09 GP-0 Removed old debug statement 2025-09-16 16:52:57 -04:00
ghidra1
c5133c8eb9 GP-0 Minor fix to WhatsNew 12.0 2025-09-16 13:21:28 -04:00
ghidra2
495d525c0b GP-1 - expose ApplicationTrustManagerFactory X509TrustManager 2025-09-16 13:05:36 -04:00
ghidra1
ffceea9fb3 GP-1 Corrected OpenTrustManager.getAcceptedIssuers return value 2025-09-16 12:42:21 -04:00
Ryan Kurtz
7231c8b1e8 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-16 12:38:58 -04:00
ghidra1
8d066797c9 Merge remote-tracking branch 'origin/GP-5990_ghidra1_ListingCompositeMapRemoval' into Ghidra_12.0 2025-09-16 10:30:47 -04:00
ghidra1
060df1aca9 GP-5990 Removed Listing map for tracking array, composite and dynamic
data placement.  Remove composite added/removed event generation.
2025-09-16 10:19:31 -04:00
Ryan Kurtz
444e6453d1 GP-0: Fixing javadoc 2025-09-16 10:19:00 -04:00
Ryan Kurtz
3dbce7f987 Merge remote-tracking branch 'origin/GP-0_Dan_fixTests-2025-09-16-1' into Ghidra_12.0 2025-09-16 09:40:07 -04:00
Dan
2960b65f73 GP-0: Fix type behavior for Varnode (ANY) 2025-09-16 13:24:23 +00:00
Ryan Kurtz
4896cd5c97 Merge remote-tracking branch 'origin/GP-5900_ryanmkurtz_pe-export-forwarding--SQUASHED' 2025-09-16 05:57:21 -04:00
Ryan Kurtz
ad35a7e956 GP-5900: PeLoader now creates thunks in EXTERNAL block for forwarded exported functions 2025-09-16 05:56:14 -04:00
ghidragon
c5422e1606 GP-1 fixed bugs related to the new toggle variables feature 2025-09-15 14:05:42 -04:00
Ryan Kurtz
3bba2c2f14 GP-0: Upping master to 12.1 2025-09-15 13:49:29 -04:00
Ryan Kurtz
2d10da420f Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-15 13:48:46 -04:00
Ryan Kurtz
437bed4be0 GP-0: Updating WhatsNew 2025-09-15 13:30:39 -04:00
ghidra1
c3d8571ba3 Merge remote-tracking branch 'origin/Ghidra_12.0' 2025-09-15 10:31:49 -04:00
ghidra1
c99af66f5f GP-5908 Corrected excessive folder change notifications on first visit
to parent
2025-09-15 10:06:20 -04:00
Ryan Kurtz
6dd00be368 Merge branch
'GP-5979_dragonmacher-search-memory-accessibility--SQUASHED' (Closes #8264)
2025-09-15 09:53:46 -04:00
dragonmacher
1c5e9ea9c2 GP-5979: Accessibility - Updates to the Search Memory provider 2025-09-15 09:52:36 -04:00
Ryan Kurtz
22b3524206 Merge remote-tracking branch 'origin/GP-5763_emteere_NoReturnExternalsINT3--SQUASHED' 2025-09-15 09:46:20 -04:00
Ryan Kurtz
a893955b03 Merge remote-tracking branch 'origin/patch' 2025-09-15 09:45:43 -04:00
Ryan Kurtz
a1851c5911 Merge remote-tracking branch 'origin/GP-5985_emteere_MoreNonReturningPEFuncs' into patch 2025-09-15 09:42:53 -04:00
Ryan Kurtz
4c8d408fc7 Merge remote-tracking branch 'origin/GP-5526_emteere_plt_thunkPatterns' into patch 2025-09-15 09:40:48 -04:00
Ryan Kurtz
9e2a8d5604 Merge remote-tracking branch 'origin/GP-1-dragonmacher-window-growing-issue--SQUASHED' 2025-09-15 09:33:44 -04:00
Ryan Kurtz
5f6e3806b3 GP-0: Updating WhatsNew 2025-09-15 08:41:50 -04:00
ghidra1
a94ca1ed7e GP-5908 Corrected test failures 2025-09-12 17:48:51 -04:00
emteere
47acbe98bb GP-5763 Check for INT3 after calls as a non-returning indicator. Also only consider data refereces from the same function. 2025-09-12 20:05:16 +00:00
ghidra1
f6148f063a Merge remote-tracking branch 'origin/GP-5907-5908_ghidra1_ProjectTreeUpdateAndDelete--SQUASHED' 2025-09-12 15:35:03 -04:00
ghidra1
8d31fa97bb GP-5908 Corrected project tree change listener, domain folder events and various data tree actions to resolve issues when link-files are used. 2025-09-12 15:28:28 -04:00
Ryan Kurtz
09eabbdcd9 Merge remote-tracking branch 'origin/GP-5343_ryanmkurtz_mirroring'
(Closes #7430)
2025-09-12 13:39:58 -04:00
dragonmacher
fe4bb30704 Fixed detached windows growing every time they get shown 2025-09-12 12:39:44 -04:00
Ryan Kurtz
80caec9332 Merge branch 'GP-0_ryanmkurtz_PR-8483_rjooske_bsim-macOS' 2025-09-12 12:00:26 -04:00
Ryan Kurtz
71f91bfc17 GP-0: Strengthen check in CoffBinaryAnalysisCommand.canApply() to
prevent false positives
2025-09-12 11:52:36 -04:00
Ryan Kurtz
e40f817886 Merge remote-tracking branch
'origin/GP-5716_ghidranoob_HelpAboutSpecFiles--SQUASHED' (Closes #8163)
2025-09-12 10:32:31 -04:00
Dan
2a14a5f201 GP-5716: Port for FrontEnd. Changes per reivew. 2025-09-12 14:27:59 +00:00
Ryan Kurtz
c0fe84f0bd GP-5343: Importer filesystem mirroring 2025-09-12 10:04:53 -04:00
Ryan Kurtz
8c4e368fb2 Merge remote-tracking branch 'origin/GP-5984_James_create_enums_from_dwarf_macro_info--SQUASHED' 2025-09-12 09:16:50 -04:00
Ryan Kurtz
26685abc75 GP-5637: More improvements to the PyGhidra API 2025-09-12 09:15:05 -04:00
James
3b01f15e1c GP-5984 create enums from DWARF macro info entries 2025-09-12 12:47:14 +00:00
Ryan Kurtz
f52f5a7695 Merge branch 'GP-3947_ghidravision_DecompilerDebugXmlLoader_final' 2025-09-12 08:21:29 -04:00
ghidravision
38541a7ac6 GP-3947: Created an importer for the decompiler debug format which is
produced by the decompiler
2025-09-12 08:17:10 -04:00
Ryan Kurtz
da078607cb Merge remote-tracking branch 'origin/GP-5983-dragonmacher-decomp-function-location-nop' 2025-09-12 05:07:07 -04:00
Ryan Kurtz
1f04ac1915 Merge remote-tracking branch
'origin/GP-5886_ghidragon_toggle_display_function_variables_in_listing--SQUASHED'
(#8385)
2025-09-12 05:05:43 -04:00
ghidragon
8fc93d0d50 GP-5886 Added ability to toggle the display of function variables in the listing. 2025-09-11 13:43:40 -04:00
James
6e81a370ce GP-3139 added cspec for AARCH64 apple silicon 2025-09-11 17:36:37 +00:00
srichmo1
24b2275c0b tmp assigned rd0 instead of LR 2025-09-11 13:21:58 +00:00
srichmo1
be7458a436 Update avr32a_instruction_flow.sinc
The specification for avr32 says the LR register should be reserved for using return addresses, but in reality older compilers seem to use it to hold addresses for ICALL. When they do so without this fix the value in LR is immediately overwritten and during analysis only appears to be a function call to the opcode immediately after ICALL.
2025-09-11 13:21:56 +00:00
Ryan Kurtz
970c8fbdd5 Merge remote-tracking branch 'origin/patch' 2025-09-11 05:13:10 -04:00
LucaPalumbo
bc6701a24d Fix off-by-one in ElfHeader.getSectionLoadHeaderContaining
(Closes #8440)
2025-09-11 05:10:48 -04:00
dragonmacher
5d9904964e GP-5983 - Decompiler - Fixed bug that prevented overlapping functions
from being correctly decompiled
2025-09-10 20:15:31 -04:00
emteere
79eea09e64 GP-5985 added several more known non-returning PE functions 2025-09-10 23:06:54 +00:00
emteere
4b6d90366c GP-5526 Added section tag to function start patterns. New thunk patterns
in x86 gcc .plt section.  Changed priority of pre analyzer and
disassembly.
2025-09-10 22:55:14 +00:00
Ryan Kurtz
e330fc2077 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-10-25' 2025-09-10 14:20:49 -04:00
dragonmacher
6bba2ea685 Test fixes 2025-09-10 14:14:21 -04:00
Ryan Kurtz
2993827690 Merge remote-tracking branch
'origin/GP-5970-dragonmacher-scirpting-output-color--SQUASHED'
(Closes #2849)
2025-09-10 14:14:00 -04:00
Ryan Kurtz
59bcbba8cf Merge remote-tracking branch 'origin/GP-5978-dragonmacher-alt-graph-fix'
(Closes #8205)
2025-09-10 14:09:50 -04:00
Ryan Kurtz
272314d7af Merge remote-tracking branch 'origin/GP-5214_Dan_jitMpInt--SQUASHED' 2025-09-10 14:01:21 -04:00
Ryan Kurtz
eadb23c45a Merge remote-tracking branch
'origin/GP-5982-dragonmacher-symbol-tree-node-equals-npe' (Closes #8502)
2025-09-10 13:56:33 -04:00
dragonmacher
89b6306aea GP-5982 - Symbol Tree - NPE fix 2025-09-10 12:43:49 -04:00
Ryan Kurtz
657ec39201 GP-5637: More improvements to the PyGhidra API 2025-09-10 12:39:57 -04:00
Dan
df90de2367 GP-5214: Add support for multi-precision integer operations in the JIT-accelerated emulator. 2025-09-10 16:32:13 +00:00
dragonmacher
73bdee2546 GP-5970 - Scripting - A print/println methods to color console output 2025-09-10 12:21:42 -04:00
Ryan Kurtz
5fbb052b28 Merge remote-tracking branch
'origin/GP-5964-dragonmacher-file-chooser-accessibility--SQUASHED'
(Closes #6310, Closes #7129, Closes #7130)
2025-09-10 05:47:31 -04:00
Ryan Kurtz
4f164e68a6 Merge branch 'GP-5969_VxWorksTableIDFix' 2025-09-10 05:26:33 -04:00
emteere
6d588dab00 GP-5969: Updated vxWorks symbol table finding script to better filter
out runs of pointers to locate the table, deleted old scripts, and fixed
de-mangling and labeling issues.
2025-09-10 05:25:47 -04:00
dragonmacher
f781273d49 Removed Alt to Alt Graph mapping, since the original bug has been fixed
in Java
2025-09-09 18:00:23 -04:00
dragonmacher
dd6561807b GP-5964 - File Chooser - Accessibility tweaks 2025-09-09 15:22:03 -04:00
Ryan Kurtz
58ca21b8db Merge remote-tracking branch 'origin/GP-5973_Dan_lldbsetupTypos'
(Closes #8498)
2025-09-09 13:58:40 -04:00
Ryan Kurtz
e5684417c0 Merge remote-tracking branch 'origin/GP-0_Dan_z3ExtProps' 2025-09-09 12:12:36 -04:00
Ryan Kurtz
fca6104af0 Merge remote-tracking branch 'origin/GP-5566_d-millar_lisa_SQUASH250908' 2025-09-09 11:45:24 -04:00
Ryan Kurtz
b5e91aeac0 Merge remote-tracking branch 'origin/patch' 2025-09-09 11:24:08 -04:00
Ryan Kurtz
0613d364fc Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-deadlock-fix-v3' into patch 2025-09-09 11:20:41 -04:00
dragonmacher
deddc84205 Fix for previous commit; backport of master fix 2025-09-09 11:18:24 -04:00
Dan
20314d087d GP-5973: Fix typos in lldbsetuputils.ps1 2025-09-09 15:12:19 +00:00
Dan
0645a51808 GP-0: Add extension.properties for SymbolicSummaryZ3 2025-09-09 15:06:13 +00:00
Ryan Kurtz
221939c0a9 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-deadlock-fix' into patch 2025-09-09 10:45:35 -04:00
Ryan Kurtz
5769aec3f3 Merge remote-tracking branch
'origin/GP-5967-dragonmacher-key-binding-ui-improvement' (Closes #7024)
2025-09-09 07:57:39 -04:00
Ryan Kurtz
998bea8c50 Merge remote-tracking branch 'origin/GP-5883_ghidragon_memory_search_bug' 2025-09-09 07:55:31 -04:00
Ryan Kurtz
457d342887 Merge remote-tracking branch 'origin/GP-5933_ghidragon_update_mem_searrch_to_support_mutliple_patterns--SQUASHED' 2025-09-09 07:52:29 -04:00
ghidragon
93f92fa879 GP-5933 Added support for searching memory for multiple patters in the same pass through memory 2025-09-08 14:50:28 -04:00
Ryan Kurtz
c18c7a8f50 GP-5637: More improvements to the PyGhidra API 2025-09-08 13:24:10 -04:00
Ryan Kurtz
213a52ad6e Merge remote-tracking branch 'origin/GP-5968_dev747368_handle_misreported_filesizes_better' 2025-09-08 13:10:53 -04:00
ghidragon
8272662627 GP-5883 fixed Memory Search Options GUI not initializing all options to
current model settings
2025-09-08 13:10:02 -04:00
Ryan Kurtz
cbde125a14 GP-5966: Fixing typo 2025-09-08 12:59:48 -04:00
Ryan Kurtz
5396e3a041 Merge remote-tracking branch 'origin/GP-0_dev747368_javadoc_errors'
(Closes #8496)
2025-09-08 12:11:01 -04:00
dev747368
c703e4541f GP-0 fix golang javadoc errors 2025-09-08 16:03:42 +00:00
d-millar
f5572ede99 GP-5566: first/last? changes for ghidra
GP-5566: fix for J

GP-5566: minor fixes

GP-5566: icons decl proper

GP-5566: minor tweaks

GP-5566: post-review

GP-5566: minor

GP-5566: mo better monitor logic

GP-5566: minor fix
2025-09-08 15:36:25 +00:00
Ryan Kurtz
1bc7bbfe8d GP-5966: Updates to CONTRIBUTING.md to address AI and binary files
(Closes #8465)
2025-09-08 09:16:19 -04:00
Ryan Kurtz
8be2ef3856 GP-0: Formatting CONTRIBUTING.md 2025-09-08 09:03:30 -04:00
Ryan Kurtz
14d7cf3ee6 Merge remote-tracking branch 'origin/patch' 2025-09-08 06:15:01 -04:00
Ryan Kurtz
8fad5fc01d Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-5-25' into patch 2025-09-08 06:10:37 -04:00
dragonmacher
48754fb98d Test deadlock fix 2025-09-06 16:30:31 -04:00
dragonmacher
fc39df2dd1 Test fixes 2025-09-05 20:56:09 -04:00
dragonmacher
d538513428 GP-5967 - Improved Options Key Binding UI 2025-09-04 17:02:11 -04:00
dev747368
d8c8d655d4 GP-5968 handle misreported file sizes better during import
Some file systems lie about file sizes, and cause Ghidra to display an
error that isn't helpful.  Now the error is more helpful.
2025-09-04 19:28:12 +00:00
Ryan Kurtz
6eab6693fc Merge remote-tracking branch 'origin/GP-1-dragonamcher-window-centering-fix' 2025-09-04 14:06:29 -04:00
Ryan Kurtz
a72ed3c63e Merge remote-tracking branch 'origin/GP-4214_IBlockAdd' 2025-09-04 13:42:39 -04:00
dragonmacher
c65c4c777f Fix for centering components on items inside of scroll panes 2025-09-04 13:35:08 -04:00
Ryan Kurtz
f501ffccd2 Merge remote-tracking branch 'origin/GP-5938_dev747368_sevenzip_bz2_getsize_npe' 2025-09-04 06:10:06 -04:00
caheckman
ce09332fcd GP-4214 Allow INT_ADD in the iblock 2025-09-03 20:20:41 +00:00
Ryan Kurtz
162733b585 GP-0: Moving MachoProgramUtils.addExternalBlock() to
AbstractProgramLoader
2025-09-03 11:31:56 -04:00
Ryan Kurtz
d460bf9382 Merge branch 'GP-0_ryanmkurtz_PR-8488_rjooske_fix_java-awt-headless-not-set' 2025-09-03 06:09:13 -04:00
Ryan Kurtz
49daf5f649 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-2-25-v2' 2025-09-03 05:53:25 -04:00
Ryosuke Takahashi
4677edfc70 let launch.properties file decide whether to use -Xshare:off 2025-09-03 06:04:03 +09:00
dev747368
2a1df77713 GP-5938 fix NPE when extracting bz2 2025-09-02 20:13:55 +00:00
dragonmacher
41e42eb825 Test fixes 2025-09-02 15:20:06 -04:00
Ryan Kurtz
eef9950870 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-9-2-25-v1' 2025-09-02 14:37:14 -04:00
dragonmacher
f7c1714bb1 Test fixes 2025-09-02 14:33:46 -04:00
Ryosuke Takahashi
4d12936a7c fix java.awt.headless=true inconsistently not being set 2025-09-03 01:46:15 +09:00
Ryan Kurtz
48a7542e47 Merge remote-tracking branch
'origin/GP-5950_MultipathConditionalConstants' (Closes #8455)
2025-09-02 11:14:53 -04:00
caheckman
e412f13b30 GP-5950 Add support for multipath conditional constants 2025-09-02 15:08:58 +00:00
Ryan Kurtz
074ddc29bb Merge remote-tracking branch 'origin/patch' 2025-09-02 09:32:27 -04:00
Ryan Kurtz
7f671da253 GP-3809: Fixing OSGi-related errors that occurred when script-related
directories were not readable (Closes #8466)
2025-09-02 09:29:46 -04:00
Ryan Kurtz
87a32d568c Merge remote-tracking branch
'origin/GP-5963_dragonmacher_PR-7346_fmagin_fmagin_table_accessor'
(Closes #7346)
2025-09-02 06:00:20 -04:00
Ryan Kurtz
8d20806d93 Merge remote-tracking branch 'origin/GP-4023-dragonmacher-debugger-markers-issue--SQUASHED' 2025-09-02 05:58:14 -04:00
Ryan Kurtz
84fb7f6d08 Merge remote-tracking branch 'origin/GP-5823_ghidragon_data_graph_improvements--SQUASHED' 2025-09-02 05:56:50 -04:00
Ryan Kurtz
1ca9e32a57 Merge remote-tracking branch 'origin/patch' 2025-09-02 05:53:32 -04:00
Ryan Kurtz
f38c6727a0 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-8-30-25' into patch 2025-09-02 05:50:45 -04:00
Ryosuke Takahashi
2be37e6f7b BSim: fix malformed arguments to ./configure on macOS 2025-09-01 13:54:10 +09:00
dragonmacher
33f1f38292 Test fixes 2025-08-30 13:11:34 -04:00
ghidragon
ee9a0def13 GP-5834 small improvements to data graph 2025-08-29 19:46:12 -04:00
dragonmacher
72c410fd1c Refactor of new methods; test 2025-08-29 19:28:10 -04:00
Florian Magin
74022d3586 Concise creation of simple DynamicTableColumns 2025-08-29 15:43:27 -04:00
dragonmacher
b36dfb6766 GP-4023 - Fix to not show debugger bookmarks in the CodeBrowser 2025-08-29 14:10:16 -04:00
Ryan Kurtz
e0a060660b GP-5961: Deprecating pyghidra.open_program() and pyghidra.run_script()
Also fixed a recent regression with calling pyghidra.run_script()
2025-08-29 13:47:18 -04:00
Ryan Kurtz
ec28004339 Merge remote-tracking branch 'origin/GP-5959_James_improve_dwarf_macro_string_parsing' 2025-08-29 13:24:38 -04:00
Ryan Kurtz
fc77ef0816 Merge remote-tracking branch 'origin/GP-5962_ghizard_PDB_Fix_odd_situation_of_one_byte_reservation_for_empty_base_class_and_after_vxptrs' 2025-08-29 13:23:25 -04:00
Ryan Kurtz
706dc7c99b Merge remote-tracking branch 'origin/GP-5958_James_x86_thunk_di_fixup'
(Closes #8416)
2025-08-29 13:21:02 -04:00
ghizard
4a79954ca7 GP-5962 - PDB - Fix situation of empty, one-byte-reserved, direct,
non-virtual bases coming after self vxptrs
2025-08-29 12:49:53 -04:00
James
0fd2c297a1 GP-5959 improved DWARF macro string parsing 2025-08-29 16:35:19 +00:00
ghidorahrex
18eeb4b8c3 GP-5243: Fixed spacing issue 2025-08-29 14:52:04 +00:00
Andras Gemes
18a7f952c8 Processors: Rename TriCore Siemens to Infineon 2025-08-29 14:52:01 +00:00
Ryan Kurtz
4be538b42e Merge remote-tracking branch 'origin/patch' 2025-08-29 10:14:28 -04:00
Ryan Kurtz
02abd6b4f3 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-logging-fix' into patch 2025-08-29 10:12:52 -04:00
dragonmacher
8e7613dac3 Test logging fix 2025-08-29 09:39:29 -04:00
Ryan Kurtz
58171afd08 Merge remote-tracking branch 'origin/patch' 2025-08-29 04:47:42 -04:00
Ryan Kurtz
06429f1795 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-8-28-25' into patch 2025-08-29 04:42:04 -04:00
dragonmacher
eb0e2a95a7 Test fixes 2025-08-28 15:14:51 -04:00
Ryan Kurtz
91ec97a946 Merge remote-tracking branch
'origin/GP-5769-dragonmacher-combo-box-enter-handling' (Closes #8280)
2025-08-28 14:19:24 -04:00
Ryan Kurtz
44a16fd6ba Merge remote-tracking branch 'origin/patch' 2025-08-28 14:13:53 -04:00
Ryan Kurtz
2537d2a329 Merge remote-tracking branch
'origin/GP-5957-dragonmacher-ascii-exporter-xref-fix' into patch
(Closes #8468)
2025-08-28 14:09:29 -04:00
Ryan Kurtz
b25e7c12a1 Merge remote-tracking branch 'origin/GP-5470_dev747368_golang_typeinfo_1_24_1_25' 2025-08-28 12:23:12 -04:00
dev747368
86a525aef0 GP-5470 Golang json snapshot data, go1.24, go1.25, swissmap.
Remove usage of golang*.gdt for bootstrap type info.  Instead all types
are reconstituted from the info in the .json files.

Json data now omits more values that are empty.

Json data now has more consistent fully specified type names.

Remove option to create bootstrap gdt files.

Normalize 'Go' name usage where possible without changing previous
saved properties.

Handle swissmap typename changes.
2025-08-28 15:12:21 +00:00
Ryan Kurtz
90d498e27c Merge remote-tracking branch 'origin/GP-0-dragonmacher-patch-merge' 2025-08-28 09:22:17 -04:00
dragonmacher
0ad5aa6710 Merge remote-tracking branch 'origin/patch' into
GP-0-dragonmacher-patch-merge
2025-08-28 09:18:38 -04:00
Ryan Kurtz
88303ac825 Merge remote-tracking branch
'origin/GP-5951-dragonmacher-decompiler-syntax-hl-fix--SQUASHED' into
patch (Closes #8419)
2025-08-28 06:19:24 -04:00
Ryan Kurtz
3a243ed964 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-8-27-25' 2025-08-28 05:32:29 -04:00
dragonmacher
dc72238178 GP-5769 - Updated dialogs with combo boxes to have consistent behavior
when the Enter key is pressed
2025-08-27 19:47:35 -04:00
dragonmacher
963bc62f02 Test fixes 2025-08-27 18:54:34 -04:00
dragonmacher
0f89e04e70 GP-5951 - Decompiler - Changed recent middle-mouse highlight update to restore highlighting of if/else keywords. 2025-08-27 18:06:39 -04:00
dragonmacher
210520cd07 GP-5957 - Fixed missing reference type in the ASCII and HTML exporters 2025-08-27 17:31:31 -04:00
James
6229740f8b GP-5958 added callfixup for get_pc_thunk.di to x86gcc.cspec 2025-08-27 19:15:30 +00:00
Ryan Kurtz
8571e83b36 Merge remote-tracking branch 'origin/GP-5913_ghidranoob_Decomp_StructureMember_ParentPath--SQUASHED' 2025-08-27 12:51:15 -04:00
Ryan Kurtz
66a2caa2dc Merge remote-tracking branch 'origin/GP-5650_Dan_moveDynamicUpdateToToolbar--SQUASHED' 2025-08-27 12:48:28 -04:00
Dan
f2743a259e GP-5650: Replace 'Dynamic Update' checkbox in 'Instruction Info' with toolbar action. 2025-08-27 16:15:29 +00:00
ghidranoob
46febafe16 GP-5913: Added parent path to DataType Listing and Decompiler Hover 2025-08-27 16:00:11 +00:00
Ryan Kurtz
7a4100d54b Merge remote-tracking branch 'origin/patch' 2025-08-27 11:30:41 -04:00
Ryan Kurtz
5c00ab8e08 Merge remote-tracking branch
'origin/GP-5906_ghidorahrex_x86_sse4a_instructions--SQUASHED' into patch
(Closes #8335)
2025-08-27 11:25:24 -04:00
Ryan Kurtz
6521024f36 Merge remote-tracking branch 'origin/GP-5948_ghidra007_AutoVT_improved_operand_equivalency_check--SQUASHED' into patch 2025-08-27 11:21:14 -04:00
Ryan Kurtz
c85d7831cc GP-0: Upping patch to 11.4.3 2025-08-27 11:19:47 -04:00
Ryan Kurtz
f57b520837 GP-5825: Fixing issue with prior commit 2025-08-27 10:47:13 -04:00
Ryan Kurtz
b5bfcc0fbf GP-5825: Fixing regression with loading libraries from container file 2025-08-27 06:00:56 -04:00
Ryan Kurtz
fc1c06ea39 Merge remote-tracking branch 'origin/patch' 2025-08-27 04:56:05 -04:00
Ryan Kurtz
13ffa3a4a8 Merge remote-tracking branch 'origin/GP-5792_dev747368_DWARF_macro_info' 2025-08-26 12:51:07 -04:00
Ryan Kurtz
b12aff1cd4 Merge remote-tracking branch 'origin/GP-5851_MultiSlotAssignFixes' 2025-08-26 12:49:34 -04:00
caheckman
f6495e4146 GP-5851 Fix tiling truncations for odd data-type sizes in
MultiSlotAssign. Fix for big endian multi-slot return value.
2025-08-26 16:40:16 +00:00
ghidra1
0b61b34bb9 GP-0 Updated ChangeHistory for 11.4.2 release 2025-08-26 12:34:13 -04:00
ghidra1
8689672ebe Merge remote-tracking branch 'origin/GP-5945_emteere_e500IncludedExtensionFixes--SQUASHED' into patch 2025-08-26 12:05:54 -04:00
ghidra007
f71ae463d2 GP-5948 Improved auto vt dupe match's operand equivalency check to account for internal function ref operands. 2025-08-26 16:05:05 +00:00
emteere
f391ddb87c GP-5945 Fixed PowerPC e500 instruction extension issues and added function start pattern variants. 2025-08-26 11:59:06 -04:00
ghidorahrex
393e7935af GP-5906: Added x86 SSE4a instructions 2025-08-26 08:33:50 -04:00
Ryan Kurtz
eb7dbaa04f Merge remote-tracking branch 'origin/GP-1-dragonmacher-window-size-issue--SQUASHED' 2025-08-26 05:20:53 -04:00
Ryan Kurtz
4e6d7b1650 Merge remote-tracking branch 'origin/GP-0-dragonmacher-table-row-height-fix' 2025-08-26 05:20:11 -04:00
Ryan Kurtz
799200c528 Merge remote-tracking branch 'origin/GP-5930_ghidragon_pcode_field_toggle_action--SQUASHED' 2025-08-26 05:18:53 -04:00
Ryan Kurtz
6f082ff081 Merge remote-tracking branch 'origin/GP-5947-dragonmacher-decomp-middle-mouse-color' 2025-08-26 05:17:34 -04:00
Ryan Kurtz
dc1c70e2bf Merge remote-tracking branch 'origin/GP-5926_Dan_refsToRange--SQUASHED' 2025-08-26 05:16:03 -04:00
Ryan Kurtz
cd18bef25a Merge remote-tracking branch 'origin/GP-4029_ghintern_mips_powerpc_cspecs' 2025-08-26 05:13:29 -04:00
Ryan Kurtz
d0e0dba587 Merge remote-tracking branch 'origin/GP-5892_Dan_updateTtdHelp' 2025-08-26 05:10:06 -04:00
dragonmacher
ba94153c21 Fixed detached Byte Viewer size being too tall 2025-08-25 17:23:39 -04:00
ghidranoob
cd9a57d859 Show spec files in Help About Program 2025-08-25 20:00:47 +00:00
James
d9a5ad2ed0 GP-4029 updated mips and ppc language versions 2025-08-25 19:31:22 +00:00
Dan
2ea7f28f2c GP-5892: Update help for TTD. 2025-08-25 19:29:07 +00:00
ghintern
d91aebe74e GP-4030: Fix MIPS base and eabi 32/64-bit cspecs
GP-4029: Update base PowerPC 32/64-bit cspecs
2025-08-25 19:15:08 +00:00
Ryan Kurtz
94212ab653 Merge remote-tracking branch 'origin/GP-5934_SborrowScarry'
(Closes #8396, Closes #8400)
2025-08-25 13:16:53 -04:00
James
c3c09f2f17 GP-5792 parse DWARF .debug_macro sections 2025-08-25 16:55:45 +00:00
Dan
1b9106b797 GP-5926: Change TraceReferenceManager to use address ranges for the 'to' part. 2025-08-25 16:49:23 +00:00
ghidragon
45c19494b7 GP-5930 Quick toggle for PCode field
tmp
2025-08-25 11:50:24 -04:00
Ryan Kurtz
b9cd9016b7 Merge remote-tracking branch 'origin/GP-5944_dev747368_gfilesystem_file_attrs_fixup' 2025-08-25 11:41:13 -04:00
Ryan Kurtz
12ac4660a1 Merge remote-tracking branch 'origin/GP-5864_Dan_addEmulatorUtilities--SQUASHED' 2025-08-25 05:41:08 -04:00
Ryan Kurtz
cbaf429587 Merge remote-tracking branch
'origin/GP-5932-dragonmacher-move-windows-on-screen' (Closes #8428)
2025-08-25 05:39:52 -04:00
dragonmacher
aae2843f4d GP-5947 - Created new theme value for the Decompiler's middle-mouse
highlight color so that the Listing and Decompiler colors may change
independently.
2025-08-22 18:00:48 -04:00
Dan
d577925d75 GP-5864: Add EmulatorUtilities 2025-08-22 19:00:40 +00:00
Ryan Kurtz
4fcc1febdd Merge remote-tracking branch 'origin/GP-5904_ghidorahrex_PR-8394_RibShark_fix-80251-anl-group-fix' 2025-08-22 09:39:30 -04:00
Ryan Kurtz
826e52033e Merge remote-tracking branch 'origin/GP-5903_ghidorahrex_PR-8393_RibShark_80251-anl-name-fix' 2025-08-22 09:38:44 -04:00
Ryan Kurtz
f6d35f0d70 Merge remote-tracking branch
'origin/GP-5885-dragonmacher-next-instruction-fix--SQUASHED'
(Closes #8385)
2025-08-22 09:34:35 -04:00
dragonmacher
bdf3c1d2f6 GP-5885 - Updated the Next Instruction action to jump to the the function entry when in the function header 2025-08-22 09:15:56 -04:00
Ryan Kurtz
dc09c94c81 Merge remote-tracking branch
'origin/GP-5941_d-millar_PR-8457_technologeli_fix_for_taint_option'
(Closes #8452, Closes #8457)
2025-08-22 06:10:42 -04:00
Ryan Kurtz
58007f4f88 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-8-21-25' 2025-08-22 06:07:03 -04:00
Ryan Kurtz
12a926bd8b Merge remote-tracking branch 'origin/GP-1-dragonmacher-symbol-tree-bug-fix' 2025-08-22 06:06:43 -04:00
Ryan Kurtz
8fa692b0fa Merge remote-tracking branch 'origin/patch' 2025-08-22 06:06:11 -04:00
Ryan Kurtz
5c1e6540f1 Merge remote-tracking branch 'origin/GP-5860-dragonmacher-function-comparison-fix' 2025-08-22 05:57:39 -04:00
Ryan Kurtz
daec88be49 Merge branch 'GP-5917_emteere_SwitchAnalyzerSpeedIssue' into patch 2025-08-22 05:54:45 -04:00
emteere
48adb5ec25 GP-5917 Use a hashset for functions to reduce reduntant decompiler use
in functions that have more than one possible switch
2025-08-22 05:54:25 -04:00
dragonmacher
5af94b1dd4 Symbol tree bug fix 2025-08-21 19:49:10 -04:00
dragonmacher
3fb9ede462 GP-5932 - Updated off-screen window handling 2025-08-21 19:01:12 -04:00
dev747368
3b0ee82a5f GP-5944 cleanup GFilesystem file attribute handling 2025-08-21 22:31:11 +00:00
dragonmacher
bff95dc7c6 Test fixes 2025-08-21 14:25:45 -04:00
d-millar
b9049298af GP-5941: PR #8457 2025-08-21 17:10:26 +00:00
Ryan Kurtz
7b36c1649f Merge remote-tracking branch 'origin/GP-5879_Dan_reworkEmuUiIntegration--SQUASHED' 2025-08-21 11:04:12 -04:00
Elijah Lieu
d5df2590dc Fix: TaintAnalysis query use chosen file if none set in tool options 2025-08-21 10:01:38 -04:00
Dan
72001639a8 GP-5879: Add callbacks to PcodeEmulator. Refactor for composition vice inheritance. 2025-08-21 13:22:49 +00:00
Ryan Kurtz
34d5435740 Merge remote-tracking branch
'origin/GP-5897_Dan_bracketsInBlocksBreaksEmu' (Closes #8398)
2025-08-21 06:47:43 -04:00
Ryan Kurtz
c80f792ee8 Merge remote-tracking branch 'origin/patch' 2025-08-21 06:45:30 -04:00
Ryan Kurtz
0a436cbc4b Merge branch 'GP-0_ryanmkurtz_swift-links' into patch 2025-08-21 06:43:48 -04:00
Ryan Kurtz
3abf7f765e GP-0: Updating Swift documentation links 2025-08-21 06:42:41 -04:00
Ryan Kurtz
09e625f5fe Merge branch 'GP-5873_ryanmkurtz_PR-8450_ZERO-A-ONE_ida9' (Closes #8450) 2025-08-21 06:08:25 -04:00
Ryan Kurtz
4bcb650313 GP-5873: Certify 2025-08-21 06:07:03 -04:00
dragonmacher
1b28cfaf86 Fixed table row resize issue when adding more than one data row per
table row
2025-08-20 12:10:49 -04:00
ZERO-A-ONE
a312aaabb1
Update idaxml.py 2025-08-20 23:05:20 +08:00
ZERO-A-ONE
2484d2b548
Update xml_exporter.py 2025-08-20 22:47:57 +08:00
Ryan Kurtz
e4e2e4369e Merge remote-tracking branch 'origin/patch' 2025-08-20 07:59:09 -04:00
Ryan Kurtz
2e0e64b7c6 Merge branch 'GP-5648_ryanmkurtz_cert-headers' into patch 2025-08-20 06:17:17 -04:00
Ryan Kurtz
cdc5af10e4 GP-5648: Certification header support for .bat and .ps1 files 2025-08-20 05:58:46 -04:00
Ryan Kurtz
c5d0f6925b Merge remote-tracking branch 'origin/GP-5937-dragonmacher-symbol-tree-fixes' 2025-08-20 05:15:18 -04:00
Ryan Kurtz
384d72782a Merge remote-tracking branch 'origin/patch' 2025-08-20 05:12:40 -04:00
Ryan Kurtz
154aa4460c Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-8-19-25-2' into patch 2025-08-20 05:10:24 -04:00
ZERO-A-ONE
f47258c2b2 Fixed idaxml working in IDA 9.x 2025-08-20 12:10:48 +08:00
dragonmacher
f7670d8da0 GP-5860 - Fixed a regression in the Function Comparison view 2025-08-19 18:46:00 -04:00
ghidra1
d38f512437 GP-1 Added ability to skip building of all natives for gradle build 2025-08-19 18:08:30 -04:00
caheckman
8217593e87 GP-5934 Fix handling of integer minimum in SBORROW, SLESS rules, add
SCARRY rule.
2025-08-19 21:22:37 +00:00
dragonmacher
81fce4fed5 Fixes for Symbol Tree exceptions 2025-08-19 17:05:56 -04:00
dragonmacher
3e240563ab Test debug 2025-08-19 16:49:40 -04:00
Ryan Kurtz
4172e448dd Merge remote-tracking branch 'origin/patch' 2025-08-19 14:56:22 -04:00
Ryan Kurtz
21b27795dd Merge remote-tracking branch 'origin/GP-5889_SwitchGuardDuplicate' into patch 2025-08-19 14:53:47 -04:00
Ryan Kurtz
a48c081e61 Merge remote-tracking branch
'origin/GP-5720-dragonmacher-drop-down-field-contains-mode--SQUASHED'
(Closes #4725, Closes #8203)
2025-08-19 13:01:58 -04:00
Ryan Kurtz
c7b125b1c7 Merge remote-tracking branch 'origin/GP-1-dragonmacher-tooltip-fix--SQUASHED' 2025-08-19 10:00:01 -04:00
Ryan Kurtz
c14f03c79a Merge remote-tracking branch 'origin/GP-5927_CondExecWithSubpiece'
(Closes #8022)
2025-08-19 09:56:01 -04:00
Ryan Kurtz
ed1a1b81f0 Merge remote-tracking branch
'origin/GP-3648-dragonmacher-fg-comparisons' (Closes #1154)
2025-08-19 09:53:50 -04:00
Ryan Kurtz
bcefa8bf09 Merge remote-tracking branch 'origin/patch' 2025-08-19 07:22:55 -04:00
Ryan Kurtz
105f9ef570 GP-5916: Checking for IMAGE_FUNCTION_RUNTIME_ENTRY.BeginAddress != 0
before creating function (#8414)
2025-08-19 07:19:10 -04:00
Ryan Kurtz
729642cbf6 Merge remote-tracking branch 'origin/GP-5912_emteere_SuperH_GBR' into
patch (Closes #4387)
2025-08-19 05:57:47 -04:00
Ryan Kurtz
be0ca420eb GP-5855: TLB prebuild fix 2025-08-19 05:55:23 -04:00
dragonmacher
3c90216365 GP-3648 - Add Function Graph to Function Comparison display 2025-08-18 17:14:26 -04:00
dragonmacher
ce0c7b9229 GP-5720 - Drop Down Modes - Added modes to drop-down text fields to control how matches are found 2025-08-18 16:39:20 -04:00
dragonmacher
b4f7c920e6 Fixed tooltip usage in memory search widget 2025-08-18 16:36:08 -04:00
Ryan Kurtz
6773801f6e Merge remote-tracking branch 'origin/GP-5581_sleighPiecewiseUniques--SQUASHED' 2025-08-18 13:44:28 -04:00
Ryan Kurtz
c001c4c65d Merge remote-tracking branch 'origin/patch' 2025-08-18 13:43:42 -04:00
Ryan Kurtz
f4ddff1a2c Merge remote-tracking branch 'origin/GP-5935_ryanmkurtz_pe' into patch
(Closes #8446)
2025-08-18 13:41:23 -04:00
Ryan Kurtz
328042f00f GP-5935: The IMAGE_RESOURCE_DIRECTORY_ENTRY data type is now correctly
defined as a structures instead of a union
2025-08-18 13:40:34 -04:00
Dan
42115f6df0 GP-5581: Allow optimization by truncation of subpieced unique varnodes. 2025-08-18 17:12:23 +00:00
Ryan Kurtz
6bc3871e67 Merge remote-tracking branch 'origin/GP-5923_dev747368_dynamiclabels_globalnamespace' 2025-08-18 12:50:21 -04:00
Ryan Kurtz
16a2e78806 Merge remote-tracking branch 'origin/GP-5914-dragonmacher-symbol-tree-nav-fix' 2025-08-18 12:47:50 -04:00
Ryan Kurtz
245ba82d8b Merge remote-tracking branch 'origin/GP-5793-dragonmacher-symbol-tree-external-path-update' 2025-08-18 12:45:22 -04:00
Ryan Kurtz
15ac693e76 Merge remote-tracking branch 'origin/GP-5855_ryanmkurtz_tlb--SQUASHED' 2025-08-18 10:54:45 -04:00
Ryan Kurtz
3ff52f05b1 GP-5855: Always use TLB prebuild 2025-08-18 10:51:56 -04:00
Ryan Kurtz
542c2aa617 Merge remote-tracking branch 'origin/patch' 2025-08-18 07:21:13 -04:00
Ryan Kurtz
465fba743b GP-5901: Fixing Gradle 9 archive file permissions 2025-08-18 07:15:49 -04:00
dragonmacher
42f4b3462e GP-5793 - Symbol Tree - Updated to respond to external program path
changes
2025-08-15 11:07:53 -04:00
dev747368
ad32d0177b GP-5923 don't default to Global namespace for dynamic symbols in columns
Tweak display of namespace columns to not default to Global namespace
for dynamic symbols.
2025-08-15 15:01:58 +00:00
Ryan Kurtz
70e28cf706 Merge remote-tracking branch 'origin/GP-5931_dev747368_fix_dwarf64_offsets--SQUASHED' 2025-08-15 06:01:23 -04:00
dragonmacher
7b61358488 GP-5914 - Symbol Tree - Fixed issue that caused navigation when opening
a folder
2025-08-14 19:38:27 -04:00
dev747368
46b0b17c74 GP-5931 fix problem reading dwarf file info in a DWARF64 file
Deserialization was using the dwarf intSize from the containing compile
unit instead of the dwarf intSize from the DWARFLine unit header.  When
this disagreed with the compUnit's intSize, we would read too much or
too little.
2025-08-14 13:35:57 -04:00
caheckman
bb19782c35 GP-5927 Add support for SUBPIECE removal in ConditionalExecution 2025-08-13 23:22:35 +00:00
Ryan Kurtz
98b938cc65 Merge remote-tracking branch 'origin/patch' 2025-08-13 06:05:56 -04:00
Ryan Kurtz
2ca382da7d Merge remote-tracking branch 'origin/GP-5928_ghizard_PDB_Fixed_issue_with_members_only_layout_losing_members' into patch 2025-08-13 06:02:33 -04:00
Ryan Kurtz
ed7c7019cd Merge remote-tracking branch
'origin/GP-5910_ryanmkurtz_IntelHexExporter--SQUASHED' into patch
(Closes #8409)
2025-08-13 06:00:28 -04:00
Ryan Kurtz
8c4bb84489 GP-5910: IntelHexExporter fixes 2025-08-13 05:56:40 -04:00
ghizard
dcd26f14d2 GP-5928 - PDB - Fix lost members of some composites 2025-08-12 16:46:46 -04:00
Ryan Kurtz
c0127326f8 Merge branch 'GP-0_ryanmkurtz_PR-8423_inferenceus_readme-fix' 2025-08-12 06:32:25 -04:00
Ryan Kurtz
29b8cdf394 Merge remote-tracking branch
'origin/GP-4069_dev747368_dwarf_expression_eval--SQUASHED'
(Closes #5982, Closes #6974, Closes #2322, Closes #5311)
2025-08-12 06:07:44 -04:00
Ryan Kurtz
1b230c5dad Merge remote-tracking branch 'origin/GP-5891_Dan_fixMissingDebuggerJavadocs--SQUASHED' 2025-08-12 06:05:16 -04:00
ghidra1
520c6b7b98 Merge remote-tracking branch 'origin/patch' 2025-08-11 17:55:15 -04:00
ghidra1
cf61a2ffaf Merge remote-tracking branch 'origin/GP-5918_ELF_MIPS64_RelocationFix' into patch 2025-08-11 17:51:36 -04:00
ghidra1
f7138da6f7 GP-5918 Corrected ELF Relocation regression for MIPS 64-bit introduced
with GP-5826 in Ghidra 11.4.1
2025-08-11 13:00:58 -04:00
dev747368
e908ab6fbf DWARF expression handling refactor
Cleanup logic of expression evaluation, stub out resolution of register
values to a callback in case we want to use constant propagation to try
to allow successful calculations, and add support for default static
values for treating an arch's stack frame register (e.g. RBP) like the
static CFA value we already have support for.

Add option to decorate params and local vars with their DWARF storage
location info.

Handle arrays with unspecified element type.
2025-08-11 11:21:28 -04:00
Dan
66db634962 GP-5897: Handle brackets in block names when launching emulation. 2025-08-11 14:11:53 +00:00
Dan
ce96f8551d GP-5891: Include Debugger javadocs in the build. 2025-08-11 13:12:28 +00:00
inference
569a0a95a2
fix(doc): unify program names 2025-08-11 12:25:05 +00:00
inference
f62f015fef
fix(doc): Program names in README 2025-08-10 12:26:19 +00:00
caheckman
9c9938e066 GP-5889 Check for common source in duplicated switch guard detection 2025-08-08 21:59:45 +00:00
Ryan Kurtz
593c3c10e9 Merge remote-tracking branch 'origin/patch' 2025-08-07 12:20:37 -04:00
Ryan Kurtz
8055da80b8 Merge remote-tracking branch 'origin/GP-5915_ConditionalJoinFix' into
patch (Closes #8310)
2025-08-07 12:14:49 -04:00
Ryan Kurtz
42794bc3fa Merge branch 'GP-5873_ryanmkurtz_ida' (Closes #7392) 2025-08-07 11:27:51 -04:00
caheckman
29b7cb6552 GP-5915 Fix bug in ConditionalJoin 2025-08-07 15:19:32 +00:00
Ryan Kurtz
82f50a9305 GP-5873: New idaxml.py for IDA 9.x 2025-08-07 09:41:37 -04:00
emteere
28313c6574 GP-5912 Adding SH2 GBR register to the preserved by call list 2025-08-07 12:44:05 +00:00
Ryan Kurtz
6c44623c41 Merge branch 'GP-0_ryanmkurtz_PR-8408_widberg_fix-bitmap-resource' 2025-08-07 08:41:23 -04:00
Ryan Kurtz
4c51d0e02c GP-0: Certify and warning removal 2025-08-07 08:40:44 -04:00
Ryan Kurtz
d769137130 Merge remote-tracking branch 'origin/patch' 2025-08-07 06:44:53 -04:00
Ryan Kurtz
3e550cf08f GP-5919: Backporting decompiler highSymbol NPE fix (Closes #8413) 2025-08-07 06:41:37 -04:00
Ryan Kurtz
39c6a6db59 Merge remote-tracking branch
'origin/GP-5899_dev747368_fidplugin_startup_speed' (#7887)
2025-08-06 14:48:10 -04:00
Ryan Kurtz
d681ae53ce Merge remote-tracking branch 'origin/patch' 2025-08-06 13:20:52 -04:00
Ryan Kurtz
a638bb9a66 GP-5916: Fixing PE ImageFuntimeFunctionEntries 11.4.1 regression
(Closes #8414)
2025-08-06 13:17:00 -04:00
Ryan Kurtz
483cd9a799 Merge remote-tracking branch 'origin/GP-5795_Dan_commentColumnForWatch'
(Closes #8302)
2025-08-06 09:13:44 -04:00
dev747368
f53671b43d GP-5899 FidPlugin startup speed
Avoid touching FidFileManager during ctor / init, modernize action
creation / management.

Improves codebrowser startup speed a small amount.
2025-08-05 22:59:56 +00:00
Ryan Kurtz
31dc3a2f11 Merge remote-tracking branch 'origin/GP-5911_dev747368_fix_windows_rootdir_naming' 2025-08-05 13:55:14 -04:00
dev747368
285fe59bcb GP-5911 fix FS & drive letter root dir lookup problem.
Looking up "c:/" would treat it as the global "/" root dir.
2025-08-05 17:25:58 +00:00
Ryan Kurtz
e01d4b3710 Merge remote-tracking branch
'origin/GP-5898_dev747368_faster_jythonplugin_startup' (#7887)
2025-08-05 12:44:14 -04:00
Ryan Kurtz
ef3bd8b2b7 Merge remote-tracking branch 'origin/GP-4478_ghidranoob_Assembler_F1Help--SQUASHED' 2025-08-04 15:14:25 -04:00
ghidranoob
6096a50042 GP-4478: More review changes
GP-4478: Review changes
GP-4478 Add help to assembler
Add help to assembler
Initial commit
2025-08-04 14:41:28 -04:00
widberg
03593e348d [BitmapResource] Fix channel swaped and black icons 2025-08-04 13:03:59 -04:00
Ryan Kurtz
e90c852353 GP-0: Removing use of deprecated Validate.nonNull() 2025-08-04 07:17:08 -04:00
Ryan Kurtz
a60e2d8637 GP-0: Upping Gradle wrapper to 9.0.0 2025-08-04 06:48:15 -04:00
Ryan Kurtz
3307a0b06b Merge remote-tracking branch 'origin/patch' 2025-08-04 06:26:27 -04:00
Ryan Kurtz
22de131dd0 Merge branch 'GP-5901_ryanmkurtz_gradle9' into patch 2025-08-04 06:22:05 -04:00
Ryan Kurtz
2180fd2851 GP-5901: Support for Gradle 9.0.0 2025-08-04 06:21:21 -04:00
Ryan Kurtz
18f7ed85da Merge remote-tracking branch 'origin/GP-5869_DecompilerIndexAndShift'
(Closes #7474)
2025-08-01 12:58:25 -04:00
Ryan Kurtz
0a97fd8feb Merge branch 'GP-0_ryanmkurtz_PR-8404_gemesa_bsim-cmd-line-ref' 2025-08-01 06:37:56 -04:00
Andras Gemes
42bc550c0b
BSim: Remove extra characters in CommandLineReference.html 2025-08-01 09:05:51 +02:00
caheckman
943ccd322d GP-5869 Fix for some out of bounds array indices and shift amounts 2025-07-31 22:56:19 +00:00
dev747368
9550bef788 GP-5898 speed up JythonPlugin startup
Delay printing welcome text until the console is displayed.
2025-07-31 20:33:09 +00:00
Ryan Kurtz
213a9e48cc Merge remote-tracking branch 'origin/GP-0_ghidragon_splash_screen_update' 2025-07-31 15:25:42 -04:00
Ryan Kurtz
49bdfd8df4 Merge remote-tracking branch
'origin/GP-5807-dragonmacher-file-choose-slowness--SQUASHED'
(Closes #8284, Closes #4725)
2025-07-31 15:21:25 -04:00
Ryan Kurtz
c311ecd87d Merge remote-tracking branch 'origin/patch' 2025-07-31 14:14:58 -04:00
ghidra1
ada4b5c4ae GP-0 Update Ghidra patch version to 11.4.2 2025-07-31 13:52:18 -04:00
ghidra1
da059ed907 GP-0 Reverted version to 11.4.1 for patch release 2025-07-31 11:21:23 -04:00
dragonmacher
7202703a60 GP-5807 - File Chooser - Large directory speed ups 2025-07-31 10:44:36 -04:00
Ryan Kurtz
3c0a0fa063 Merge remote-tracking branch 'origin/patch' 2025-07-30 16:17:49 -04:00
Ryan Kurtz
7426d4b685 Merge remote-tracking branch 'origin/GP-5884_ghizard_PDB_CPP_Reconstruct_parent_source_order' 2025-07-30 15:15:03 -04:00
ghidragon
66421c88f9 Tweaks to SplashScreen 2025-07-30 14:46:33 -04:00
ghidra1
2f439d6909 GP-0 Set release version to 11.4.2 2025-07-30 10:11:39 -04:00
ghidra1
cc932b12b2 GP-5888 Corrected regression error in stack editor 2025-07-30 10:09:35 -04:00
ghizard
b85c2b5947 GP-5884 - PDB CPP - Reconstruct parent source order 2025-07-30 09:16:06 -04:00
Ryan Kurtz
369804843c GP-0: Fixing docker README file location 2025-07-30 07:56:15 -04:00
Ryan Kurtz
dbb9e7feee Merge remote-tracking branch 'origin/patch' 2025-07-29 15:34:48 -04:00
Ryan Kurtz
0d8f57ba2f Merge remote-tracking branch 'origin/GP-4400_ghintern_mlextension_improvements' 2025-07-29 15:22:49 -04:00
ghidra1
fe7cbd8ee8 GP-0 Updated ChangeHistory for 11.4.1 release 2025-07-29 14:31:09 -04:00
Ryan Kurtz
5712017eb1 Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_extract' 2025-07-29 14:07:13 -04:00
ghidra1
bfd1e3dbea Merge remote-tracking branch 'origin/patch' 2025-07-29 14:03:18 -04:00
ghidra1
a3137e33d7 GP-5881 Corrected regression error with Structure editor change 2025-07-29 14:00:21 -04:00
James
168cbc7e7a GP-4400 minor tweaks 2025-07-29 17:47:44 +00:00
Ryan Kurtz
b239500645 GP-0: Adding instructions stating to not extract the Ghidra zip on top
of an existing installation
2025-07-29 11:29:32 -04:00
Ryan Kurtz
b76bbb843f Merge remote-tracking branch 'origin/GP-5853_Dan_ARM-VLD-and-VST--SQUASHED' 2025-07-29 10:35:14 -04:00
Dan
352fed0d95 GP-5853: Initial implementation of ARM Neon VLD/VSTn instructions. 2025-07-29 14:32:54 +00:00
RibShark
e7cad294c9
Fix 80251 "ANL Rm,#data" showing as "ADD"
Should be self explanatory, looks like it was just a typo.
2025-07-29 14:59:32 +01:00
RibShark
cca3fcc208
Fix ANL Areg,Data for 80251 in source mode
ANL Areg,Data should be GROUP1 rather than GROUP2, the incorrect group causes the instruction to fail to decode on source mode 80251
2025-07-29 14:57:07 +01:00
ghintern
efb837ef34 GP-4400: ML extension improvements 2025-07-29 13:47:26 +00:00
Ryan Kurtz
0af58800f5 Merge remote-tracking branch 'origin/GP-1-dragonmacher-review-tool-close-bug' 2025-07-29 09:45:21 -04:00
Ryan Kurtz
7fb7f5df1b Merge remote-tracking branch 'origin/GP-1-dragonmacher-action-context-fix' 2025-07-29 09:44:57 -04:00
Ryan Kurtz
c892ad1695 Merge remote-tracking branch 'origin/GP-1-dragonmacher-color-chooser-history-fix' 2025-07-29 09:44:28 -04:00
Ryan Kurtz
6c85ba4563 Merge remote-tracking branch
'origin/GP-5759_ghidorahrex_PR-8192_p1pkin_sh4_fsca_fix' (Closes #8192)
2025-07-29 09:12:19 -04:00
Ryan Kurtz
391a052e55 Merge remote-tracking branch 'origin/patch' 2025-07-29 09:10:56 -04:00
ghidorahrex
4abf6d55ad GP-5766: Fixed instruction AVX512 disassembly errors 2025-07-29 08:56:43 -04:00
Ryan Kurtz
9b8468b6b6 Merge remote-tracking branch
'origin/GP-5592_ghidorahrex_PR-7982_niooss-ledger_ebpf-ISA-v4' into
patch (Closes #7982)
2025-07-29 08:53:18 -04:00
Nicolas Iooss
24d19f6e8c Add eBPF ISA v4 instructions
In 2023, the eBPF instruction set was modified to add several
instructions related to signed operations (load with sign-extension,
signed division, etc.), a 32-bit jump instruction and some byte-swap
instructions. This became version 4 of eBPF ISA.

Here are some references about this change:

- https://pchaigno.github.io/bpf/2021/10/20/ebpf-instruction-sets.html
  (a blog post about eBPF instruction set extensions)
- https://lore.kernel.org/bpf/4bfe98be-5333-1c7e-2f6d-42486c8ec039@meta.com/
  (documentation sent to Linux Kernel mailing list)
- https://www.rfc-editor.org/rfc/rfc9669.html#name-sign-extension-load-operati
  (IETF's BPF Instruction Set Architecture standard defined the new
  instructions)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n1859
  (implementation of signed division and remainder in Linux kernel.
  This shows that 32-bit signed DIV and signed MOD are zero-extending
  the result in DST)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n2135
  (implementation of signed memory load in Linux kernel)
- https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f9a1ea821ff25353a0e80d971e7958cd55b47a3
  (commit which added signed memory load instructions in Linux kernel)

This can be tested with a recent enough version of clang and LLVM (this
works with clang 19.1.4 on Alpine 3.21).
For example for signed memory load instructions:

    signed int sext_8bit(signed char x) {
        return x;
    }

produces:

    $ clang -O0 -target bpf -mcpu=v4 -c test.c -o test.ebpf
    $ llvm-objdump -rd test.ebpf
    ...
    0000000000000000 <sext_8bit>:
           0:  73 1a ff ff 00 00 00 00  *(u8 *)(r10 - 0x1) = r1
           1:  91 a1 ff ff 00 00 00 00  r1 = *(s8 *)(r10 - 0x1)
           2:  bc 10 00 00 00 00 00 00  w0 = w1
           3:  95 00 00 00 00 00 00 00  exit

(The second instruction is a signed memory load)

Instruction MOVS (Sign extend register MOV) uses offset to encode the
conversion (whether the source register is to be considered as signed
8-bit, 16-bit or 32-bit integer). The mnemonic for these instructions is
quite unclear:

- They are all named MOVS in the proposal
  https://lore.kernel.org/bpf/4bfe98be-5333-1c7e-2f6d-42486c8ec039@meta.com/
- LLVM and Linux disassemblers only display pseudo-code (`r0 = (s8)r1`)
- RFC 9669 (https://datatracker.ietf.org/doc/rfc9669/) uses MOVSX for
  all instructions.
- GCC uses MOVS for all instructions:
  https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/gcc/config/bpf/bpf.md?plain=1#L326-L365

To make the disassembled code clearer, decode such instructions with a
size suffix: MOVSB, MOVSH, MOVSW.

The decoding of instructions 32-bit JA, BSWAP16, BSWAP32 and BSWAP64 is
straightforward.
2025-07-29 12:45:06 +00:00
Ryan Kurtz
1929357e1d Merge remote-tracking branch 'origin/patch' 2025-07-29 08:33:22 -04:00
Ryan Kurtz
0d8a39a07a Merge remote-tracking branch
'origin/GP-5857_ghidorahrex_PR-7979_niooss-ledger_ebpf-fix-load-zext'
into patch (Closes #7979)
2025-07-29 08:24:03 -04:00
Ryan Kurtz
b4239911c9 Merge remote-tracking branch
'origin/GP-5858_ghidorahrex_PR-7929_niooss-ledger_fix-ebpf-call-operand'
into patch (Closes #7929)
2025-07-29 08:21:27 -04:00
Ryan Kurtz
179263a592 Merge remote-tracking branch
'origin/GP-5593_ghidorahrex_PR-7985_niooss-ledger_ebpf-fix-semantic-byte-swap-instructions'
into patch (Closes #7985)
2025-07-29 08:19:37 -04:00
Ryan Kurtz
28b46c5c93 Merge remote-tracking branch
'origin/GP-5336_ghidorahrex_PR-7065_philpem_6805_hcs08_xidx_fix' into
patch (Closes #7065, Closes #7064)
2025-07-29 08:16:11 -04:00
Ryan Kurtz
ce924f8ab5 Merge remote-tracking branch 'origin/GP-4977_DescriptorDecoderFix' 2025-07-29 10:14:27 +00:00
dragonmacher
24532a377d Minor refactor for tool closing bug in extension apps 2025-07-28 18:18:04 -04:00
caheckman
c05acfed1d Fix for testGetReturnTypeOfMethodDescriptor 2025-07-28 22:06:06 +00:00
ghidra1
1449eef894 Merge remote-tracking branch 'origin/patch' 2025-07-28 17:03:48 -04:00
ghidra1
296778319e GP-5881 Minor Structure editor event handling improvement 2025-07-28 17:01:42 -04:00
ghidra1
a63b39d14f GP-0 Added exception detail for composite resolution error 2025-07-28 14:58:31 -04:00
Ryan Kurtz
47bd5a50cb Merge remote-tracking branch
'origin/GP-5871_dev747368_dwarf_strings_charset_option' (Closes #8346)
2025-07-28 17:29:11 +00:00
Ryan Kurtz
1b7fae31f9 Merge remote-tracking branch 'origin/patch' 2025-07-28 17:28:07 +00:00
Ryan Kurtz
1486a06165 Merge remote-tracking branch
'origin/GP-5877_Dan_fixReDisassembler--SQUASHED' into patch
(Closes #8382)
2025-07-28 17:25:05 +00:00
Ryan Kurtz
b729d9b217 Merge remote-tracking branch
'origin/GP-5876-dragonmacher-vt-column-exception-patch' into patch
(Closes #8094)
2025-07-28 17:23:02 +00:00
Ryan Kurtz
538ee96e69 GP-0: Fixing javadoc (Closes #8369) 2025-07-28 15:57:42 +00:00
Ryan Kurtz
67ba8d5f6b Merge remote-tracking branch 'origin/patch' 2025-07-28 15:49:57 +00:00
Dan
39c0a83c0c GP-5877: Fix Patch Instruction action in some Harvard architectures. 2025-07-28 15:48:40 +00:00
Ryan Kurtz
60ff7c9791 Merge remote-tracking branch 'origin/GP-5867_dev747368_dwarf_only_iterate_defined_dtc' into patch 2025-07-28 15:46:50 +00:00
Dan
851264808b GP-5795: Add a "Comment" column in the "Watches" table. 2025-07-28 15:29:01 +00:00
Ryan Kurtz
598efa66d9 Merge remote-tracking branch 'origin/patch' 2025-07-28 12:44:07 +00:00
Ryan Kurtz
6f339247ef Merge remote-tracking branch
'origin/GP-5788_Dan_addActionForciblyCloseTxes--SQUASHED' into patch
(Closes #8298)
2025-07-28 12:41:31 +00:00
Ryan Kurtz
790fe71c41 Merge remote-tracking branch 'origin/GP-5553_Dan_lessTimingOut' into patch 2025-07-28 12:39:41 +00:00
Ryan Kurtz
89534eecaf Merge remote-tracking branch 'origin/patch' 2025-07-28 12:34:13 +00:00
Ryan Kurtz
35202441cc Merge remote-tracking branch
'origin/GP-5764_ghidra007_rttiscript_vfunctions_dont_force_thiscalls--SQUASHED'
into patch (Closes #8163)
2025-07-28 12:32:06 +00:00
Dan
1ad0a0f719 GP-5788: Add an action to forcibly close all transactions for a target (in case of back-end misbehavior) 2025-07-28 12:31:48 +00:00
Ryan Kurtz
bfb28de7d8 Merge remote-tracking branch
'origin/GP-5875_dragonmacher_PR-8375_neuromancer_patch-1' (Closes #8375)
2025-07-28 12:21:54 +00:00
Ryan Kurtz
c7f0253ac0 Merge remote-tracking branch 'origin/GP-5874_ghizard_PDB_CPP_fix_months_old_regression_in_assigning_vxt_types' 2025-07-28 12:19:38 +00:00
dragonmacher
0286fb59fa GP-5876 - Fixed table column exception seen when using Version Tracking 2025-07-25 19:29:07 -04:00
dragonmacher
ae5ecfc3fd Fixed import 2025-07-25 18:56:59 -04:00
neuromancer
2a8e4a54df Use L as a default shortcut for renaming symbols in symbol tree 2025-07-25 18:56:57 -04:00
ghidra007
cee04048cb GP-5764 added option to RecoverClassesFromRTTIScript enabling users to not force vfunctions to be thiscalls. 2025-07-25 22:15:27 +00:00
dragonmacher
2eca4e9d7e Fix for null context and actions that do not use action context, but
rely on managed enablement
2025-07-25 16:16:08 -04:00
Dan
9767073b32 GP-5553: Disable timing out when we have a ProgressService. 2025-07-25 19:36:55 +00:00
Ryan Kurtz
4aaf18f435 Merge remote-tracking branch
'origin/GP-3091_ghidra_ElfPowerPC64_ELFv1Fixes' (Closes #570)
2025-07-25 19:07:56 +00:00
dev747368
3aa00a125b GP-5871 add analyzer option to set charset used by DWARF importer 2025-07-25 18:32:34 +00:00
ghidra1
4a0e95ecd3 GP-3091 ppc64 ELF improvements for 32-bit addressing. Fixed default ELF
GOT markup boundary condition.  Fixed improper EXTERNAL symbols with
.pltgot. prefix and duplication.
2025-07-25 14:19:18 -04:00
ghizard
c1dbadade8 GP-5874 - PDB CPP - Fix month's old regression in assigning vxt types;
add tests to prevent further regression
2025-07-25 11:34:52 -04:00
Ryan Kurtz
a67720f028 Merge remote-tracking branch 'origin/patch' 2025-07-25 09:55:12 -04:00
Ryan Kurtz
c56d41a353 Merge remote-tracking branch 'origin/GP-5865_emteere_MultiWordReferenceDialogFix' into patch 2025-07-25 09:43:52 -04:00
Ryan Kurtz
7e6c01f283 Merge remote-tracking branch 'origin/patch' 2025-07-24 14:36:22 -04:00
Ryan Kurtz
0e5c95dfc2 Merge remote-tracking branch
'origin/GP-5361_James_code_compare_exception_fix' into patch
(Closes #7028, Closes #8125, Closes #8289)
2025-07-24 14:27:51 -04:00
Ryan Kurtz
1724227c31 Merge remote-tracking branch 'origin/patch' 2025-07-24 12:20:20 -04:00
Ryan Kurtz
4c8b9761fe Merge remote-tracking branch 'origin/GP-0_Dan_addTestDiagnostics' into patch 2025-07-24 12:14:20 -04:00
Ryan Kurtz
62946ffde9 Merge remote-tracking branch 'origin/GP-0_Dan_fixTests-2025-07-24-1' into patch 2025-07-24 12:13:04 -04:00
Dan
dcbfa2aa79 GP-0: Print LLDB output in case of test failure. 2025-07-24 14:43:28 +00:00
Dan
6ce2361da5 GP-0: Fix tests due to swing invocations off-thread. 2025-07-24 13:42:36 +00:00
Ryan Kurtz
66cecdf954 Merge remote-tracking branch 'origin/GP-5863_FixLanedParameters' 2025-07-24 06:33:32 -04:00
Ryan Kurtz
0348223d62 Merge remote-tracking branch
'origin/GP-5866_caheckman_PR-4864_astrelsky_renameglobal' (Closes #4864,
Closes #8121)
2025-07-24 06:27:14 -04:00
Ryan Kurtz
67943324c3 Merge remote-tracking branch 'origin/patch' 2025-07-24 06:21:59 -04:00
James
fc4b780025 GP-5736 prevent constant propagation from making RETURN inputs constant
(Closes #8183)
2025-07-24 06:18:30 -04:00
Ryan Kurtz
e28df99d96 Merge remote-tracking branch 'origin/GP-5789_Dan_fixModulesWithOneZeroLengthSection' into patch 2025-07-24 06:14:59 -04:00
dev747368
b6de7df726 GP-5867 dwarf: only iterate struct's defined fields
Iterating all fields (defined and undefined) could cause large memory
allocation for the result of Structure.getComponents(), plus iterating
undefined fields was unnecessary.
2025-07-23 22:03:41 +00:00
Andrew Strelsky
01f5972757 Fixed renaming global through offcut reference 2025-07-23 21:41:48 +00:00
dragonmacher
c99faccdd9 Fixed broken color chooser history 2025-07-23 17:34:54 -04:00
emteere
0744141b15 GP-5865 Add reference dialog fix for address spaces that have a wordsize
greater than one byte
2025-07-23 20:03:01 +00:00
Dan
92708efe40 GP-5789: Handle case where module appears to have zero length. 2025-07-23 17:33:48 +00:00
caheckman
cc0203307d GP-5863 Check for input intersection before creating unreferenced param 2025-07-23 17:31:18 +00:00
Ryan Kurtz
e355d86144 Merge remote-tracking branch 'origin/GP-0_Dan_cleanupLocationTracking' 2025-07-23 09:34:00 -04:00
Ryan Kurtz
e7f495010e Merge remote-tracking branch 'origin/patch' 2025-07-23 06:14:48 -04:00
Ryan Kurtz
d11c1c6c17 Merge remote-tracking branch
'origin/GP-5861_ghizard_PDB_and_Demangler_and_DTUtils_fix_truncated_symbol_processing'
into patch (Closes #8358)
2025-07-23 06:08:20 -04:00
ghizard
1684aaf61f GP-5861 - PDB, MDMang, and DTUtils optim - fix for processing of
truncated symbols and optional prefix on MDMang datatype demangling
2025-07-22 16:27:14 -04:00
James
49d848ad5a GP-5361 fix indexoutofboundsexception in decompiler code comparison 2025-07-22 19:48:19 +00:00
Ryan Kurtz
a3422f6fbe Merge remote-tracking branch 'origin/patch' 2025-07-22 14:38:22 -04:00
Ryan Kurtz
b17d58ce18 Merge remote-tracking branch 'origin/GP-5859_Dan_fixPatchDataAction' into patch 2025-07-22 14:34:43 -04:00
Dan
f79a1a2816 GP-5859: Both enablement and pop-up of Patch Data controlled by unit type 2025-07-22 14:29:50 +00:00
Dan
9b66589b00 GP-0: Some cleanup. Squelch errors from closing Trace. 2025-07-22 14:07:56 +00:00
Ryan Kurtz
a6a738f650 Merge remote-tracking branch 'origin/patch' 2025-07-22 06:12:42 -04:00
Ryan Kurtz
20643f0c31 Merge remote-tracking branch 'origin/GP-5856_RulePtrsubUndoInfiniteLoop'
into patch (Closes #7997)
2025-07-22 06:09:35 -04:00
Ryan Kurtz
a74ad243da Merge remote-tracking branch
'origin/GP-5852_Dan_fixStackTraceWithTrackWatchOnToolRestore' into patch
(Closes #8333)
2025-07-22 06:07:53 -04:00
caheckman
c4c7aa5dad Fix for infinite loop caused by RulePtrsubUndo 2025-07-21 19:40:05 +00:00
Dan
07105dbc33 GP-5852: Force saved tracking config to be an option. 2025-07-21 19:30:36 +00:00
Ryan Kurtz
6077b55dd5 Merge remote-tracking branch 'origin/GP-5829_ghintern_emulator_quantize_flag' 2025-07-21 13:26:09 -04:00
Ryan Kurtz
2bb237e8d0 Merge remote-tracking branch
'origin/GP-5819-dragonmacher-help-build-update--SQUASHED' (Closes #8320)
2025-07-21 13:23:15 -04:00
Ryan Kurtz
0ddd0d7533 Merge remote-tracking branch 'origin/GP-5818_Dan_fixTaintEmuTests' 2025-07-21 13:19:33 -04:00
Ryan Kurtz
cc177afc8f Merge remote-tracking branch 'origin/patch' 2025-07-21 13:17:27 -04:00
Ryan Kurtz
3cfa867ac3 Merge remote-tracking branch 'origin/GP-5843_emteere_MIPS64FunctionStarts' into patch 2025-07-21 13:14:06 -04:00
Ryan Kurtz
440867a776 Merge remote-tracking branch 'origin/GP-5833_emteere_MIPSInfiniteLoop' into patch 2025-07-21 13:11:39 -04:00
dragonmacher
17c28209ef GP-5819 - Help - Added validation code to check all Ghidra TOC files after help is built 2025-07-21 11:59:01 -04:00
Dan
ea6b8b0a67 GP-5818: Fix TracePropertyMapSpace for object mode. Fix TaintEmu tests. 2025-07-21 15:50:46 +00:00
Ryan Kurtz
f71ad662d1 GP-0: Adding "gradle clean" to DevGuide.md 2025-07-21 07:04:14 -04:00
Ryan Kurtz
32782037a9 Merge remote-tracking branch
'origin/GP-5834_dev747368_dwarfline_sourcefile_iterate' (Closes #8329)
2025-07-21 06:11:19 -04:00
Ryan Kurtz
8537164d80 Merge remote-tracking branch 'origin/GP-0_dev747368_fix_fsb_tests' 2025-07-18 15:22:31 -04:00
Ryan Kurtz
9628d10220 Merge remote-tracking branch 'origin/patch' 2025-07-18 15:21:52 -04:00
Ryan Kurtz
db6b52b10f Merge remote-tracking branch 'origin/GP-5832_InlineOpTarget' into patch
(Closes #7383)
2025-07-18 15:19:54 -04:00
Ryan Kurtz
edf42d82d9 Merge remote-tracking branch 'origin/GP-5846_ghidra1_PPC64_ELFRelocations' into patch 2025-07-18 15:17:45 -04:00
dev747368
a8b604647e GP-0 fix FSB tests and the 'list mounted' feature. 2025-07-18 19:13:40 +00:00
ghidra1
006bd8d423 GP-5846 Corrected ELF PowerPC 64-bit relocation processing bugs
affecting ELFv2 use and R_PPC64_JMP_SLOT relocation
2025-07-18 12:00:34 -04:00
Ryan Kurtz
b643c1319d GP-0: Updating WhatsNew 2025-07-18 08:22:10 -04:00
Ryan Kurtz
2ec1995ce1 Merge remote-tracking branch 'origin/patch' 2025-07-18 08:18:53 -04:00
Ryan Kurtz
5d66a34a5f GP-5820: Enabling gradle for VSCode projects (Closes #8322) 2025-07-18 08:14:23 -04:00
Ryan Kurtz
fde33a5821 Merge remote-tracking branch 'origin/patch' 2025-07-18 06:19:25 -04:00
Ryan Kurtz
374c7e33cd Merge remote-tracking branch 'origin/GP-5752_emteere_InstSeparatorFix--SQUASHED' into patch 2025-07-18 06:16:42 -04:00
Ryan Kurtz
e69ce4104b Merge remote-tracking branch 'origin/GP-5804_emteere_FixDefaultSymbolicPropRecordState' into patch 2025-07-18 06:15:13 -04:00
emteere
3468c4b502 GP-5843 Added MIPS64 function start patterns 2025-07-17 22:42:00 +00:00
emteere
8839bd365e GP-5833 Fixed possible inifinite loop during constant analysis on mips
platforms.
2025-07-17 20:31:08 +00:00
emteere
9979a6f9ec GP-5752 Fixed missing characters at the end of operands, for example closing parenthesis added in the base sleigh instruction constructor. 2025-07-17 15:49:39 -04:00
dev747368
20c8d97c85 GP-5834 fix DWARF file / line issue
remove access to dwarfline file count because it encourages callers to
try to iterate via index, which is not something they should do.
2025-07-17 18:30:59 +00:00
Ryan Kurtz
12a8db6195 Merge remote-tracking branch 'origin/GP-5825_dev747368_refactor_localfilesystemsub_out' 2025-07-17 13:50:47 -04:00
dev747368
4e5b223145 GP-5825 refactor FSB file system logic for subtrees 2025-07-17 17:49:14 +00:00
Ryan Kurtz
1a1cdefc14 Merge remote-tracking branch 'origin/GP-5830_ghidra1_ProjectDataTableUpdates--SQUASHED' 2025-07-17 11:07:15 -04:00
ghidra1
25dda1300a GP-5830 Corrected Project Data Table update issues 2025-07-17 10:38:10 -04:00
Ryan Kurtz
f0d774c31f Merge remote-tracking branch 'origin/patch' 2025-07-17 09:27:25 -04:00
Ryan Kurtz
48f1bf133f Merge branch 'GP-5836_ryanmkurtz_ghidradev' into patch 2025-07-17 09:24:22 -04:00
Ryan Kurtz
396dd6e1de GP-5836: Fixed GhidraDev bug that prevented Ghidra from discovering the
Ghidra module project when launched with the PyGhidra run config
2025-07-17 08:52:48 -04:00
Ryan Kurtz
88bfdeb429 Merge remote-tracking branch 'origin/GP-4356_ghintern_avr8_cspec--SQUASHED' 2025-07-17 06:19:47 -04:00
ghintern
991a4b440c GP-4356: fixes to avr8 cspec and elf extension, and additions to decompiler model rules 2025-07-16 20:22:28 +00:00
caheckman
80d66023a9 GP-5832 Update inline target op when inlining a subfunction 2025-07-16 19:12:27 +00:00
Ryan Kurtz
2c10392a79 Merge remote-tracking branch 'origin/GP-5211_ghintern_riscv_cspec--SQUASHED' 2025-07-16 13:31:25 -04:00
ghintern
f26d36c6bb GP-5211: Fix RISCV 32- and 64-bit compiler specifications and relocation handler 2025-07-16 16:38:27 +00:00
Ryan Kurtz
bbdb084d0c Merge remote-tracking branch 'origin/GP-1-dragonmacher-front-end-new-folder-fix' 2025-07-16 12:29:36 -04:00
dragonmacher
889d2ace20 Fix for creating a new folder with no node selected 2025-07-16 11:55:42 -04:00
ghintern
4bc44fc943 GP-5829: respect emulator quantize flag for addressing 2025-07-16 15:14:59 +00:00
Ryan Kurtz
bdfe4ba492 Merge remote-tracking branch
'origin/GP-5815_ghidra1_AARCH64_ElfGotRelocs' (Closes #8253)
2025-07-16 06:15:58 -04:00
Ryan Kurtz
cb762ea71e Merge remote-tracking branch 'origin/GP-1-dragonmacher-graph-help' 2025-07-16 06:14:37 -04:00
Ryan Kurtz
eb53319b24 Merge remote-tracking branch 'origin/GP-1-dragonmacher-decomp-esc-clear-selection--SQUASHED' 2025-07-16 06:13:48 -04:00
Ryan Kurtz
eac74e404c Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-7-15-25' 2025-07-16 06:12:38 -04:00
ghidra1
17827592d4 Merge remote-tracking branch 'origin/patch' 2025-07-15 18:30:48 -04:00
ghidra1
0bd8870da3 Merge branch 'GP-5827_ghidra1_ElfMips64RelocationProcessing' into patch 2025-07-15 18:28:19 -04:00
ghidra1
130b365e7c GP-5827 Corrected ELF MIPS 64-bit relocation processing error 2025-07-15 18:27:41 -04:00
dragonmacher
c94d44fe1d Fixed missing graph help 2025-07-15 16:23:57 -04:00
dragonmacher
5345960ac1 Updated the Clear Selection action to work in the Decompiler
Fixes #7241
2025-07-15 15:35:53 -04:00
dragonmacher
0071ebe96b Test fixes 2025-07-15 15:21:33 -04:00
Ryan Kurtz
4992417aaa Merge remote-tracking branch 'origin/patch' 2025-07-15 11:09:31 -04:00
Ryan Kurtz
f011cbd324 Merge remote-tracking branch
'origin/GP-5828-dragonmacher-extensions-dialog-action-enablement' into
patch (#8294)
2025-07-15 11:07:00 -04:00
Ryan Kurtz
cc0efeb5dc Merge remote-tracking branch
'origin/GP-5821-dragonmacher-tab-ordering-issue--SQUASHED'
(Closes #8303)
2025-07-15 11:00:26 -04:00
Ryan Kurtz
4d6bb0ddaa Merge remote-tracking branch 'origin/GP-5826-dragonmacher-symbol-tree-flickering' 2025-07-15 10:58:40 -04:00
Ryan Kurtz
295f71472a GP-5637: The ghidra_script() function now accepts an optional
"script_args" parameter
2025-07-15 07:40:07 -04:00
dragonmacher
5b3f4e9e90 Fixed the Install Extensions dialog toolbar action enablement 2025-07-14 19:45:16 -04:00
dragonmacher
5a631afc45 GP-5821 - Fixed bug that caused incorrect tab to be selected when closing docked component provider tabs via the 'x' button 2025-07-14 16:37:26 -04:00
Ryan Kurtz
7d26a65e31 Merge remote-tracking branch 'origin/patch' 2025-07-14 16:11:33 -04:00
Ryan Kurtz
9ddc746e6f Merge remote-tracking branch 'origin/GP-5718_LeftShiftSubvar' into patch 2025-07-14 16:09:18 -04:00
Ryan Kurtz
7d76ab5e9b Merge remote-tracking branch
'origin/GP-4989_ghintern_arm_fix_aapcs--SQUASHED' into patch
(Closes #6958)
2025-07-14 16:05:48 -04:00
Ryan Kurtz
6a77dc88b4 Merge remote-tracking branch 'origin/GP-4977_DecompileJVMArrays' 2025-07-14 16:03:07 -04:00
caheckman
14870dc532 GP-4977 Properly decode <object> in Array 2025-07-14 18:49:05 +00:00
ghintern
3e11715778 GP-4989: Fix ARM AAPCS cspec, add soft float calling convention 2025-07-14 18:38:17 +00:00
Ryan Kurtz
5acdc3b522 Merge remote-tracking branch 'origin/GP-5367_ghintern_aggregate_filter--SQUASHED' 2025-07-14 14:06:30 -04:00
ghintern
3067d3e61f GP-5367: Filter by max_primitives on homogeneous aggregate types in cspec 2025-07-14 17:21:02 +00:00
ghidra007
b3f4609330 GP-5718 fix for index issue 2025-07-14 15:17:49 +00:00
ghidra1
a3897c04ac GP-0 Corrected test failure 2025-07-14 10:55:25 -04:00
dragonmacher
95fd25eb58 GP-5826 - Symbol Tree - Fixed flashing due to too many events being
processed
2025-07-12 14:19:48 -04:00
ghidra1
438725bafd GP-5815 Added ELF Loader GOT allocation support for AARCH64 in support
of object module loading.
2025-07-11 16:17:19 -04:00
ghidra1
8c56fc8e04 GP-1 Assume \u2192 right arrow char will always render properly 2025-07-11 12:22:48 -04:00
Ryan Kurtz
c7aa190b40 Merge remote-tracking branch 'origin/GP-1-dragonmacher-function-color-fix--SQUASHED' 2025-07-11 11:58:14 -04:00
Ryan Kurtz
f3d4ccbf2f Merge remote-tracking branch
'origin/GP-5646_ghidragon_drag_n_drop_program_tabs--SQUASHED'
(Closes #8099)
2025-07-11 11:56:26 -04:00
Ryan Kurtz
e63d97b112 Merge remote-tracking branch 'origin/patch' 2025-07-11 11:53:12 -04:00
Ryan Kurtz
5ae62e2f49 Merge remote-tracking branch 'origin/GP-5822_ghidra1_CommentTypeErrors'
into patch (Closes #8341)
2025-07-11 11:46:15 -04:00
ghidragon
99992cf550 GP-5646 reorder program tabs via drag-N-drop
tmp
2025-07-11 11:37:40 -04:00
ghidra1
c56d6fd26e GP-1 Updated link arrow character used 2025-07-11 10:00:47 -04:00
ghidra1
183ecf3acf GP-5822 Corrected errors related to null CommentType returned by
CommentFieldLocation
2025-07-11 09:08:21 -04:00
Ryan Kurtz
d3c021119c GP-0: Fixing gradle warning 2025-07-11 07:14:04 -04:00
Ryan Kurtz
529b174764 GP-0: Fixing javadoc errors 2025-07-11 07:07:48 -04:00
Ryan Kurtz
cb68d29bac GP-5637: Fixing PyGhidra usage of DomainFileIterator 2025-07-11 06:58:18 -04:00
dragonmacher
c538b0def6 Updated broken color usage for function references and parameter references 2025-07-10 17:09:20 -04:00
Ryan Kurtz
70b062e6d0 Merge remote-tracking branch 'origin/GP-5637_ryanmkurtz_pyghidra-api'
(Closes #6914, Closes #6915)
2025-07-10 14:47:29 -04:00
ghidra1
8938cc3478 GP-1 Always use BadDataType.datatype instance 2025-07-10 12:04:29 -04:00
Ryan Kurtz
f5fd0171a2 GP-5637: New PyGhidra API 2025-07-10 11:42:46 -04:00
Ryan Kurtz
894e65589a Merge remote-tracking branch 'origin/GP-1-dragonmacher-added-missing-theme-file' 2025-07-10 10:01:04 -04:00
Ryan Kurtz
1b74b8eb9b Merge remote-tracking branch 'origin/GP-4007_ghintern_codecompare_actions--SQUASHED' 2025-07-10 09:58:55 -04:00
ghintern
e72e58117f GP-4007: Add actions to transfer variable and callee names and types to dual decompiler view 2025-07-10 13:54:27 +00:00
Ryan Kurtz
f97fd834fe Merge remote-tracking branch 'origin/patch' 2025-07-10 05:39:35 -04:00
Ryan Kurtz
3ad921d5c7 Merge remote-tracking branch 'origin/GP-5816_ReturnValueRecovery' into patch 2025-07-10 05:35:35 -04:00
Ryan Kurtz
2e3f37f803 Merge remote-tracking branch 'origin/GP-0_d-millar_junit_fix' 2025-07-10 05:30:31 -04:00
ghidra1
3f638e22b4 GP-1 Disable replace action for BadDataType 2025-07-09 19:10:22 -04:00
dragonmacher
d0f08f7460 Added missing theme file 2025-07-09 19:08:14 -04:00
ghidra1
f250cfeac4 GP-1 Corrected treatment of BadDataType within DataTypeManagerDB 2025-07-09 18:55:42 -04:00
d-millar
96d4edf39b GP-0: fix for test failures 2025-07-09 22:10:38 +00:00
caheckman
de842dbd32 GP-5816 Fix return recovery for AARCH64 and ARM 2025-07-09 21:19:07 +00:00
Ryan Kurtz
413949b64a GP-0: Bumping master to 12.0 2025-07-09 14:50:25 -04:00
ghidra1
53552616ec Merge branch 'GP-3551_ghidra1_InternalProjectLinks' 2025-07-09 13:34:56 -04:00
ghidra1
1aa7b089c0 GP-3551 Added support for internal project link-files with improved link
support within project data tree. Linked-folders are now supported.
Addressed link-support issues related to various actions.  Revised
link-file storage to use smaller non-DB storage. This change does impact
the Ghidra Server.
2025-07-09 13:34:22 -04:00
Ryan Kurtz
794cb1c07c Merge remote-tracking branch 'origin/GP-4310_ghida1_RGB_DataTypes'
(Closes #6191)
2025-07-09 12:33:05 -04:00
Ryan Kurtz
60d0883b10 GP-0: Adding a ProgramLoader.Builder.loaders(String) method 2025-07-09 11:37:06 -04:00
ghidra1
23711ac652 GP-4310 Added RGB Color Data Types 2025-07-09 10:30:50 -04:00
Ryan Kurtz
e28509c2ea GP-0: Handling ProgramLoader.Builder.source(byte[]) a little better 2025-07-08 14:16:00 -04:00
Ryan Kurtz
b2e11d5312 Merge remote-tracking branch 'origin/GP-4741-dragonmacher-graph-size-fix--SQUASHED' 2025-07-08 06:05:22 -04:00
dragonmacher
4cab37febd GP-4741 - Graphing - Fixed odd size issues on Class graphs 2025-07-07 12:32:12 -04:00
Ryan Kurtz
d58f2ad24c Merge remote-tracking branch 'origin/patch' 2025-07-07 12:25:55 -04:00
Ryan Kurtz
bf167a3126 GP-5810: Improving CWD removal from sys.path 2025-07-07 12:23:55 -04:00
Ryan Kurtz
fe335aa946 Merge remote-tracking branch 'origin/patch' 2025-07-07 11:40:02 -04:00
Ryan Kurtz
2930b622cc GP-5810: Removing CWD from PyGhidra's sys.path (Closes #8190) 2025-07-07 11:35:57 -04:00
Nicolas Iooss
e2de11d5b2
Fix eBPF zero-extend load instructions
When a loading less than 8 bytes to a register, the value is supposed to
be zero-extended. This is what the eBPF execution engine in the Linux
kernel does, in
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/core.c?h=v6.14#n2113
This is also what is specified in RFC 9669 which standardised BPF ISA:
https://www.rfc-editor.org/rfc/rfc9669.html#name-regular-load-and-store-oper

Add the missing `zext` calls in the semantic section of instructions
LDXW, LDXH and LDXB. While at it, add them to other load instructions.

For information, the issue can be seen when analyzing this C program:

    unsigned int div_by_1000(unsigned int value) {
        return value / 1000;
    }

Compiling it with clang gives:

    $ clang -O0 -target bpf -c division.c -o division.ebpf
    $ bpf-objdump -rd division.ebpf
    division.ebpf:     file format elf64-bpfle

    Disassembly of section .text:

    0000000000000000 <div_by_1000>:
       0:    63 1a fc ff 00 00 00 00     stxw [%fp+-4],%r1
       8:    61 a0 fc ff 00 00 00 00     ldxw %r0,[%fp+-4]
      10:    37 00 00 00 e8 03 00 00     div %r0,0x3e8
      18:    95 00 00 00 00 00 00 00     exit

Ghidra decompiles this program as:

    ulonglong div_by_1000(uint param_1)
    {
      undefined4 in_stack_00000000;
      return CONCAT44(in_stack_00000000,param_1) / 1000;
    }

This `in_stack_00000000` comes from the way the parameter is loaded from
the stack. The listing shows the following disassembly and p-code
operations:

    ram:00100008 61 a0 fc ff 00       LDXW       R0,[R10 + -0x4=>Stack[-0x4]]
                 00 00 00
                            $U3e00:8 = INT_ADD R10, -4:8
                            R0 = LOAD ram($U3e00:8)

This shows the value is indeed loaded from 8 bytes at `$U3e00:8` instead
of 4.

After adding `zext` calls, Ghidra decodes the same instruction as:

    ram:00100008 61 a0 fc ff 00       LDXW       R0,[R10 + -0x4=>local_4]
                 00 00 00
                            $U4100:8 = INT_ADD R10, -4:8
                            $U4180:4 = LOAD ram($U4100:8)
                            R0 = INT_ZEXT $U4180:4

This only loads 4 bytes from the stack, as expected.
Moreover the decompilation view is now correct:

    ulonglong div_by_1000(uint param_1)
    {
      return (ulonglong)param_1 / 1000;
    }
2025-07-07 16:28:00 +02:00
Nicolas Iooss
c1d96a2140
Fix eBPF CALL operand decoding
The operand of the CALL instruction missed multiplying the immediate
value by 8. Without this, calls are not decoded correctly.

Such a CALL instruction can be emitted when compiling this simple
`single_call.c` program:

    static int one(void) {
        return 1;
    }

    int call_one(void) {
        return one();
    }

with:

    clang -O0 -target bpf -c single_call.c -o single_call.ebpf

Disassembling with LLVM shows:

    $ llvm-objdump -d single_call.ebpf
    single_call.ebpf:	file format elf64-bpf

    Disassembly of section .text:

    0000000000000000 <call_one>:
           0:	85 10 00 00 01 00 00 00	call 1
           1:	95 00 00 00 00 00 00 00	exit

    0000000000000010 <one>:
           2:	b7 00 00 00 01 00 00 00	r0 = 1
           3:	95 00 00 00 00 00 00 00	exit

The first instruction ("call 1") calls the function located at 0x10 (at
index `2:` in the listing). Ghidra considered the call to target
address 9 instead (as `inst_next = 8` and `imm = 1`). Fix this by
multiplying `imm` by 8 when encountering a `disp32` operand (which is
only used by instruction `CALL`).

Adjust ELF Relocation R_BPF_64_32 to take into account for this
multiplication by 8. Actually it is documented to compute (S + A) / 8 - 1
so the division by 8 was missing.
2025-07-07 16:26:31 +02:00
Ryan Kurtz
c0140fd396 Merge remote-tracking branch 'origin/patch' 2025-07-07 10:20:25 -04:00
Ryan Kurtz
2aa431a904 GP-5811: PE IMAGE_FUNCTION_RUNTIME_ENTRY's are now all marked as
functions (Closes #8321)
2025-07-07 10:17:49 -04:00
Nicolas Iooss
adb0eac98a
Add support for big endian eBPF programs 2025-07-07 16:13:37 +02:00
Nicolas Iooss
52cb7a36e6
Fix the semantics of eBPF byte swap instructions
eBPF byte swap operations (BE16, BE32, BE64, LE16, LE32, LE64) have
semantics that depend on the endianness of the host processor executing
the eBPF program. For example, on a Little-Endian CPU, BE16 swaps the 2
lowest significant bytes of the given destination register.

The semantic section of LE16 contains:

    { dst=((dst) >> 8) | ((dst) << 8); }

This contains several issues:

- It assumes the instruction always swaps the bytes. This should only
  happen on Big-Endian host CPU.
- If `dst` does not contain a 16-bit value (meaning `dst >> 16 != 0`),
  the computed value is wrong. The value should be properly masked. For
  example the Linux kernel defines in
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/swab.h?h=v6.14#L14

    #define ___constant_swab16(x) ((__u16)(             \
            (((__u16)(x) & (__u16)0x00ffU) << 8) |      \
            (((__u16)(x) & (__u16)0xff00U) >> 8)))

As the endianness of the CPU has to be the same as the eBPF program
(defined in the ELF header), introduce a macro `ENDIAN` and use it to
implement the byte swap operations.
2025-07-07 16:13:36 +02:00
Ryan Kurtz
66f48fe95b GP-5545_5600: ProgramLoader.Builder can now take a string-based source 2025-07-07 06:45:18 -04:00
Ryan Kurtz
d4758498ac Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_z3' 2025-07-07 06:14:01 -04:00
Ryan Kurtz
245c52b8c6 Merge remote-tracking branch 'origin/GP-0_ghidragon_fixing_data_graphTest_to_dispose_env' 2025-07-03 14:00:20 -04:00
emteere
4723729d80 GP-5804 Set SymbolicPropogator to record register begin/end state in
basic constructor. Better document recordBeginEndState flag.
2025-07-03 17:49:53 +00:00
ghidragon
03428cc125 GP-0 fixing data graph tests 2025-07-03 13:24:01 -04:00
Ryan Kurtz
b6968e26c5 GP-0: z3 dependency improvements 2025-07-03 12:10:52 -04:00
Ryan Kurtz
9018e9a05a Merge remote-tracking branch
'origin/GP-5800_Dan_fixAsmDbgSlowdown--SQUASHED' (Closes #8308,
Closes #8309)
2025-07-03 09:27:17 -04:00
Ryan Kurtz
28ca8302ba Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-07-03-1' 2025-07-03 09:23:20 -04:00
Dan
0e3beed22a GP-5800: Delete asm debug logging altogether 2025-07-03 13:23:17 +00:00
Dan
980a80beb9 GP-0: Fix event thread recording (found in Z3 test) 2025-07-03 12:27:58 +00:00
Ryan Kurtz
3e50533187 Merge remote-tracking branch
'origin/GP-5481_ghidragon_data_graph--SQUASHED'
2025-07-03 06:40:25 -04:00
Ryan Kurtz
2442bfc2bb Merge remote-tracking branch 'origin/GP-5700_Dan_reworkLauncherGhidraHome--SQUASHED' 2025-07-03 06:21:08 -04:00
Ryan Kurtz
4df861c656 Merge remote-tracking branch 'origin/patch' 2025-07-03 06:20:34 -04:00
Ryan Kurtz
7e1b6e9cd5 Merge remote-tracking branch 'origin/GP-5799_Dan_FixNPEInExample' into
patch (Closes #8296)
2025-07-03 06:18:13 -04:00
Ryan Kurtz
a41ad68289 Merge remote-tracking branch 'origin/GP-5790_Dan_fixNPEWhenCursorOutsideModule' into patch 2025-07-03 06:17:00 -04:00
Ryan Kurtz
f3a90f7887 Merge remote-tracking branch 'origin/GP-5796_Dan_setEmuEventThread' into
patch (Closes #8293)
2025-07-03 06:15:29 -04:00
Dan
f92076b936 GP-5700: Expose module directories to scripts on request 2025-07-02 19:15:54 +00:00
Ryan Kurtz
a09bd1ee34 Merge remote-tracking branch
'origin/GP-0_Dan_makeZ3AnExtension--SQUASHED'
2025-07-02 13:49:03 -04:00
ghidragon
f54bd20d40 GP-5481 Created prototype data graph feature 2025-07-02 13:20:47 -04:00
Dan
13c71e809a GP-0: Change SymbolicSummaryZ3 to be an extension. 2025-07-02 17:04:12 +00:00
Ryan Kurtz
9876a4bfe5 Merge remote-tracking branch 'origin/GP-0_Dan_fixZ3Tests' 2025-07-02 12:57:49 -04:00
Ryan Kurtz
5dcd35ca6f Merge remote-tracking branch 'origin/patch' 2025-07-02 12:55:50 -04:00
Ryan Kurtz
c7efb3c5cf GP-5545-5600: Fixing headless regression 2025-07-02 12:55:19 -04:00
Dan
e93bc62749 GP-0: Fix Z3 tests. 2025-07-02 15:57:17 +00:00
Ryan Kurtz
d16bf27873 GP-5802: Fixed a timing issue that prevented
FlatProgramAPI.analyzeAll(Program) from picking up analyzer options set
in the script (Closes #8287)
2025-07-02 09:24:19 -04:00
Ryan Kurtz
90c85a7761 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-7-2-25' into patch 2025-07-02 09:16:27 -04:00
dragonmacher
2394103ea5 Test fixes 2025-07-02 09:10:57 -04:00
Dan
f74b783b3e GP-5796: Write event thread down in emulated snapshots. 2025-07-01 18:15:47 +00:00
Dan
044bd03ccb GP-5790: Fix NPE on "Select Current Module" when cursor is not in a module. 2025-07-01 17:57:15 +00:00
Dan
6e27a9faa2 GP-5799: Improve example InstallCustomLibraryScript and fix NPE. 2025-07-01 17:52:26 +00:00
Ryan Kurtz
c9299a7fc7 Merge remote-tracking branch 'origin/GP-5798_dev747368_dwarf_composite_packing_fix' 2025-07-01 13:22:36 -04:00
Ryan Kurtz
409d320057 Merge remote-tracking branch 'origin/GP-5726_dev747368_absolute_symlink_paths' 2025-07-01 11:32:01 -04:00
Ryan Kurtz
ca8a5d9d0f GP-0: Fixing javadoc 2025-07-01 11:20:54 -04:00
dev747368
b6fcd6b536 GP-5798 fix issue in DWARF struct/union packing logic
If struct was sized, but had no defined fields, the check meant to
detect this and avoid packing was incorrect, and packed anyway.
2025-07-01 15:11:02 +00:00
Ryan Kurtz
fdf3676cc5 GP-5727: Fixing hashes 2025-07-01 11:02:50 -04:00
Ryan Kurtz
b534a494c3 GP-5727: Fixing build 2025-07-01 10:50:00 -04:00
Ryan Kurtz
a8655234a4 Merge remote-tracking branch
'origin/GP-5545-5600_ryanmkurtz_autoimporter--SQUASHED' (Closes #8097)
2025-07-01 08:27:37 -04:00
Ryan Kurtz
d3aed2c4b3 GP-5545_5600: ProgramLoader and more flexible loader args 2025-07-01 08:18:36 -04:00
ghidra1
3aff1293bc Merge remote-tracking branch
'origin/GP-5748_ghidracadabra_PR-8176_gemesa_bsim-getmetadata'
(Closes #8176)
2025-06-30 14:42:22 -04:00
ghidra1
caff8b2264 Merge remote-tracking branch 'origin/patch' 2025-06-30 14:40:03 -04:00
ghidra1
2727715539 GP-5797 Corrected CommentsDialog regression. Default to previously used
tab
2025-06-30 14:36:16 -04:00
ghidra1
43ac551bd2 Merge remote-tracking branch 'origin/GP-5779_Dan_cleanDeprecatedColorModel' 2025-06-30 10:08:28 -04:00
ghidra1
92540c87e0 Merge remote-tracking branch 'origin/GP-5776_ghizard_MDMang_improvements_for_16-bit_program_vcall_modiers_and_based_attributes--SQUASHED' 2025-06-30 10:07:21 -04:00
ghidra1
2c3bfe1796 Merge remote-tracking branch 'origin/GP-5775_James_view_source_file_action' 2025-06-30 10:05:57 -04:00
ghidra1
b41d97c8a9 Merge remote-tracking branch 'origin/GP-5773_James_DWARF_add_all_source_files' 2025-06-30 10:03:07 -04:00
ghidra1
211a432cdb Merge remote-tracking branch 'origin/GP-5772_Dan_finishPcodeStepper' 2025-06-30 10:00:09 -04:00
ghidra1
a483a4e28c Merge remote-tracking branch
'origin/GP-5727_Dan_z3emu--SQUASHED'
2025-06-30 09:53:44 -04:00
ghidra1
8ac6bd74ee Merge remote-tracking branch 'origin/GP-5194_Dan_removeLegacyDBTraceTables--SQUASHED' 2025-06-30 08:48:00 -04:00
ghidra1
97d2a51038 Merge remote-tracking branch 'origin/patch' 2025-06-30 08:41:12 -04:00
ghidra1
4629af7235 Merge remote-tracking branch 'origin/GP-5738_Dan_gdbArmv5te' into patch 2025-06-30 08:29:30 -04:00
ghidra1
0a07e885db Merge remote-tracking branch 'origin/GP-5767_ryanmkurtz_dyld' into patch 2025-06-30 08:24:44 -04:00
ghidra1
a613bd4972 Merge remote-tracking branch
'origin/GP-5777-dragonmacher-dialog-context-fix--SQUASHED' into patch
(Closes #8294)
2025-06-30 08:23:02 -04:00
ghidra1
39770ddee0 Merge remote-tracking branch 'origin/GP-1-dragonmacher-tool-restore-state-fix' into patch 2025-06-30 08:19:52 -04:00
ghidra1
a34a8a5206 Merge remote-tracking branch 'origin/GP-1-dragonmacher-action-exception' into patch 2025-06-30 08:19:24 -04:00
Dan
7e7c8a5e86 GP-5194: Remove Deprecated 'Legacy mode' for DBTrace. 2025-06-27 16:00:08 +00:00
Dan
cbf8579c9d GP-5738: Add armv5te to gdb connector's arch.py 2025-06-27 13:06:54 +00:00
Dan
3099cc9006 GP-5772: Mark PcodeStepperPlugin as RELEASED. 2025-06-27 12:50:29 +00:00
Dan
93d5e3db0d GP-5779: Clean out some ColorModel garbage. 2025-06-27 12:36:51 +00:00
dragonmacher
64ee7bd5a1 Fixed an exception in the enabledWhen() method of the ClearSelection
action
2025-06-26 18:33:15 -04:00
Dan
9729d240d7 GP-5727: Add Z3-based emulator and summarizer 2025-06-26 18:26:42 +00:00
dragonmacher
6b7064b1f4 GP-5777 - Fix for dialog action context 2025-06-26 13:54:21 -04:00
ghizard
cc213cdebf GP-5776 - MDMang - Improved 16-bit program demangling of vcall modifiers and based attributes 2025-06-26 06:01:32 -04:00
James
2cb73057e9 GP-5775 code review changes 2025-06-25 20:38:58 +00:00
James
988dadd7cf GP-5775 added view source file action to source file table 2025-06-25 20:32:42 +00:00
James
cd549a0805 GP-5773 DWARF: add all source files 2025-06-25 19:34:00 +00:00
dragonmacher
d88f464a32 Fixed potential NPE when restoring tool state 2025-06-24 13:16:33 -04:00
Ryan Kurtz
7482131bcc Merge remote-tracking branch 'origin/patch' 2025-06-24 12:38:45 -04:00
Ryan Kurtz
a7e64844fb GP-0: Fixing ChangeHistory typo 2025-06-24 12:30:42 -04:00
Ryan Kurtz
2d34b3afc7 GP-0: Upping patch to 11.4.1 2025-06-24 12:28:38 -04:00
Ryan Kurtz
8d95e97521 Merge remote-tracking branch
'origin/GP-1-dragonmacher-escape-selection-fix' (#7241)
2025-06-23 12:57:51 -04:00
dragonmacher
93ad4631a1 Fixed the Clear Selection action to also work for character selections 2025-06-21 11:54:48 -04:00
Ryan Kurtz
9e4e43d9f8 GP-5767: Support for iOS 26 BETA dyld_shared_cache 2025-06-20 17:05:31 -04:00
Ryan Kurtz
44938cf9f1 Merge branch 'GP-0_ryanmkurtz_PR-8274_sepalani_readme-gradlew' 2025-06-20 06:36:41 -04:00
Ryan Kurtz
bba400ee2f Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-20 06:03:45 -04:00
sepalani
bfb61bb116
Fix gradle wrapper name in README.md 2025-06-19 22:26:20 +04:00
ghidra2
aed1cf1c4e GP-0 - ChangeHistory.md for 11.4 2025-06-18 19:22:22 +00:00
Ryan Kurtz
8c48d9f116 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-6-17-25' 2025-06-18 06:24:10 -04:00
dragonmacher
a58340b810 Test fixes 2025-06-17 18:58:06 -04:00
emteere
c87e45857c GP-0 11.4 WhatsNew 2025-06-17 17:48:34 -04:00
Ryan Kurtz
69872037e5 Merge remote-tracking branch 'origin/GP-3756-dragonmacher-plate-comment-annotations' 2025-06-17 10:56:45 -04:00
Ryan Kurtz
453f8002a4 Merge remote-tracking branch
'origin/GP-5761-dragonmacher-dt-tree-collapse-update--SQUASHED'
(Closes #8244)
2025-06-17 09:08:31 -04:00
Ryan Kurtz
93fe45aff1 Merge branch 'GP-5023_ryanmkurtz_demangle' 2025-06-17 08:16:10 -04:00
Ryan Kurtz
a5c0dd9897 GP-5023: Deprecating GhidraScript.getDemangled() 2025-06-17 08:15:12 -04:00
dragonmacher
175c0153e9 GP-3756 - Fixed plate comment annotation rendering bug in tooltip 2025-06-16 18:45:41 -04:00
Ryan Kurtz
cd5e163c0a Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-16 14:39:52 -04:00
Ryan Kurtz
560497c5ff Merge remote-tracking branch 'origin/GP-5762_ghidra007_autoVT_increase_dupe_correlator_min' into Ghidra_11.4 2025-06-16 14:37:41 -04:00
dragonmacher
b07256a114 GP-5761 - Data Type Manager - Updated the Collapse button to stop any post-filter state restoring 2025-06-16 14:10:43 -04:00
Ryan Kurtz
592242fdba Merge remote-tracking branch 'origin/GP-2140-dragonmacher-delete-refs-action--SQUASHED' 2025-06-16 13:50:29 -04:00
dragonmacher
1fc7356080 GP-2140 - Xrefs - Added an action to delete xrefs from the xrefs table 2025-06-16 13:46:34 -04:00
Ryan Kurtz
c03417b3f6 GP-0: Fixing test 2025-06-16 11:59:44 -04:00
ghidra007
160dfd1e36 GP-5762 increased AutoVT duplicate inst match correlator min function
size
2025-06-16 15:49:44 +00:00
Ryan Kurtz
e1f90b72bf Merge remote-tracking branch 'origin/GP-5757_ryanmkurtz_xml-xxe' 2025-06-16 11:49:40 -04:00
ghidorahrex
997c64f6db GP-5759: Fixed token piece formatting 2025-06-16 14:29:10 +00:00
Ryan Kurtz
032e62fd76 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-16 10:15:37 -04:00
Ryan Kurtz
b0ca297a1a Merge remote-tracking branch
'origin/GP-0_update_postgres_version_in_script_comment' into Ghidra_11.4
(#8122)
2025-06-16 10:12:55 -04:00
James
79d87eb63d GP-0 fixed postgres version in make-postgres.sh comments 2025-06-16 14:08:52 +00:00
Ryan Kurtz
66f8d541ea Merge branch 'GP-0_ryanmkurtz_PR-8251_xndcn_xml' 2025-06-16 07:50:08 -04:00
Ryan Kurtz
2be860e3b0 GP-0: Certify 2025-06-16 07:48:57 -04:00
Ryan Kurtz
87a26e9cf0 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-16 06:15:07 -04:00
Ryan Kurtz
94305f2b5c Merge remote-tracking branch 'origin/GP-5695_emteere_ExceptionConstantProcessing' into Ghidra_11.4 2025-06-16 05:57:28 -04:00
emteere
2971656579 GP-5695 fixing null exception 2025-06-13 19:30:34 +00:00
Ryan Kurtz
ab849887aa Merge remote-tracking branch
'origin/GP-3952-ghidra_blue-update-script-categories--SQUASHED'
2025-06-13 12:12:47 -04:00
Ryan Kurtz
7d31a9547d Merge remote-tracking branch
'origin/GP-4473-ghidra_blue-stack-column--SQUASHED' (Closes #6330)
2025-06-13 12:07:37 -04:00
ghidra_blue
ea62161214 Added a local stack size and parameter stack size column in Window-> Functions 2025-06-13 15:56:38 +00:00
Ryan Kurtz
3c8bb490ac Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-13 11:10:20 -04:00
Ryan Kurtz
7a557c7d16 Merge remote-tracking branch
'origin/GP-0_ghidraffe_UpdateMakePostgresVersion' into Ghidra_11.4
(#8122)
2025-06-13 11:07:20 -04:00
ghidra_blue
7db176b2bd GP-3952 Updated the script categories to simplify and reduce the number of folders. 2025-06-13 15:00:15 +00:00
ghidraffe
4436bbd564 GP-0 fix incorrect version specified for postgres. 2025-06-13 14:43:14 +00:00
Ryan Kurtz
5ac69075e3 GP-0: Fixing deprecated calls to Conv 2025-06-13 09:03:48 -04:00
Ryan Kurtz
412bd0ffc1 GP-0: Fixing some warnings 2025-06-13 07:48:40 -04:00
Ryan Kurtz
3e53ea7f90 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-13 07:09:32 -04:00
Ryan Kurtz
ee0815cbd3 GP-0: Fixing javadoc warning 2025-06-13 07:06:13 -04:00
Ryan Kurtz
0052df889e Merge remote-tracking branch 'origin/GP-5712_ghidragon_gotonext_function_skip_non_memory_function--SQUASHED' 2025-06-12 14:06:28 -04:00
ghidragon
081e7222a8 GP-5712 fixing next/previous function to skip non-memory functions. 2025-06-12 13:14:03 -04:00
Ryan Kurtz
08ca670f43 GP-5757: Restricting XML external access 2025-06-12 10:39:53 -04:00
xndcn
faa9907deb Decompiler: Add .xml entension when user did not specify for DebugDecompilerAction 2025-06-12 18:05:56 +08:00
ghidra1
bca1fa5219 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-11 13:59:22 -04:00
ghidra1
ea414bd23e Merge branch 'GP-5680_ghidra1_Postgres15.13' into Ghidra_11.4
(Closes #8122)
2025-06-11 13:42:39 -04:00
ghidra1
5c8da44a33 GP-5680 Postgres upgrade to 15.13 and JDBC driver 42.7.6 2025-06-11 13:10:36 -04:00
Ryan Kurtz
82baf0aa74 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-11 12:07:08 -04:00
Ryan Kurtz
e08d05a376 Merge remote-tracking branch 'origin/GP-5622_ghidorahrex_aarch64_neon_impl--SQUASHED' into Ghidra_11.4 2025-06-11 11:51:05 -04:00
vporok01
3d54c90cd6 Fix RISC-V minu and max instructions' definitions (Closes #8215) 2025-06-11 11:47:49 -04:00
Ryan Kurtz
34402ed14e Merge remote-tracking branch 'origin/GP-5456_Dan_upgradeProtobuf--SQUASHED' 2025-06-11 08:13:45 -04:00
Ryan Kurtz
6073f01158 Merge branch 'GP-0_ryanmkurtz_PR-8240_bdemick_vxworks-symtab-improvements' 2025-06-11 08:01:50 -04:00
Ryan Kurtz
3467345cd2 GP-0: Fixing warnings 2025-06-11 08:00:21 -04:00
ghidorahrex
fe4244cbc9 GP-5622: Implemented pcode for several AARCH64 Neon instructions 2025-06-11 07:56:09 -04:00
Ryan Kurtz
22e785b1f5 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-11 06:12:50 -04:00
Ryan Kurtz
c52f4b20bf Merge remote-tracking branch 'origin/GP-5755_dev747368_fix_apple_kdk_dwarf' into Ghidra_11.4 2025-06-11 06:10:07 -04:00
Ryan Kurtz
af43036ff0 Merge remote-tracking branch 'origin/GP-1-dragonmacher-incremental-timing-fix' 2025-06-11 06:02:06 -04:00
Ryan Kurtz
1eb858dcf0 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-11 06:00:54 -04:00
Ryan Kurtz
c9fb3c5b3a Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-6-10-25' 2025-06-11 05:59:55 -04:00
dragonmacher
de22c25aa2 Fixed test failing due to being too slow 2025-06-10 17:55:42 -04:00
dev747368
e2fa4aaa7b GP-5755 Fix Apple KDK DWARF section name lookup, atomic type and source
file npe

Apple Macho binaries truncate section names to 16 chars, DWARF 5
introduced a section (debug_str_offsets) that has a name longer than 16
(along with the macho "__" prefix).

Add support for ignoring atomic_type, and some checking for missing
source file names.
2025-06-10 21:04:56 +00:00
ghidra1
5b71018f82 Merge remote-tracking branch 'origin/GP-5498_ghidra1_ExternalSymbolDB--SQUASHED' 2025-06-10 13:55:55 -04:00
ghidra1
f9a7a3d6ce GP-0 Fill out a few StubListing methods to avoid VT test stack traces 2025-06-10 13:52:10 -04:00
ghidra1
fd4370e946 GP-5498 SymbolTable V4 schema refactor 2025-06-10 13:49:26 -04:00
Ryan Kurtz
5fa1f30df9 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-10 12:46:09 -04:00
Ryan Kurtz
5ef97ee1d9 Merge remote-tracking branch 'origin/GP-5725_ghidorahrex_x86_avx512_immoper_fix--SQUASHED' into Ghidra_11.4 2025-06-10 12:43:00 -04:00
Ryan Kurtz
d4c034df15 GP-0: Fixing tests 2025-06-10 11:56:26 -04:00
Ryan Kurtz
4257433253 GP-5737: Fixing bug that caused some test failures 2025-06-10 10:10:05 -04:00
ghidorahrex
b0750c2783 GP-5725: Corrected operands for several AVX512 instructions 2025-06-10 09:21:39 -04:00
ghidra1
569519fb6c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-09 18:54:09 -04:00
ghidra1
92f2588895 GP-0 Corrected build.gradle for PA-RISC to allow pcode test execution 2025-06-09 18:53:22 -04:00
ghidra1
17d8fdfcfa GP-0 corrected PA-RISC sleigh compile option 2025-06-09 18:48:09 -04:00
dragonmacher
748d4d037f Fixed lockup in incremental load job when the latch was not counted down 2025-06-09 17:59:39 -04:00
ghidra1
2acf286046 GP-0 Corrected build.gradle for PA-RISC to allow pcode test execution 2025-06-09 15:17:05 -04:00
ghidra1
ce0839f78c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-09 14:00:35 -04:00
ghidra1
153956213f GP-5723 Revised default pointer label generation logic (Closes #8245) 2025-06-09 13:58:56 -04:00
Ryan Kurtz
1734ba7712 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-09 13:26:15 -04:00
Ryan Kurtz
283790a03e GP-0: Upping Gradle wrapper to 8.14.2 2025-06-09 13:24:27 -04:00
Ryan Kurtz
c224c5d44e Merge remote-tracking branch 'origin/GP-5737_ryanmkurtz_script-output--SQUASHED' 2025-06-09 12:20:46 -04:00
Ryan Kurtz
1add5a9bce GP-5737: Fixing GhidraScript PrintWriter 2025-06-09 12:14:58 -04:00
ghidra1
8367ac7354 GP-0 Allow SARIF module tests to run 2025-06-09 10:19:41 -04:00
ghidra1
6514e058b4 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-09 10:03:32 -04:00
ghidra1
cb3f884ef5 GP-5742 Corrected deprecation comments/annotations 2025-06-09 10:01:05 -04:00
ghidra1
f981f43fad Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-06 18:50:01 -04:00
ghidra1
e03fb9af76 Merge remote-tracking branch 'origin/GP-5742_ghidra1_CommentTypeCleanup--SQUASHED' into Ghidra_11.4 2025-06-06 18:00:36 -04:00
ghidra1
8c441250f5 GP-5742 Cleanup preferred CommentType enum use. Changed SARIF data component comment JSON serialization from int to String. 2025-06-06 17:58:07 -04:00
bdemick
fbee1cf61b Improves symbol string check, adds function to check if candidate symtable is just a string pointer table 2025-06-06 16:13:26 -04:00
Ryan Kurtz
5b0cac73c4 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-06 14:31:03 -04:00
Paul Hordiienko
700a06e897 Fixing analysis fail with function entryPoint may not be created on
defined data error (Closes #8238)
2025-06-06 14:28:41 -04:00
Ryan Kurtz
1b8faba952 Merge remote-tracking branch 'origin/GP-5740-dragonmacher-dtm-chooser-dialog-fix' 2025-06-06 13:52:47 -04:00
Ryan Kurtz
9d527d7859 Merge remote-tracking branch 'origin/GP-5645_ryanmkurtz_coff--SQUASHED'
(Closes #1398, Closes #8042)
2025-06-06 13:51:05 -04:00
Ryan Kurtz
12af96f0e3 GP-5645: Improved support for importing big-endian COFF binaries 2025-06-06 13:48:35 -04:00
Ryan Kurtz
a1f777a1dd Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-06 13:27:23 -04:00
Ryan Kurtz
54ba166144 Merge remote-tracking branch 'origin/GP-1-dragonmacher-edit-action-fix' into Ghidra_11.4 2025-06-06 13:23:59 -04:00
dragonmacher
08b990412e GP-5740 - Data Types - Fixed composite editor showing 2 data type
chooser dialogs; fixed Escape not working in the chooser dialog
2025-06-05 20:44:50 -04:00
dragonmacher
ac00cf7e30 Fixed missing help; fixed action enablement 2025-06-05 20:35:28 -04:00
ghidra1
c0cfad9107 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-05 17:55:06 -04:00
ghidra1
4a65e9af3b Merge remote-tracking branch 'origin/GP-5749_ghidra1_SARIF_improvements' into Ghidra_11.4 2025-06-05 17:53:26 -04:00
d-millar
7fe22b8092 GP-5749: Corrected SARIF import/export errors 2025-06-05 17:53:26 -04:00
ghidra1
f925768829 Merge remote-tracking branch 'origin/GP-5744_d-millar_sarif_failures' into Ghidra_11.4 2025-06-05 16:45:55 -04:00
Andras Gemes
c10a91fa3e BSim: Add getmetadata subcommand to bsim 2025-06-05 19:21:33 +00:00
d-millar
02cc001d30 GP-5744: fix for null sarif entries 2025-06-05 17:00:45 +00:00
Ryan Kurtz
e804e1a01d Merge remote-tracking branch
'origin/GP_5741_ghidragon_fixing_accessibility_for_symbol_tree--SQUASHED'
(Closes #8228)
2025-06-05 07:40:44 -04:00
ghidragon
8b6f85f1c5 GP-5741 fixing screen reader support for tree widges that have html toolt 2025-06-04 14:08:55 -04:00
Ryan Kurtz
1b9507e12d Merge remote-tracking branch 'origin/GP-4881_ryanmkurtz_pe--SQUASHED'
(Closes #6864)
2025-06-04 14:03:07 -04:00
Ryan Kurtz
129602cc8c GP-4881: Prevent PE Data Directory parse failures from making the import fail 2025-06-04 14:01:33 -04:00
Ryan Kurtz
9107dc3931 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-04 13:33:22 -04:00
Ryan Kurtz
f19b9d710c Merge remote-tracking branch
'origin/GP-5739_d-millar_NPE_fix_rebased_11.4' into Ghidra_11.4
(Closes #8227)
2025-06-04 13:29:37 -04:00
d-millar
58cecaf6a2 GP-5379: fix for file path NPE 2025-06-04 14:44:36 +00:00
Ryan Kurtz
7772d98143 Merge remote-tracking branch
'origin/GP-1-dragonmacher-decompiler-location-npe' (#8114)
2025-06-03 06:13:10 -04:00
Ryan Kurtz
1e27f3eff8 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-03 06:10:57 -04:00
Ryan Kurtz
0a0d7a6336 Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_comment-warnings' 2025-06-03 06:10:07 -04:00
Ryan Kurtz
d896b94124 Merge remote-tracking branch
'origin/GP-5735_fix_composite_editor_datatype_cloning--SQUASHED' into
Ghidra_11.4 (Closes #8217)
2025-06-03 06:02:58 -04:00
dragonmacher
397fdb2fb1 NPE fix 2025-06-02 17:29:57 -04:00
dev747368
24b6492c69 GP-5735 fix composite editor data type cloning 2025-06-02 15:37:36 -04:00
Ryan Kurtz
1ebb1a1457 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-02 14:26:08 -04:00
Ryan Kurtz
6a5cd42cc0 Merge remote-tracking branch 'origin/GP-5697_ghizard_update_PDB_post_analysis_popup_message' into Ghidra_11.4 2025-06-02 14:22:27 -04:00
ghizard
2858b63c67 GP-5697 -PDB - Updated pop-analysis pop-up message 2025-06-02 14:21:11 -04:00
Dan
f1607b5cfd GP-5456: Upgrade protobuf to 4.31.0 (java) and 6.31.0 (python) 2025-06-02 14:49:12 +00:00
Ryan Kurtz
684177702e GP-0: Fixing deprecated comment API warnings 2025-06-02 09:54:19 -04:00
Ryan Kurtz
5772ac2ab8 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-06-02 06:25:48 -04:00
Ryan Kurtz
24b9061eba Merge branch
'GP-5728_dev747368_PR-8213_imladenov51_ghidra_golang120_fix_11.4' into
Ghidra_11.4 (Closes #8213)
2025-06-02 06:23:18 -04:00
dev747368
4521861b18 GP-5728 improve go pcheader and moduledata searching
These code paths are mainly hit with stripped PE binaries, and together
with the missing 1.20+ pcheader magic value would cause failure to find
the firstmoduledata struct, which is the root of everything.
2025-06-02 06:21:41 -04:00
Ivan Mladenov
3422409568 Fixed magic bytes to resolve Golang (v1.20+) functions. 2025-06-02 06:21:22 -04:00
Ryan Kurtz
e849e9689c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-30 14:35:05 -04:00
Ryan Kurtz
39ef79cace Merge remote-tracking branch 'origin/GP-5721_emteere_ConstantPropBugFix' into Ghidra_11.4 2025-05-30 14:24:00 -04:00
Ryan Kurtz
6bd2542049 Merge remote-tracking branch
'origin/GP-5724-dragonmacher-table-column-deadlock' (Closes #8208)
2025-05-30 14:21:26 -04:00
Ryan Kurtz
2b7a6c6d3b Merge remote-tracking branch 'origin/GP-5659_ghidorahrex_z80_sub_fix'
into Ghidra_11.4 (Closes #8144)
2025-05-30 13:51:53 -04:00
Ryan Kurtz
3b9701cb9e Merge remote-tracking branch 'origin/GP-5703_Dan_fixAutoVersion' into Ghidra_11.4 2025-05-30 13:49:16 -04:00
Ryan Kurtz
e3a652db2b Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-30 11:54:50 -04:00
ghidra1
35b67d2d25 GP-5723 Corrected regression bug 2025-05-30 10:11:41 -04:00
Ryan Kurtz
1f1e77b780 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-29-25-2' 2025-05-30 07:59:29 -04:00
Ryan Kurtz
faf4950bb5 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-30 07:59:04 -04:00
Ryan Kurtz
cc1fea8562 GP-5640: Fixing GFileSystem iterable function javadoc 2025-05-30 07:56:01 -04:00
Ryan Kurtz
d3131e319a GP-0: Fixing unused import warnings 2025-05-30 07:07:43 -04:00
Ryan Kurtz
2e0c098c25 GP-0: Fixing unnecessary semicolon warnings 2025-05-30 06:46:11 -04:00
Ryan Kurtz
5fe25f1cfd Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_warnings' 2025-05-30 06:06:50 -04:00
emteere
8b43314daf GP-4512 bugfixes 2025-05-30 01:51:09 +00:00
dragonmacher
6758197e84 Test fixes 2025-05-29 18:59:10 -04:00
dragonmacher
45e9baca7e GP-5724 - Fixed potential deadlock with options registration 2025-05-29 18:42:56 -04:00
dev747368
3ecbccaf6f GP-5726 fix absolute symlink path resolution
Absolute paths were being treated as relative.
2025-05-29 19:53:41 +00:00
Ryan Kurtz
48b8bc0fcc Merge remote-tracking branch 'origin/GP-3547_ghidra1_DefaultSettingsFix' 2025-05-29 14:37:47 -04:00
Ryan Kurtz
9cdb80472c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-29 13:28:04 -04:00
Ryan Kurtz
1429b17db3 Merge remote-tracking branch 'origin/GP-0_ghidraffe_improveBuildDockerImageScript' into Ghidra_11.4 2025-05-29 13:25:25 -04:00
ghidraffe
a794a26345 GP-0 improved the build docker image script to use relative path for the
build context parameter of docker build.
2025-05-29 17:03:35 +00:00
Ryan Kurtz
0cbf33d074 GP-0: Fixing raw type warnings 2025-05-29 11:07:48 -04:00
Ryan Kurtz
a6cd5b5dbc GP-0: Fixing @Override warnings 2025-05-29 11:07:44 -04:00
ghidra1
f9435194a1 GP-3547 Disable Default Settings when they are immutable such as Dynamic
datatype component types.
2025-05-29 10:41:21 -04:00
Ryan Kurtz
d4120b4b4d Merge remote-tracking branch 'origin/GP-1-dragonmacher-test-fixes-5-29-25' 2025-05-29 10:41:08 -04:00
dragonmacher
f225a3e32a Test fixes 2025-05-29 10:33:18 -04:00
Ryan Kurtz
8365cf0a19 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-29 08:49:16 -04:00
Ryan Kurtz
f053749e7f Merge remote-tracking branch
'origin/GP-5723_ghidra1_DefaultPointerLabels' into Ghidra_11.4
(Closes #8200)
2025-05-29 08:47:10 -04:00
ghidra1
ef790b6261 GP-5723 Improved default pointer label naming 2025-05-28 15:35:07 -04:00
Ryan Kurtz
5e17903c66 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-28 14:59:46 -04:00
Ryan Kurtz
ec43d344ad GP-0: Giving PyGhidra access to a ProjectManager 2025-05-28 14:59:29 -04:00
Ryan Kurtz
6cf47563fb GP-0: Fixing warnings in Utility project 2025-05-28 14:55:40 -04:00
Ryan Kurtz
b63f4d305b Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-28-25' 2025-05-28 11:50:30 -04:00
dragonmacher
72d7986e6b Test fixes 2025-05-28 11:49:47 -04:00
Ryan Kurtz
50f289779f Merge branch 'GP-0_ryanmkurtz_PR-8193_sollyucko_fixing-typo-in-rename-structure-field-created-by-comment' 2025-05-28 06:16:03 -04:00
Ryan Kurtz
f299842b24 GP-0: Certify 2025-05-28 06:15:21 -04:00
Ryan Kurtz
368f59abb5 Merge remote-tracking branch 'origin/GP-1-dragonmacher-archive-icon-fix' 2025-05-28 06:06:01 -04:00
Solomon Ucko
ef4cbad4ec fixing typo in RenameStructureFieldTask comment: "Created by retype action" -> "Created by Rename Structure Field action" 2025-05-28 01:48:08 -04:00
dragonmacher
b6111feb39 Fixed node icon to show read-only status for archives from other
projects
2025-05-27 14:00:20 -04:00
ghidra1
b276bc6b33 Merge remote-tracking branch 'origin/GP-5391_ghidra1_BuiltinSettingsInit' into Ghidra_11.4 2025-05-27 13:24:09 -04:00
ghidra1
1505725e36 GP-5391 Correct manner in which BuiltIn datatype default settings are
conveyed to DataTypeSettingsDB instance.
2025-05-27 13:22:51 -04:00
Ryan Kurtz
88f77e5cd1 Merge remote-tracking branch 'origin/GP-5717-dragonmacher-vertex-shapes' 2025-05-27 13:16:27 -04:00
ghidra1
70bce6aa3a Merge remote-tracking branch 'origin/GP-5660_ghidra1_CorrectedFolderRenameRefresh' into Ghidra_11.4 2025-05-27 13:08:49 -04:00
ghidra1
8162329810 GP-5660 Corrected folder rename refresh bug 2025-05-27 13:06:41 -04:00
Ryan Kurtz
3f8fe98862 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-27 13:06:32 -04:00
Ryan Kurtz
0f5608ed56 Merge branch 'GP-5677_ryanmkurtz_lastrun' into Ghidra_11.4
(Closes #7440)
2025-05-27 12:53:59 -04:00
Ryan Kurtz
189117e7d4 GP-5677: Ghidra now writes a "lastrun" file that PyGhidra can look for
to help find the Ghidra installation dir
2025-05-27 09:09:53 -04:00
Ryan Kurtz
65b290624e Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-25 07:17:39 -04:00
Ryan Kurtz
7b01e2a595 GP-5396: Fixing regression in Mach-O FileSet extraction (Closes #8194) 2025-05-25 07:15:47 -04:00
dragonmacher
b03b5e112c Graph - Refactored the FcgVertex to create a generic circle vertex shape
provider
2025-05-24 16:54:55 -04:00
Ryan Kurtz
1a05e89206 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-23 13:45:56 -04:00
ghidraffe
da37f9d3c4 GP-0 fix docker build script warning 2025-05-23 13:43:14 -04:00
Ryan Kurtz
b3d4edb5f2 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-23 13:01:04 -04:00
Ryan Kurtz
73f8749439 Merge remote-tracking branch 'origin/GP-0_ghidraffe_fixDockerBuildScript' into Ghidra_11.4 2025-05-23 12:58:57 -04:00
ghidraffe
1676e929a8 GP-0 fix issue with docker build script 2025-05-23 16:56:13 +00:00
Ryan Kurtz
6cca3a1c5c Merge remote-tracking branch
'origin/GP-5711-dragonmacher-search-by-structure-offset--SQUASHED'
(Closes #8171)
2025-05-23 10:43:27 -04:00
MetalliC
24c0699a38
SuperH4: fix FSCA opcode destination location 2025-05-23 15:08:01 +03:00
MetalliC
53d7e1608f
SuperH4: fix fpu registers order 2025-05-23 15:03:55 +03:00
Ryan Kurtz
cd30a59a1c Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-22-25' 2025-05-23 06:10:03 -04:00
Ryan Kurtz
bdb8836982 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-23 06:09:40 -04:00
Ryan Kurtz
aff0561691 GP-0: Fixing NPE in Batch Importer (#Closes #8191) 2025-05-23 06:07:58 -04:00
dragonmacher
6b28db4085 Updated how the test timeout feature prints debug 2025-05-22 16:28:29 -04:00
Ryan Kurtz
f6682b872b Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-22 13:27:43 -04:00
Ryan Kurtz
e7b3d17fbe Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-22-25' into Ghidra_11.4 2025-05-22 13:25:32 -04:00
dragonmacher
38e83b2417 Test fixes 2025-05-22 13:21:05 -04:00
dragonmacher
e830dbabfa GP-5711 - Updated the Structure Editor's 'Find Uses of' action to work on unnamed fields 2025-05-22 13:10:48 -04:00
Ryan Kurtz
d6612d5dfd Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-22 11:12:02 -04:00
Ryan Kurtz
95497ba0a7 Merge remote-tracking branch 'origin/GP-5649_ghidraffe_DockerFixes' into Ghidra_11.4 2025-05-22 10:29:19 -04:00
Ryan Kurtz
5ab3df4bf8 Merge remote-tracking branch 'origin/GP-5699_ghidraffe_fixGhidraGoDevMode--SQUASHED' into Ghidra_11.4 2025-05-22 10:27:48 -04:00
ghidraffe
c85915954c GP-5699 fix GhidraGo in dev mode 2025-05-22 14:23:50 +00:00
Ryan Kurtz
6f0cb9a77c GP-5415: Python scripts that do not declare a @runtime metadata comment
now default to PyGhidra instead of Jython. (Closes #7856)
2025-05-22 10:13:19 -04:00
Ryan Kurtz
b7602e9d41 Merge remote-tracking branch
'origin/GP-5327-create-structure-dialog-updates' (Closes #6713)
2025-05-22 06:10:55 -04:00
Ryan Kurtz
089e3a229c Merge remote-tracking branch 'origin/GP-5713_ghizard_PDB_adjust_processing_of_thunks_to_allow_Demangler_to_set_siganture' 2025-05-22 06:08:16 -04:00
Ryan Kurtz
0609093a1f Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-22 06:05:06 -04:00
Ryan Kurtz
81d9cbb5ac Merge remote-tracking branch 'origin/GP-1-dragonmacher-edit-field-fix' into Ghidra_11.4 2025-05-22 06:01:29 -04:00
ghizard
348c423ae2 GP-5713 - PDB - adjust MSFT thunk processing to allow demangled
signatures to be used when not considered to be a Ghidra thunk
2025-05-21 16:30:42 -04:00
ghidra1
ce6770132b Merge remote-tracking branch
'origin/GP-5605_ghidra1_ELF_SH4_PartialInplace' into Ghidra_11.4
(Closes #8021)
2025-05-21 16:14:07 -04:00
dragonmacher
e2d5d30c64 GP-5327 - Fixed sizing issues with the data type and category editors 2025-05-21 15:36:35 -04:00
ghidravision
8234bfb14a GP-5327 - Create Structure Dialog - New text category box & existing
categories chooser
2025-05-21 15:36:35 -04:00
Ryan Kurtz
6c1b881847 Merge remote-tracking branch 'origin/GP-5707_dev747368_fix_projectindex_ref_for_getinfo_action' 2025-05-21 12:22:32 -04:00
Ryan Kurtz
bcbec7da37 Merge remote-tracking branch 'origin/GP-5661_ghizard_Fix_Apply_Data_Archives_SourceType_bug' 2025-05-21 12:21:28 -04:00
Ryan Kurtz
175cf94887 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-21 11:46:01 -04:00
Ryan Kurtz
775bd54efe Merge branch 'GP-0_ryanmkurtz_PR-8172_travislibre_vt-fix' into
Ghidra_11.4 (Closes #8172)
2025-05-21 11:28:22 -04:00
Ryan Kurtz
9871e01a8f GP-0: Certify 2025-05-21 11:27:00 -04:00
Travis Libre
310a6f073b Fix getDestinationFunctions 2025-05-21 11:23:15 -04:00
Ryan Kurtz
1b116f7b62 Merge remote-tracking branch 'origin/GP-1-dragonmacher-db-viewer-help-fix' 2025-05-21 11:05:30 -04:00
Ryan Kurtz
30b0e80733 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-21-25' 2025-05-21 10:32:29 -04:00
dragonmacher
f81300e2aa Test fixes 2025-05-21 10:31:33 -04:00
ghidra1
52eed79cc8 GP-0 Completed cleanup of unused AbstractDataType DuplicateNameException
use
2025-05-21 10:30:33 -04:00
ghidra1
f080fb70a1 GP-0 Minor cleanup of unused AbstractDataType DuplicateNameException use 2025-05-21 10:07:00 -04:00
Ryan Kurtz
aa8bffe707 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-21 09:46:27 -04:00
Ryan Kurtz
8ff5444ac1 GP-5710: Fixed a bug that prevented PyGhidra from properly using the
user's already-active virtual environment
2025-05-21 09:43:29 -04:00
ghidra1
2391bdefed Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-21 09:06:05 -04:00
ghidra1
4dbfaf0f66 GP-0 Removed unsupported method DataType.getDocs() 2025-05-21 08:56:13 -04:00
Ryan Kurtz
91e106c40c Merge remote-tracking branch 'origin/GP-5662-dragonmacher-namespace-hl' 2025-05-20 17:35:11 -04:00
Ryan Kurtz
55f9f0315e Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-20 17:34:41 -04:00
Ryan Kurtz
c594e41f60 Merge remote-tracking branch 'origin/GP-5681_ryanmkurtz_macho' into
Ghidra_11.4 (Closes #8124)
2025-05-20 17:20:05 -04:00
dragonmacher
6d96c5656a Help - DB Viewer help update
Fixes #1988
2025-05-20 16:01:34 -04:00
Ryan Kurtz
a048c3dd7c Merge remote-tracking branch 'origin/GP-1-dragonmacher-exception-fix'
(Closes #6838)
2025-05-20 14:13:40 -04:00
dragonmacher
bb56797479 Fixed stack trace in debug component 2025-05-20 14:09:02 -04:00
dev747368
2c894df34c GP-5707 fix getinfo FSB action project index
Also tweak tar filename info string
2025-05-20 18:05:53 +00:00
Ryan Kurtz
1ea264b71a GP-5681: Relocating Mach-O got entries with no symbols to the EXTERNAL
block
2025-05-20 14:01:21 -04:00
Ryan Kurtz
795d92cb1a Merge remote-tracking branch
'origin/GP-5694-dragonmacher-dtm-get-data-type' (Closes #8157)
2025-05-20 09:54:50 -04:00
Ryan Kurtz
c883520c90 Merge remote-tracking branch 'origin/GP-0_ryanmkurtz_SequencedCollection' 2025-05-20 06:05:35 -04:00
dragonmacher
065581ad38 GP-5622 - Decompiler - Fixed namespace highlight bug 2025-05-19 17:47:33 -04:00
ghidra1
988660d862 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-19 16:06:03 -04:00
ghidra1
0b2739a8fe Merge remote-tracking branch
'origin/GP-5704_ghidra1_x86_16_LanguageUpgradeIssues' into Ghidra_11.4
(Closes #8140)
2025-05-19 16:05:34 -04:00
ghidra1
271ec694ad GP-5704 Corrected language upgrade issue affecting x86-16 Protected and
SMM mode variants.
2025-05-19 16:01:16 -04:00
dragonmacher
33ecf97be3 Updated the Quick Edit Field to fix the menu name and to fix a data type
edit bug
2025-05-19 14:21:59 -04:00
Ryan Kurtz
ea076b3fa6 GP-0: Using SequencedCollection for application root dirs since order
matters
2025-05-19 12:47:56 -04:00
ghidra1
5e7dcf750e Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-19 12:43:10 -04:00
ghidra1
749fdbb556 GP-0 Correction to GP-5619 regression 2025-05-19 12:40:37 -04:00
Ryan Kurtz
2e7c5da7b0 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-19 09:47:37 -04:00
Ryan Kurtz
e13838d177 GP-5396: Only adding exports for the original extracted dylib, not
additional ones (#7289)
2025-05-19 09:45:53 -04:00
Ryan Kurtz
98e80fee0b Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-19 06:02:43 -04:00
Ryan Kurtz
e4e2d92b07 Merge remote-tracking branch
'origin/GP-0_dev747368_definedstringiterator_morefixes_for_unions' into
Ghidra_11.4 (Closes #8134)
2025-05-19 05:57:23 -04:00
Ryan Kurtz
4c7795a944 Merge remote-tracking branch 'origin/GP-5692_James_update_bsim_tutorial' into Ghidra_11.4 2025-05-19 05:54:17 -04:00
Ryan Kurtz
175dbb1723 Merge remote-tracking branch 'origin/GP-5698_Dan_fixOneRepoDevLayout' into Ghidra_11.4 2025-05-19 05:51:32 -04:00
dragonmacher
6396a1a1e0 GP-5694 - Data Types - Updated the DataTypeQueryService to add more
useful method
2025-05-17 11:06:31 -04:00
dev747368
2ea66d6fb4 GP-0 more fixes for new definedstringiterator and unions 2025-05-16 22:04:26 +00:00
James
4226376a95 GP-5692 updated bsim tutorial 2025-05-16 20:21:23 +00:00
Dan
deadfe59a1 GP-5703: Only require minor versions to match in auto-install. 2025-05-16 19:48:43 +00:00
Ryan Kurtz
fd2dde2608 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-16 15:09:09 -04:00
Ryan Kurtz
f30aee4535 Merge remote-tracking branch 'origin/GP-5693_ghidragon_function_comparison_order_with_left_and_right_funcitons' into Ghidra_11.4 2025-05-16 15:06:20 -04:00
Ryan Kurtz
6726ed1515 GP-0: Fixing javadoc error 2025-05-16 14:48:55 -04:00
Ryan Kurtz
db8e21463b Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-16 14:25:58 -04:00
Ryan Kurtz
e2332dec70 Merge remote-tracking branch 'origin/GP-0_dev747368_fix_definedstringsiterator_foundstringsiterator_missing_first_struct_field' into Ghidra_11.4 2025-05-16 14:09:25 -04:00
dev747368
56694d77dc GP-0 fix definedstringiterator missing first struct field 2025-05-16 18:06:44 +00:00
Ryan Kurtz
6c6eb609c2 GP-5552: Integrated the UniversalMachoLoader into MachoLoader to address
a library loading issue
2025-05-16 13:47:28 -04:00
Dan
dbd574cfb2 GP-5698: Don't go to parent unless we have ghidra.repos.config. 2025-05-16 17:00:40 +00:00
Ryan Kurtz
69608f2751 Merge remote-tracking branch 'origin/GP-5697_ghizard_PDB_provide_post-analysis_popup_when_PDB_not_found' into Ghidra_11.4 2025-05-16 12:05:41 -04:00
ghizard
2f51ec305c GP-5697 - PDB Provide post-analysis pop-up when PDB file not found 2025-05-16 10:47:00 -04:00
Ryan Kurtz
0b8985a257 Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-05-16-1' into Ghidra_11.4 2025-05-16 09:54:29 -04:00
Dan
04609f52da GP-0: Fix tests. 2025-05-16 13:50:06 +00:00
Ryan Kurtz
3872a6212f Merge remote-tracking branch 'origin/GP-5679-dragonmacher-dtm-type-filter--SQUASHED' into Ghidra_11.4 2025-05-16 09:45:41 -04:00
Ryan Kurtz
384cb88568 Merge remote-tracking branch 'origin/GP-5533_Dan_documentAndroidNdkWindowsSetup' into Ghidra_11.4 2025-05-16 09:38:19 -04:00
Dan
c1e42d60d8 GP-5533: Document Android NDK lldb setup. 2025-05-16 13:27:58 +00:00
Ryan Kurtz
b22ccaa260 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-16 06:17:56 -04:00
Ryan Kurtz
657215ddbe Merge remote-tracking branch 'origin/GP-5691_James_update_setexecutablecategoryscript--SQUASHED' into Ghidra_11.4 2025-05-16 06:08:22 -04:00
Ryan Kurtz
e386550016 Merge remote-tracking branch
'origin/GP-2941_dev747368_definedstringstable_performance--SQUASHED'
into Ghidra_11.4 (Closes #5726, Closes #8134, Closes #3498)
2025-05-16 06:06:41 -04:00
ghidragon
566ba712a3 GP-5693 fixed left/right order when comparing exactly two functions 2025-05-15 17:02:04 -04:00
James
d2d0c989f9 GP-5641 update SetExecutableCategoryScript 2025-05-15 16:50:59 -04:00
dragonmacher
2ef2619e18 GP-5679 - Data Type Filter fix 2025-05-15 16:33:33 -04:00
dev747368
c70de2b590 GP-2941 better defined string iterator
Don't iterate arrays that can't contain a string.
When iterating a struct, only look at defined fields.
Should address issues #8134, #5726, #3498
2025-05-15 16:20:27 -04:00
Ryan Kurtz
d0c327973c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-15 14:46:31 -04:00
Ryan Kurtz
18d73945da Merge remote-tracking branch 'origin/GP-5612_Dan_fixGdbZeroLengthSections' into Ghidra_11.4 2025-05-15 14:34:43 -04:00
Dan
1398e1f9b9 GP-5612: Fix listing of zero-length sections in gdb. 2025-05-15 18:30:37 +00:00
Ryan Kurtz
865ac556b5 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-15 14:23:15 -04:00
Ryan Kurtz
f533aa5857 Merge remote-tracking branch 'origin/GP-5686_dev747368_dwarf_progtree_fix' into Ghidra_11.4 2025-05-15 14:20:24 -04:00
Ryan Kurtz
e6241f6058 Merge remote-tracking branch 'origin/GP-5668_Dan_activateOnLaunch' into Ghidra_11.4 2025-05-15 14:19:25 -04:00
Ryan Kurtz
72545246cf Merge remote-tracking branch 'origin/GP-5673_Dan_fixHangAtLaunchWithRegsFilter' into Ghidra_11.4 2025-05-15 14:18:45 -04:00
Dan
4e63ea7201 GP-5673: Fix hang at launch caused by repeated filtering of registers table. 2025-05-15 18:05:30 +00:00
dev747368
afe19e3f74 GP-5686 fix DWARF program tree when func is split over multi-memblk 2025-05-15 17:50:56 +00:00
Ryan Kurtz
0295d57b5e Merge remote-tracking branch 'origin/GP-1-dragonmacher-popup-mouse-fix-redux-11-5' 2025-05-15 13:42:41 -04:00
Dan
00d634ca17 GP-5668: Activate trace on target creation. Tweak message about out-of-date programs. 2025-05-15 17:42:38 +00:00
Ryan Kurtz
8ec9a9079a Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-15 13:42:06 -04:00
Ryan Kurtz
b8ecef1d5a Merge remote-tracking branch
'origin/GP-5665_ghidorahrex_PR-8151_jmillikin_fix-cvttsd2si' into
Ghidra_11.4 (Closes #8004, Closes #8151)
2025-05-15 13:39:10 -04:00
Ryan Kurtz
60ce1f523d Merge remote-tracking branch
'origin/GP-5682-dragonmacher-vxworks-headless-script-fix' into
Ghidra_11.4 (Closes #8156)
2025-05-15 13:35:49 -04:00
Ryan Kurtz
1740ddae4a Merge remote-tracking branch 'origin/GP-5671_Dan_fixStaleLogicalBpt' into Ghidra_11.4 2025-05-15 13:33:58 -04:00
Dan
0facc761ce GP-5671: Fix failed breakpoint updates on toggle. 2025-05-15 17:09:57 +00:00
ghidorahrex
d6815ae407 GP-5665: Additional cvt reg32 dest fixes 2025-05-15 16:52:12 +00:00
Ryan Kurtz
317d993c63 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-15 12:50:04 -04:00
Ryan Kurtz
284980b60b Merge remote-tracking branch
'origin/GP-5678_Dan_fixWow64AutoReads--SQUASHED' into Ghidra_11.4
(Closes #8155)
2025-05-15 12:47:10 -04:00
dragonmacher
667e439550 GP-5682 - VxWorksSymTab script headless fix 2025-05-15 12:44:02 -04:00
Dan
4a7d8b6984 GP-5678: Move timeout error on PE-header read to debug console. Heed Auto-Read spec. 2025-05-15 16:39:02 +00:00
Ryan Kurtz
d45a8d4c75 Merge remote-tracking branch 'origin/GP-1-dragonmacher-loop-counter-fix'
(#8104)
2025-05-15 11:59:26 -04:00
Ryan Kurtz
33b9688d7c Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-15 11:58:09 -04:00
dragonmacher
a9d24753ee Fix loop counter 2025-05-15 11:55:40 -04:00
Ryan Kurtz
46542228c3 GP-5681: Adding currently unsupported DYLD chained fixups to the
relocation table (#8124)
2025-05-15 11:52:50 -04:00
Ryan Kurtz
bcb2d2934e Merge remote-tracking branch 'origin/GP-5670_Dan_dbgTutorialErrata' into Ghidra_11.4 2025-05-15 09:14:47 -04:00
Dan
b18291178a GP-5670: Errata in the Debugger Tutorial 2025-05-15 13:07:11 +00:00
dragonmacher
4eced86c09 Yet another attempt at correct global mouse popup behavior 2025-05-14 19:08:37 -04:00
Ryan Kurtz
717cb2a0ce Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-14 16:29:33 -04:00
Ryan Kurtz
7b310a0676 Merge remote-tracking branch
'origin/GP-5676_James_handle_ops_with_one_input' into Ghidra_11.4
(Closes #8092)
2025-05-14 16:27:23 -04:00
James
27a019d9f8 GP-5676 fixed issue involving ops with one input in
BooleanMatch::evalute
2025-05-14 20:24:04 +00:00
Ryan Kurtz
24205f79a7 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-14 16:17:25 -04:00
Ryan Kurtz
fa09e132a1 Merge remote-tracking branch 'origin/GP-5675_Dan_fixCompareSnapshots' into Ghidra_11.4 2025-05-14 16:14:39 -04:00
Dan
b491934eea GP-5675: Ensure comparison uses alternative view path. 2025-05-14 20:06:57 +00:00
Ryan Kurtz
741e6614f0 Merge remote-tracking branch 'origin/Ghidra_11.4' 2025-05-14 15:56:47 -04:00
Ryan Kurtz
b915d15baa Merge remote-tracking branch 'origin/GP-5672_Dan_fixSyncProgramSwitch' into Ghidra_11.4 2025-05-14 15:53:58 -04:00
Dan
2a173db3fc GP-5672: Emit program change on sync if needed. 2025-05-14 19:46:20 +00:00
Ryan Kurtz
dfac883a7a Merge remote-tracking branch
'origin/GP-5654-dragonmacher-slow-data-types-delete--SQUASHED'
(Closes #8104)
2025-05-14 15:46:13 -04:00
Ryan Kurtz
c832784952 GP-0: Bumping master to 11.5 2025-05-14 15:45:24 -04:00
Ryan Kurtz
a674133712 Merge remote-tracking branch 'origin/GP-5664_ghizard_PdbReader_parse_NewFramePointerOmission_data' 2025-05-14 15:43:31 -04:00
Ryan Kurtz
e79a68c764 Merge remote-tracking branch 'origin/GP-5667_Dan_fixDebuggerArgsPassing' into Ghidra_11.4 2025-05-14 15:33:09 -04:00
Dan
6ab32ff426 GP-5667: Fix gdbi and lldb argument passing in bash. 2025-05-14 19:29:13 +00:00
Ryan Kurtz
70820402d7 GP-0: Making build fail if "UNKNOWN" wheel is produced due to old pip. 2025-05-14 12:01:03 -04:00
ghizard
9003cf9461 GP-5664_PdbReader_parse_NewFramePointerOmission_data 2025-05-14 06:40:52 -04:00
John Millikin
6ab48b885b x86: Fix missing zero-extension in CVTTSD2SI 2025-05-14 19:19:32 +09:00
Ryan Kurtz
fb04408b0a Merge remote-tracking branch 'origin/GP-0-dragonmacher-11-4-test-fixes-5-13-25' into Ghidra_11.4 2025-05-14 05:59:57 -04:00
dragonmacher
68bc9c8109 Test fixes; Revert of mouse listener fix for 11.4 2025-05-13 19:20:43 -04:00
dragonmacher
404191cdaa GP-5654 - Data Type Manager - Speed improvements for deleting data types 2025-05-13 14:27:17 -04:00
ghizard
b15b51e48e GP-5661 - Fix SourceType issue in Apply Data Archives 2025-05-13 12:45:19 -04:00
d-millar
a1b6084c88 GP-0: Adding a missing commit (cosmetic changes) 2025-05-13 10:50:08 -04:00
ghidorahrex
eb6fbb17ef GP-5659: Fixed z80 sub instruction semantics 2025-05-13 14:24:39 +00:00
Ryan Kurtz
04bb0fa5a7 Merge remote-tracking branch 'origin/GP-1-dragonmacher-mouse-listener-fix--SQUASHED' into Ghidra_11.4 2025-05-13 07:54:00 -04:00
Ryan Kurtz
53b2e81863 Merge remote-tracking branch
'origin/GP-1-dragonmacher-dtm-tree-action-fix' into Ghidra_11.4 (#8131)
2025-05-13 07:53:48 -04:00
Ryan Kurtz
db237ce639 Merge remote-tracking branch
'origin/GP-5642-dragonmacher-gnu-demangler-tls-init--SQUASHED' into
Ghidra_11.4 (Closes #8105)
2025-05-13 06:18:56 -04:00
Ryan Kurtz
ca9be8510d Merge remote-tracking branch
'origin/GP-5655-dragonmacher-decomp-location-exception' into Ghidra_11.4
(Closes #8139)
2025-05-13 06:16:43 -04:00
Ryan Kurtz
60ab12ca12 Merge remote-tracking branch 'origin/GP-5658_Dan_fixMissingHome' into Ghidra_11.4 2025-05-13 06:14:27 -04:00
Ryan Kurtz
0decb8916f Merge remote-tracking branch 'origin/GP-5657_Dan_fixForGdb12' into Ghidra_11.4 2025-05-13 06:13:00 -04:00
Ryan Kurtz
b5f31e7c35 Merge remote-tracking branch 'origin/GP-5656_Dan_fixTypoInstalled' into Ghidra_11.4 2025-05-13 06:11:16 -04:00
dragonmacher
5f61a06381 GP-5642 - Gnu Demangler - Added support for TLS init functions 2025-05-12 19:27:20 -04:00
dragonmacher
6f4b1f730e Fixed mouse listener ordering 2025-05-12 15:54:12 -04:00
Dan
4edb4ca970 GP-5658: Fix missing lines from extracted gmodutils.py 2025-05-12 18:30:46 +00:00
Dan
e4f12cc691 GP-5657: Some conditionals to avoid missing types in older gdb versions. 2025-05-12 18:18:39 +00:00
Dan
cd593a23ea GP-5656: Fix debilitating typo affecting installation layout. 2025-05-12 18:06:14 +00:00
dragonmacher
b714f562ac GP-5655 - Decompiler - NPE fix for program location 2025-05-12 10:49:40 -04:00
dragonmacher
969f854fe2 Fixed Copy/Paste keybindings in the Data Type Manager 2025-05-10 14:47:30 -04:00
ghidraffe
e817566c4f GP-5649 improvements for Dockerized Ghidra 2025-05-09 18:27:58 +00:00
Ryan Kurtz
0ebc4c9608 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-9-25' 2025-05-09 13:47:29 -04:00
dragonmacher
dad56dfcbe Test fixes 2025-05-09 13:40:52 -04:00
emteere
c58647b7d2 GP-0 Fix for minor instruction length override regression 2025-05-09 14:06:32 +00:00
Ryan Kurtz
acf3e49928 Merge branch 'GP-5363_ghidra2_helpIndex--SQUASHED' 2025-05-09 06:11:15 -04:00
ghidra2
6a41722fd0 GP-5363: Added BSim section and path to Debugger tutorial to
GettingStarted.md
2025-05-09 06:09:31 -04:00
ghidra1
9a7d3eb93f Merge remote-tracking branch 'origin/GP-1-dragonmacher-dt-filter-updates--SQUASHED' 2025-05-08 17:48:06 -04:00
dragonmacher
72dfb355ac GP-1 Updates to the Data Type Manager filter dialog to allow typedef filtering 2025-05-08 17:47:11 -04:00
ghidra1
a9d3b9e236 Merge remote-tracking branch 'origin/GP-4512_emteere_ConstantAnalysisSpeedup--SQUASHED' 2025-05-08 17:36:25 -04:00
emteere
c396867209 GP-4512 Constant propagation and stack analysis performance changes 2025-05-08 17:35:25 -04:00
ghidra1
e10c42ab44 Merge remote-tracking branch 'origin/patch' 2025-05-08 17:20:05 -04:00
ghidra1
cd6d45c64f GP-0 Corrected NPE for eBPF ELF import. (Closes #8034) 2025-05-08 17:18:19 -04:00
ghidra1
0bf8f03a1e Merge branch 'GP-5619_emteere_VariousSpeedImprovements_VERSION2' 2025-05-08 16:18:38 -04:00
ghidra1
ececb7ea36 Merge remote-tracking branch 'origin/GP-3579_ghidraffe_GhidraDocker--SQUASHED' 2025-05-08 15:48:19 -04:00
ghidraffe
fbdcd1c709 GP-3579 Added docker image generation to Ghidra distribution. Use from development source repo is not supported. 2025-05-08 15:47:15 -04:00
ghidra1
df505c40a3 Merge branch 'GP-5619_emteere_VariousSpeedImprovements_VERSION2' 2025-05-08 14:57:36 -04:00
emteere
5a9b0268de GP-5619 Various FunctionDB/InstructionDB locking related speed
improvements.  Revised DatabaseObject checkIsValid implementation.
2025-05-08 14:54:51 -04:00
Dan
87db26d487 GP-5551: Detect and offer installation of missing Python packages. 2025-05-08 18:30:58 +00:00
Ryan Kurtz
1dc06fcdc2 Merge remote-tracking branch 'origin/GP-5573_d-millar_CTADL_upgrade--SQUASHED' 2025-05-08 13:11:09 -04:00
d-millar
3816012384 GP-5573: fix for horrible kludge
GP-5573: mostly working (ish)
GP-5566: lib/fn variants
GP-5573: error in initRun logic
GP-5573: append
GP-5573: tests/colors
GP-5573: more errors
GP-5573: minor fix
GP-5573: basically working?
2025-05-08 12:55:00 -04:00
Ryan Kurtz
8320d12461 Merge remote-tracking branch
'origin/GP-4923_ghintern_arm_apcs--SQUASHED' (Closes #7434)
2025-05-08 12:36:16 -04:00
Ryan Kurtz
32abab0a3d Merge remote-tracking branch
'origin/GP-5192_ghintern_aarch64_aapcs_fixes--SQUASHED' (Closes #8016)
2025-05-08 12:34:30 -04:00
Ryan Kurtz
5fd9cff2ed Merge remote-tracking branch
'origin/GP-5543_ghidracadabra_PR-7953_ADonut_decompiler-optimize'
(Closes #7953)
2025-05-08 12:29:44 -04:00
Ryan Kurtz
c7f9586d97 Merge remote-tracking branch
'origin/GP-5638_ghidracadabra_PR-6602_Sleigh-InSPECtor_x86_push_fs_gs_size'
(Closes #6602)
2025-05-08 12:28:25 -04:00
Ryan Kurtz
541818c274 Merge remote-tracking branch 'origin/patch' 2025-05-08 12:26:49 -04:00
Ryan Kurtz
d641f9de69 Merge remote-tracking branch
'origin/GP-4731_ghidorahrex_PR-5256_befoulad_armv8-splimit' into patch
(Closes #5256, Closes #5255, Closes #6667)
2025-05-08 12:22:40 -04:00
Ryan Kurtz
7cf82f6fe6 Merge remote-tracking branch 'origin/GP-5643_ryanmkurtz_rust-strings'
(Closes #8019)
2025-05-08 11:46:32 -04:00
Ryan Kurtz
1f6b6478d2 Merge remote-tracking branch 'origin/GP-5640_ryanmkurtz_iterableFS--SQUASHED' 2025-05-08 11:44:25 -04:00
Ryan Kurtz
71ed695edd GP-5640: Making more things Iterable 2025-05-08 11:42:30 -04:00
Ryan Kurtz
86ddb78480 The "Rust String Analyzer" no longer clears and converts strings defined
in the header to character arrays
2025-05-08 10:46:41 -04:00
ghintern
28ca53cb34 GP-4923: cspec, ldefs, opinion file support for ARM apcs abi 2025-05-07 17:41:41 +00:00
ghintern
b0b1db632c GP-5192: Fix aarch64 cspec to match aapcs calling convention 2025-05-07 17:40:54 +00:00
Ryan Kurtz
eaf6c42a7e Merge branch 'GP-0_ryanmkurtz_PR-8117_MTAwsl_lldb-arg-bug' 2025-05-07 11:04:49 -04:00
Ryan Kurtz
f9b3499231 Merge remote-tracking branch
'origin/GP-5639-dragonmacher-decompiler-exceptions' (Closes #8111,
Closes #8114)
2025-05-07 10:41:43 -04:00
James
a9e193d811 GP-5638 update language verions 2025-05-07 13:51:22 +00:00
NapCat
bd2088dfed
Update local-lldb.sh, fix #8115 2025-05-07 20:44:59 +10:00
NapCat
5d6cc2c981
Update kernel-lldb.sh, Fix #8115 2025-05-07 20:44:15 +10:00
NapCat
d49faf9e0f
Update android-lldb.sh, Fix #8115 2025-05-07 20:43:44 +10:00
dragonmacher
af7e572632 Fixed recent Decompiler location regressions 2025-05-06 18:47:17 -04:00
Sleigh-InSPECtor
ce839ce9fc x86: PUSH FS/GS long mode improvements. 2025-05-06 18:42:50 +00:00
Ryan Kurtz
915760bcae Merge remote-tracking branch 'origin/GP-5631_ryanmkurtz_jars' 2025-05-06 11:47:21 -04:00
Ryan Kurtz
bbd6b99605 GP-5631: Upgrading some jars 2025-05-06 05:52:23 -04:00
Ryan Kurtz
e209136396 Merge remote-tracking branch
'origin/GP-5634-dragonmacher-find-structures' (Closes #8096)
2025-05-05 17:53:35 -04:00
dragonmacher
17d0a83d51 GP-5634 - Fixed 'Find Structures by Size...' to find zero-length
structures
2025-05-05 16:52:25 -04:00
Ryan Kurtz
7e7f226b8c GP-0: Fixing WhatsNew link to ChangeHistory 2025-05-05 12:48:47 -04:00
Ryan Kurtz
01cb570dc7 Merge remote-tracking branch 'origin/patch' 2025-05-05 12:44:07 -04:00
Ryan Kurtz
39520f7894 Merge remote-tracking branch 'origin/GP-5633_ryanmkurtz_prevprefs' into
patch (Closes #8107)
2025-05-05 12:42:18 -04:00
Ryan Kurtz
7ed4b39bab Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-5-5-25' 2025-05-05 12:38:46 -04:00
dragonmacher
837ccb0f2a Test fixes 2025-05-05 12:35:33 -04:00
Ryan Kurtz
d2d3590d28 GP-5633: Fixed a bug that prevented new installations of Ghidra from
applying preferences found in older installed versions of Ghidra
2025-05-05 12:28:23 -04:00
Ryan Kurtz
939a8f979c Merge remote-tracking branch 'origin/patch' 2025-05-05 12:15:00 -04:00
Ryan Kurtz
67837ab99e GP-0: Fixing GhidraProject.openProgram() javadoc (Closes #8108) 2025-05-05 12:13:44 -04:00
ghidra1
f0a327ff11 GP-0 Added additional DataTypeParserTest cases 2025-05-05 12:00:16 -04:00
Ryan Kurtz
55bd8de0fa GP-0: Setting Gradle wrapper version to 8.14 2025-05-05 09:45:45 -04:00
Ryan Kurtz
87b1dbb8dc Merge remote-tracking branch 'origin/patch' 2025-05-02 15:17:36 -04:00
Ryan Kurtz
838c773253 Merge remote-tracking branch
'origin/GP-5587_ghidorahrex_AARCH64_dsb_instruction_fix' into patch
(Closes #7996)
2025-05-02 15:14:21 -04:00
Ryan Kurtz
9a7cced02c Merge remote-tracking branch
'origin/GP-5469_ghidorahrex_ARM_VFP_sysreg_fix' into patch
(Closes #6573)
2025-05-02 15:10:53 -04:00
ghidra1
8985f7d526 Merge branch 'GP-5628_ghidra1_NewTypedefFix' 2025-05-01 17:12:28 -04:00
ghidra1
742deca674 GP-5628 Corrected New Typedef... dialog to be consistent with other
cases
2025-05-01 17:11:42 -04:00
Ryan Kurtz
7e8d0c850d Merge remote-tracking branch
'origin/GP-5447_ghizard_fix_spelling_on_vxt_methods_and_variables'
2025-05-01 07:53:19 -04:00
ghizard
fb64f3084b GP-0 - Fix PDB CPP vxt spelling on methods and variables 2025-05-01 07:48:40 -04:00
Ryan Kurtz
a280e5162a Merge remote-tracking branch 'origin/GP-5611_ghizard_rename_to_MsVxtManager' 2025-05-01 06:10:50 -04:00
Ryan Kurtz
878a8fc5e5 Merge remote-tracking branch 'origin/GP-0-dragonmacher-bug-fix-4-30-25' 2025-05-01 06:09:42 -04:00
ghizard
be3f380540 GP-5611 - Rename to MsVxtManager and MsVxtManagerTest 2025-05-01 04:34:59 -04:00
dragonmacher
63503ac3b5 small bug fix for restoring program locations 2025-04-30 17:02:29 -04:00
Ryan Kurtz
ed1521227b Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-26-25--SQUASHED' 2025-04-30 14:25:49 -04:00
Ryan Kurtz
5e825ebb5a Merge branch 'GP-5627_ryanmkurtz_pyghidra-projects' (Closes #8040) 2025-04-30 11:25:55 -04:00
dragonmacher
dd15eca6b5 Test fix; update Code Browser to have both setView() and updateView() 2025-04-30 11:05:11 -04:00
Ryan Kurtz
151fea46f5 GP-5627: PyGhidra can now open projects created with the Ghidra GUI by
setting the "nested_project_location" optional parameter to False
2025-04-30 09:54:57 -04:00
Ryan Kurtz
34f9064788 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-29-25' 2025-04-29 13:44:34 -04:00
dragonmacher
f6d0222e3f test fixes; removed anonymous warnings 2025-04-29 13:36:45 -04:00
Ryan Kurtz
73b743654a Merge remote-tracking branch 'origin/patch' 2025-04-29 12:38:59 -04:00
Ryan Kurtz
be44608fa0 Merge remote-tracking branch 'origin/GP-5626_ghidra1_BookmarkMergeNPE' into patch 2025-04-29 12:35:25 -04:00
ghidra1
8802b2dab0 GP-5626 Corrected Bookmerge merge NPE. Ensure that category and comment
are never null
2025-04-29 11:18:10 -04:00
Ryan Kurtz
ef4e9fee4d Merge remote-tracking branch 'origin/GP-5624_dev747368_gcwritebarrier_flag_dwarf' 2025-04-28 18:52:41 -04:00
dev747368
804210b7eb GP-5624 fix markup of gcwritebarrier enabled flag when dwarf is present
DWARF can lay down a more detailed struct that encompasses the enabled
flag, but it prevents the decompiler from simplifying its output.

This change clears any DWARF struct laid down over the enabled flag.
2025-04-28 20:44:24 +00:00
Ryan Kurtz
af5e744570 Merge remote-tracking branch 'origin/patch' 2025-04-28 15:27:24 -04:00
Ryan Kurtz
2ab014f8c2 Merge remote-tracking branch 'origin/GP-5537_ghidorahrex_avx512_update--SQUASHED' into patch 2025-04-28 15:22:04 -04:00
Ryan Kurtz
02221f03f5 Merge remote-tracking branch 'origin/GP-5625_ghidra007_AddNullChecks'
into patch (Closes #8045)
2025-04-28 15:20:06 -04:00
ghidra007
e4163c60a5 GP-5625 rtti script added some missing null checks 2025-04-28 18:36:37 +00:00
Ryan Kurtz
fb54675cfc Merge remote-tracking branch
'origin/GP-5618-dragonmacher-table-popup-fix--SQUASHED' (Closes #7902)
2025-04-28 14:15:51 -04:00
Ryan Kurtz
af7b333b12 GP-0: Making Project AutoCloseable 2025-04-28 13:55:11 -04:00
Ryan Kurtz
61bb5bcdd0 Merge remote-tracking branch
'origin/GP-5615_ghidragon_execption_in_goto_dialog--SQUASHED'
(Closes #8038)
2025-04-28 13:40:59 -04:00
Ryan Kurtz
f17a9c4607 Merge branch 'GP-0_ryanmkurtz_PR-8043_adriankentsato_remove-installationguide-html' 2025-04-28 12:42:08 -04:00
Ryan Kurtz
1131f02dc8 GP-0: Certify 2025-04-28 12:41:31 -04:00
Ryan Kurtz
9b3b9a851b Merge remote-tracking branch
'origin/GP-5620-dragonmacher-table-duplicate-data' (Closes #8031)
2025-04-28 11:45:18 -04:00
James
35e4d3d4c5 GP-5543 fixed typo 2025-04-28 14:28:39 +00:00
ADonut
b5d58be2ce Decompiler: Enable optimization for C++ source files
Also enable LTCG/LTO.
2025-04-28 14:21:58 +00:00
Kent Adrian Sato
0a2b2b6569
cleanup: updated references to InstallationGuide.html with GettingStarted.md
Removed references to InstallationGuide.html and changed it to GettingStarted.md
2025-04-26 09:40:13 +08:00
dragonmacher
7420c70b2d GP-5618 - Tables - Updated tables so that Ctrl-Left-Click on the Mac does not clear the selection 2025-04-25 16:46:58 -04:00
dragonmacher
8d2c94e28d GP-5620 - Fixed a bug that introduced duplicate data when renaming
functions with a filter
2025-04-25 15:34:48 -04:00
ghidra1
15203337f5 Merge branch 'GP-5586_ghidra1_StackEditorIssues' 2025-04-25 15:33:22 -04:00
ghidra1
72a94daa1d GP-5586 Refactored and fixed function stack frame editor 2025-04-25 15:31:42 -04:00
ghidragon
68bd01cbc1 GP-5615 fixed NPE in GoTo dialog when '\' entered 2025-04-24 16:56:03 -04:00
Ryan Kurtz
4a46edc9fe Merge remote-tracking branch 'origin/patch' 2025-04-24 14:22:15 -04:00
Ryan Kurtz
022318bd4d Merge remote-tracking branch 'origin/GP-5607_d-millar_bad_image_defaults' 2025-04-24 12:58:43 -04:00
ghidorahrex
4f1933c1a3 GP-5537: Added additional AVX512 instructions 2025-04-24 12:57:38 -04:00
Ryan Kurtz
da9f764d78 Merge remote-tracking branch 'origin/GP-5606_d-millar_dbgeng_exc_error'
(Closes #8029)
2025-04-24 12:56:47 -04:00
Ryan Kurtz
e2f7be119a GP-0: Fixing javadoc 2025-04-24 12:14:05 -04:00
Ryan Kurtz
71e7f65d3f Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-23-25' 2025-04-24 09:47:32 -04:00
ghidra1
52c52224e7 Merge remote-tracking branch 'origin/GP-5446_ghizard_lay_down_vxt_types' 2025-04-23 18:02:44 -04:00
ghidra1
7bde88f3cb Merge remote-tracking branch 'origin/GP-5608_ghizard_fix_vxtable_composition_regression' 2025-04-23 18:02:10 -04:00
dragonmacher
10366c08e4 Update key event processing to not fire Java actions, but to instead let
Java handle them.
2025-04-23 14:13:17 -04:00
Ryan Kurtz
4aa78ae6d0 Merge remote-tracking branch
'origin/GP-5453-dragonmacher-decompiler-locations--SQUASHED'
(Closes #7518)
2025-04-23 10:41:54 -04:00
ghizard
1d84859a8d GP-5446 - PDB CPP Lay down vxt types 2025-04-23 07:57:11 -04:00
ghizard
388a1e989b GP-5608 - PDB CPP Fix vxtable composition regression; add in planned
signature compare; adjust tests
2025-04-22 17:09:36 -04:00
ghidra1
1179fc10a0 GP-0 Restored missing release notes for ChangeHistory.md 2025-04-22 15:23:00 -04:00
dragonmacher
14c10409ac GP-5453 - Decompiler - Updated location broadcasting to better navigate the listing 2025-04-22 15:18:09 -04:00
Ryan Kurtz
ac4b4bb5d2 Merge remote-tracking branch 'origin/GP-5603_ghizard_PDB_CPP_nonspeculative_class_layout_when_vbt_not_found--SQUASHED' 2025-04-22 14:13:20 -04:00
ghizard
61025ea48f GP-5603 - PDB CPP nonspeculative class layout when no VBT; modify layout options 2025-04-22 14:05:08 -04:00
Ryan Kurtz
1a7627bd23 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-21-25' 2025-04-22 13:14:46 -04:00
d-millar
9c23ea8f09 GP-5607: don't use tool defaults if you have a prorgam 2025-04-22 12:26:39 -04:00
d-millar
11a7490262 GP-5606: fix for always stopping 2025-04-22 11:30:18 -04:00
Ryan Kurtz
37cdf1fa69 Merge remote-tracking branch 'origin/GP-5524_ghizard_Improve_CPP_PDB_testing_framework--SQUASHED' 2025-04-22 09:22:36 -04:00
ghizard
12d14149f4 GP-5524 - Improve CPP/PDB testing framework 2025-04-22 06:07:37 -04:00
ghidra1
29712e5b74 GP-5605 Handle partially linked ELF SH4 R_SH_DIR32 relocation 2025-04-21 17:51:14 -04:00
dragonmacher
01de3b89dd review fixes 2025-04-21 17:38:58 -04:00
dragonmacher
f57c6f64ac Updated key event processing to let client code have the event before
the docking action system
2025-04-21 16:09:15 -04:00
Ryan Kurtz
a810c384f4 Merge remote-tracking branch 'origin/GP-1-dragonmacher-escape-confirmation' 2025-04-21 14:12:54 -04:00
Ryan Kurtz
ce8835ef7d Merge remote-tracking branch
'origin/GP-5604_James_bsim_overview_listener--SQUASHED' (Closes #7903)
2025-04-21 14:11:55 -04:00
James
e56b4a746b GP-5604 add listener to bsim overview table 2025-04-21 13:01:12 -04:00
Ryan Kurtz
5a2957ff2a Merge remote-tracking branch 'origin/GP-5598_ryanmkurtz_GettingStarted' 2025-04-21 12:02:39 -04:00
Ryan Kurtz
6f6f1fccd4 Merge remote-tracking branch
'origin/GP-5602_dev747368_dwarf_create_func_at_occupied_addr'
(Closes #6866)
2025-04-21 12:01:42 -04:00
Ryan Kurtz
0ee0537e45 GP-5598: Rename InstallationGuide to GettingStarted; put in installation
root dir
2025-04-21 11:58:26 -04:00
Ryan Kurtz
39e5485389 GP-0: Fixing Mach-O DYLD_CHAINED_IMPORT_ADDEND64 weak_import value
(Closes #8023)
2025-04-21 08:40:02 -04:00
Ryan Kurtz
f8ce5b4b3b Merge branch 'GP-0_ryanmkurtz_PR-8025_LukeSerne_fix-typo' 2025-04-21 07:55:21 -04:00
Ryan Kurtz
6730154316 GP-0: Certify 2025-04-21 07:54:19 -04:00
Ryan Kurtz
812b243dbb Merge branch 'GP-0_ryanmkurtz_PR-8024_bdemick_vxworks-symtab-edge-case' 2025-04-21 06:21:25 -04:00
Luke Serné
8303061629 Many typo's
These were found using the command below searching for duplicated words,
and manually going through the results to remove the false positives and
reword the true positives. Sometimes I removed the doubled word and
sometimes I replaced the duplicated word.

The grep command:
grep -nIEr '\b([a-zA-Z]+)[[:space:]*]+\1\b' ./Ghidra
2025-04-19 18:06:41 +02:00
Luke Serné
b7e91e80a2 Fix various "function" typos 2025-04-19 17:20:51 +02:00
dragonmacher
c942158416 Memory Search - Updated the search provider to prompt users before
closing a provider with user-modified results
2025-04-18 19:42:22 -04:00
Ryan Kurtz
23e656ffc0 Merge remote-tracking branch 'origin/GP-5364_Dan_funcGraphPlusBptMarginBugs--SQUASHED' 2025-04-18 13:47:46 -04:00
Dan
20e83f2165 GP-5364: Fix some plugin order bugs. 2025-04-18 17:46:28 +00:00
dev747368
08d9871b85 GP-5602 dwarf: check for conflicting data at func addr 2025-04-18 17:37:06 +00:00
Ryan Kurtz
f65a993d26 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-18-25' 2025-04-18 13:07:29 -04:00
dragonmacher
a052d9e227 Test fixes 2025-04-18 13:06:37 -04:00
Ryan Kurtz
569c47eebb Merge remote-tracking branch 'origin/GP-5264_Dan_pcModFuncColumnsInTime--SQUASHED' 2025-04-18 11:17:35 -04:00
Dan
5743b48101 GP-5264: Add PC, Function, and Module columns to the Time panel 2025-04-18 15:15:17 +00:00
Ryan Kurtz
fdeef97855 Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-04-18-1' 2025-04-18 10:59:09 -04:00
Dan
cdc32441b2 GP-0: Fix several tests from GP-5523. 2025-04-18 13:12:13 +00:00
Ryan Kurtz
712303165a Merge remote-tracking branch 'origin/GP-5570_dev747368_copy_symbols_from_external_reversestripped_debugfiles--SQUASHED' 2025-04-18 06:16:15 -04:00
Ryan Kurtz
bf1659f11d Merge remote-tracking branch 'origin/GP-5599-dragonmacher-shared-key-binding-fix--SQUASHED' 2025-04-18 06:14:45 -04:00
Ryan Kurtz
3143f7ad99 Merge remote-tracking branch 'origin/GP-5110_dev747368_associate_with_archive_action_builtin_datatypes' 2025-04-18 06:13:05 -04:00
Ryan Kurtz
84ef8f685b Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-17-25' 2025-04-18 06:07:20 -04:00
dragonmacher
fa5938ab41 GP-5599 - Fix for shared key bindings to get correctly updated when options are restored at tool load time 2025-04-17 19:43:39 -04:00
dragonmacher
fb76362903 Test fixes 2025-04-17 19:16:58 -04:00
dev747368
c621406c5f GP-5110 don't enable "Associate With Archive" action if built-in dt 2025-04-17 20:36:15 +00:00
Ben Demick
45b91b1818
Fixes VxWorksSymTab_Finder.java edge case
Fixes MemoryAccessException that occurs if a candidate entry goes into invalid memory.
2025-04-17 16:35:37 -04:00
dev747368
07d1280515 GP-5570 copy symbols found in external debug files 2025-04-17 14:57:20 -04:00
Ryan Kurtz
0ea368f36d Merge remote-tracking branch 'origin/GP-5585_dev747368_fsb_nonblocking_project_index--SQUASHED' 2025-04-17 14:23:25 -04:00
Ryan Kurtz
b2829ad6ea Merge remote-tracking branch 'origin/GP-5523_Dan_hexDecToggle--SQUASHED' 2025-04-17 14:21:54 -04:00
Dan
004712026b GP-5523: Allow tool-wide configuration of radix for displaying trace times. 2025-04-17 18:18:53 +00:00
dev747368
a3a0870b66 GP-5585 non blocking project index for the FileSystemBrowser 2025-04-17 10:57:56 -04:00
Ryan Kurtz
92e2b6b5d4 Merge remote-tracking branch
'origin/GP-5494_Dan_fixTraceSlowness--SQUASHED' (Closes #4940)
2025-04-16 06:16:29 -04:00
Ryan Kurtz
8a2a91b562 Merge remote-tracking branch
'origin/GP-5597_ghidra_bad_name_in_search_window_title' (Closes #8015)
2025-04-16 06:12:56 -04:00
Ryan Kurtz
1db3ee3edd Merge remote-tracking branch 'origin/GP-1-dragonmacher-escape-key-updates--SQUASHED' 2025-04-16 06:11:35 -04:00
dragonmacher
d59d6e7d92 Update key processing to have the notion of both valid and enabled 2025-04-15 19:08:17 -04:00
ghidragon
203854966d GP-5597 fixed bug where memory search title with control chars breaks
saving tools.
2025-04-15 16:43:40 -04:00
Dan
2abfd4e309 Merge branch 'patch' 2025-04-15 19:28:11 +00:00
Dan
82e02ada8f GP-0: Increment version to 11.3.3 2025-04-15 19:24:02 +00:00
Dan
e4024bc8cf GP-5494: Fix byte cache and increase number of cached pages (memory viewer). 2025-04-15 18:22:42 +00:00
Dan
3a50304897 GP-0: Updated ChangeHistory for 11.3.2 2025-04-15 15:05:38 +00:00
Ryan Kurtz
a832bc689d Merge remote-tracking branch 'origin/GP-5548_Dan_dynStaticSync--SQUASHED' 2025-04-15 06:58:07 -04:00
ghidra1
749ff08737 Merge remote-tracking branch 'origin/patch' 2025-04-14 19:39:39 -04:00
ghidra1
3c57ea8d5c Merge remote-tracking branch 'origin/GP-5583_emteere_DefaultCaseFlowAndLabels' into patch 2025-04-14 19:35:42 -04:00
emteere
2d19520b4d GP-5583 Code review minor changes 2025-04-14 23:00:57 +00:00
Dan
31f447e8c7 GP-5548: Factor listing synchronization into plugin. 2025-04-14 19:59:26 +00:00
Ryan Kurtz
5fb58661b9 Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-04-14-1' 2025-04-14 09:20:40 -04:00
Dan
7d5e8639d3 GP-0: Fix NPE in DependentServiceResolver 2025-04-14 13:16:46 +00:00
Ryan Kurtz
f00de10f31 Merge remote-tracking branch 'origin/GP-4123_ryanmkurtz_cppexporter'
(Closes #2635)
2025-04-14 08:11:43 -04:00
Ryan Kurtz
90c77317ec Merge remote-tracking branch 'origin/GP-5588_ghizard_PDB_fix_aligned_base_placement_and_create_another_vxtable_location_workaround' 2025-04-14 08:09:51 -04:00
Ryan Kurtz
7559acf524 GP-4123: CppExporter can now emit referenced globals 2025-04-13 08:55:41 -04:00
ghizard
63facf90f1 GP-5588 - PDB CPP - fix aligned base class calc; create another vxtable
locator temp work-around
2025-04-11 15:01:17 -04:00
Ryan Kurtz
13834fabaa Merge branch 'GP-5564_ryanmkurtz_ext' (Closes #5940) 2025-04-11 12:56:19 -04:00
Ryan Kurtz
0ef0447601 Merge remote-tracking branch 'origin/GP-3405_Dan_syncDynamicViews--SQUASHED' 2025-04-11 12:55:14 -04:00
Ryan Kurtz
3c17cc6441 GP-5564: Clicking on Symbol Table Imports with no external linkage no
longer reports an error when it is data
2025-04-11 12:49:11 -04:00
Dan
da89fe5fe9 GP-3405: Emit events and sync for dynamic loc/sel/hl. 2025-04-11 16:43:49 +00:00
Ryan Kurtz
d4049f1d99 Merge remote-tracking branch 'origin/GP-0_ghidragon_4_11_fixing_GTabPanelTest' 2025-04-11 11:14:03 -04:00
ghidragon
c19290bcd5 GP-0 fixing GTabPanelTest 2025-04-11 11:12:06 -04:00
ghidorahrex
a917cc0345 GP-5587: Corrected parsing of AARCH64 dsb instruction 2025-04-11 14:56:38 +00:00
ghidra1
56df61cb0b Merge remote-tracking branch 'origin/patch' 2025-04-11 10:24:24 -04:00
ghidra1
3725eb0b39 Merge branch 'GP-5557_ghidra1_CompositeEditorFixes' into patch 2025-04-11 10:01:09 -04:00
ghidra1
0ef28cb54b GP-5557 Composite editor transaction and update notification fixes 2025-04-11 09:58:01 -04:00
Ryan Kurtz
9778722a7e Merge remote-tracking branch 'origin/GP-4995_ghidorahrex_pcodetest_framework_update--SQUASHED' 2025-04-11 09:32:59 -04:00
Ryan Kurtz
071652e3b9 Merge remote-tracking branch 'origin/patch' 2025-04-11 09:27:40 -04:00
Ryan Kurtz
5746f9330b Merge remote-tracking branch
'origin/GP-5305_ghidorahrex_PR-6336_depili_bugfixes_6809_com_instruction'
into patch (Closes #6336, Closes #5767)
2025-04-11 09:24:11 -04:00
Ryan Kurtz
e57bf92a20 Merge remote-tracking branch
'origin/GP-5131_ghidorahrex_MIPS16e_jump_delayslot_fix' into patch
(Closes #862)
2025-04-11 09:22:01 -04:00
Ryan Kurtz
1b31994fd9 Merge remote-tracking branch 'origin/GP-5011_ghidorahrex_x86_stack_operation_size_fix--SQUASHED' into patch 2025-04-11 09:17:42 -04:00
ghidorahrex
41305fb45e GP-5011: Fixed x86 stack push/pop sizing issues 2025-04-10 14:46:25 -04:00
ghidorahrex
00687c8db8 GP-4995: Updated pcodetest framework to python3 and additional config 2025-04-10 14:44:56 -04:00
Ryan Kurtz
1ef5566219 Merge remote-tracking branch
'origin/GP-5562_James_bsim_h2_script_improvements' (Closes #7897)
2025-04-10 14:31:45 -04:00
Ryan Kurtz
859abab92e Merge remote-tracking branch
'origin/GP-5578_ghidragon_fixing_program_tab_issues--SQUASHED'
(Closes #7915)
2025-04-10 14:20:58 -04:00
Ryan Kurtz
6d0c89f9fd Merge remote-tracking branch
'origin/GP-5584_ghidragon_fixing_toolbar_icon_spacing_issue'
(Closes #7984)
2025-04-10 14:19:03 -04:00
ghidragon
2776560743 GP-5578 fixed sizing issues with with program tabs, including handling case when java scaling factor is not 1 2025-04-10 14:14:24 -04:00
Ryan Kurtz
8b9d65484b Revert "GP-5564: Clicking on Symbol Table Imports with no external linking now takes you to the appropriate external program instead of reporting an error message"
This reverts commit 7b0d88fd23.
2025-04-10 13:57:20 -04:00
ghidragon
5af205707b GP-5584 fixed issue with toolbar icons sometimes getting extra spacing. 2025-04-10 13:34:04 -04:00
emteere
65409daa6f GP-5583 fixed default switch case labels and removed default case
address from switching instruction
2025-04-10 17:29:18 +00:00
Ryan Kurtz
b5e404f499 Merge remote-tracking branch 'origin/patch' 2025-04-10 09:27:23 -04:00
Ryan Kurtz
9b5080adcf Merge remote-tracking branch 'origin/GP-5577_dev747368_fsb_projectindexing' into patch 2025-04-10 09:24:30 -04:00
ghidra1
1044bf5f7e Merge remote-tracking branch 'origin/patch' 2025-04-09 20:46:42 -04:00
ghidra1
7c67a103cd GP-5580 Corrected Union editor issue with shift up/down and create
array.  Removed obsolete method within editor model.
2025-04-09 19:14:13 -04:00
dev747368
96e0532f8d GP-5577 avoid indexing large projects 2025-04-09 18:04:30 +00:00
Ryan Kurtz
313f2d2847 Merge remote-tracking branch
'origin/GP-5540_Dan_guardAgainstNullTraceManager' (Closes #7956)
2025-04-09 13:38:41 -04:00
Ryan Kurtz
703c2b37bd Merge remote-tracking branch 'origin/GP-4080_Dan_cxBusyIndicator--SQUASHED' 2025-04-09 13:36:52 -04:00
Ryan Kurtz
50a0bcd050 GP-0: Removing shorthand -c and -d command line args from
pyghidra_launcher.py...they interfered with some AnalyzeHeadless args
2025-04-09 13:35:25 -04:00
Dan
5f1581b417 GP-4080: Display 'lock' overlay when cx/target has a transaction. 2025-04-09 17:33:16 +00:00
Ryan Kurtz
680134df84 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fix-4-9-25' 2025-04-09 13:30:21 -04:00
dragonmacher
b2372dab97 Test fixes 2025-04-09 13:28:27 -04:00
Ryan Kurtz
327940b252 Merge remote-tracking branch
'origin/GP-5030_James_x87_floating_point_display--SQUASHED'
(Closes #6786)
2025-04-09 11:02:46 -04:00
Ryan Kurtz
8ee341cd65 Merge remote-tracking branch 'origin/GP-5576_ghizard_set_vxtable_alignment_and_packing' 2025-04-09 11:01:30 -04:00
Ryan Kurtz
1c1684de37 Merge remote-tracking branch 'origin/GP-5575_ghizard_fix_zero_sized_base_class_regression' 2025-04-09 11:00:18 -04:00
James
7909f63fc5 GP-5562 added checks to AddProgramToH2BSimDatabaseScript 2025-04-09 14:39:00 +00:00
Dan
8d7d13fac3 GP-5540: Guard TraceTabPanel against null traceManager during disposal. 2025-04-09 14:27:27 +00:00
James
30008b6715 GP-5030 improved x87 operand display 2025-04-09 10:04:02 -04:00
Ryan Kurtz
a5bd358564 Merge remote-tracking branch
'origin/GP-616_Dan_expWithMultipleTypeManagers--SQUASHED' (Closes #4127)
2025-04-09 09:35:08 -04:00
Dan
ed48b0e452 GP-616: Fix 32-bit pointer placement in WoW64 targets. 2025-04-09 13:27:49 +00:00
Ryan Kurtz
b8996c89be Merge remote-tracking branch 'origin/patch' 2025-04-09 06:28:40 -04:00
Ryan Kurtz
baef3c9b6c Merge remote-tracking branch 'origin/GP-5564_ryanmkurtz_ext--SQUASHED'
(Closes #5940)
2025-04-09 06:10:14 -04:00
Ryan Kurtz
7b0d88fd23 GP-5564: Clicking on Symbol Table Imports with no external linking now takes you to the appropriate external program instead of reporting an error message 2025-04-09 06:06:11 -04:00
ghizard
3b37ca1422 GP-5576 - PDB set vxtable alignment and packing 2025-04-09 06:00:38 -04:00
ghizard
9b96306f80 GP-5575 - PDB fix regression in using zero-sised base with no vbtable 2025-04-09 05:54:32 -04:00
ghidra1
2c5669dbd0 GP-0 Minor cleanup 2025-04-08 15:15:53 -04:00
ghidra1
b5ccf1f063 GP-0 Expose StandAloneDataTypeManager from
DataTypeArchive.getDataTypeManager to allow architecture manipulation
2025-04-08 14:57:51 -04:00
Ryan Kurtz
27394cfb9c Merge remote-tracking branch
'origin/GP-5572-dragonmacher-decompiler-action-dialog--SQUASHED'
(Closes #7893)
2025-04-08 14:51:45 -04:00
dragonmacher
7bd553d55d GP-5572 - Decompiler - Updated actions to not show warning dialog if executed while the Decompiler is busy 2025-04-08 14:26:12 -04:00
Ryan Kurtz
55b2667996 Merge remote-tracking branch 'origin/patch' 2025-04-08 06:15:40 -04:00
Ryan Kurtz
694b3b46ce GP-0: Fixing typo in patch directory README 2025-04-08 06:08:12 -04:00
Ryan Kurtz
f1a135d8bb Merge remote-tracking branch
'origin/GP-5326_ghidragon_adding_address_and_data_options'
(Closes #7407)
2025-04-07 14:53:12 -04:00
Ryan Kurtz
499b9d7a8f Merge remote-tracking branch
'origin/GP-2307-dragonmacher-fcg-name-truncation-option' (Closes #1684)
2025-04-07 13:06:17 -04:00
dragonmacher
e9fb18faee GP-5326 - Decompiler - Added a quick field edit action to the Decompiler 2025-04-07 12:54:20 -04:00
Ryan Kurtz
e8f539f622 GP-0: Styling HTML headings in converted Markdown files 2025-04-07 12:22:47 -04:00
Ryan Kurtz
768788c078 Merge branch 'GP-0_ryanmkurtz_PR-7989_gemesa_debugger-step-inst' 2025-04-07 11:39:15 -04:00
Ryan Kurtz
fc3a242a5d GP-0: Styling HTML code blocks in converted Markdown files 2025-04-07 11:26:44 -04:00
Ryan Kurtz
c91b82f9f0 Merge remote-tracking branch 'origin/GP-5535_ryanmkurtz-svrREADME' 2025-04-07 10:57:35 -04:00
Ryan Kurtz
5f9674ccee GP-5535: Converting svrREADME.html to Markdown 2025-04-07 10:39:46 -04:00
Andras Gemes
6d5a061290
Debugger: fix description of step_into 2025-04-07 13:55:11 +02:00
Ryan Kurtz
c75c852001 Merge remote-tracking branch
'origin/GP-5565-dragonmacher-decompiler-rename-label-action'
(Closes #7507)
2025-04-07 06:12:08 -04:00
dragonmacher
8785636939 GP-2308 - Function Call Graph - Added an option to disable name
truncation.
2025-04-05 12:37:45 -04:00
dragonmacher
812b02652d GP-5565 - Decompiler - Updated the edit label dialog to pick the correct
namespace for an existing symbol
2025-04-04 19:25:22 -04:00
Ryan Kurtz
8441563165 Merge remote-tracking branch
'origin/GP-5538_Dan_addImageFieldToRemotes--SQUASHED' (Closes #7955)
2025-04-04 13:22:06 -04:00
Ryan Kurtz
ba0fb6a07c Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-04-04-1' 2025-04-04 13:18:54 -04:00
Dan
b7570e1f52 GP-5538: Add 'Image' to remote-[gdb,lldb].*. Convert to powershell. 2025-04-04 17:15:41 +00:00
Dan
bcc932d7a8 GP-0: Fix tests. 2025-04-04 17:09:35 +00:00
Ryan Kurtz
0878da155c Merge remote-tracking branch 'origin/GP-5301_Dan_testEmuThumbPlt' 2025-04-04 12:51:15 -04:00
Dan
b702aa0a6f GP-5301: Fix ARM/THUMB ISA mode switching for indirect branches in JIT. 2025-04-04 16:18:36 +00:00
Ryan Kurtz
a0205ff960 Merge remote-tracking branch 'origin/patch' 2025-04-04 12:13:50 -04:00
Ryan Kurtz
a9f26d8f84 Merge remote-tracking branch
'origin/GP-5569_ryanmkurtz_extension-classpath' into patch (Also
closes #7977)
2025-04-04 12:09:48 -04:00
Ryan Kurtz
cee2cb3b44 GP-5569: Fixing an issue with external extension classpath order 2025-04-04 12:02:39 -04:00
Ryan Kurtz
82c344acde Merge remote-tracking branch 'origin/patch' 2025-04-04 10:05:31 -04:00
d-millar
482b4775b9 GP-5534: Backporting protobuf version change (3.17->3.21) 2025-04-04 10:03:30 -04:00
Ryan Kurtz
7c71be972a Merge remote-tracking branch 'origin/patch' 2025-04-03 14:13:39 -04:00
Ryan Kurtz
77edcc0985 GP-5567: Updating svrREADME.html's section on macOS Full Disk Access
(Closes #7934)
2025-04-03 14:08:01 -04:00
Ryan Kurtz
1fb758e5ae Merge remote-tracking branch 'origin/patch' 2025-04-03 13:18:59 -04:00
Ryan Kurtz
db2dee2a12 Merge remote-tracking branch
'origin/GP-5561_James_source_file_path_parse_error_fix' into patch
(Closes #7963)
2025-04-03 13:16:50 -04:00
James
861c0c93d4 GP-5561 correct dwarf source file path parsing error 2025-04-03 14:12:45 +00:00
Ryan Kurtz
c4314cebc1 Merge remote-tracking branch 'origin/patch' 2025-04-03 09:35:54 -04:00
Ryan Kurtz
f3cd8f54b8 Merge remote-tracking branch 'origin/GP-0-dragonmacher-patch-test-fixes-4-2-25' into patch 2025-04-03 09:33:46 -04:00
Ryan Kurtz
26fe882311 GP-0: Fixing javadoc error 2025-04-03 06:35:43 -04:00
dragonmacher
c22d88cf7c test fixes; put some replacments back 2025-04-02 13:53:53 -04:00
Ryan Kurtz
4192e94151 Merge remote-tracking branch 'origin/GP-5559_ghizard_PDB_Work_around_locating_primary_vxt_by_symbol--SQUASHED' 2025-04-02 13:35:31 -04:00
Ryan Kurtz
fa87e70af4 Merge remote-tracking branch
'origin/GP-0_ryanmkurtz_PR-7957_peterbelm_omf51-libfs' (Closes #7957)
2025-04-02 13:34:14 -04:00
Ryan Kurtz
8701d22356 GP-0: Certify and cleanup 2025-04-02 13:26:21 -04:00
Ryan Kurtz
7c1285d48d GP-0: A few buildExtenion.gradle tweaks
* Excluding .vscode/ from the distro
* Only including src/main/java in lib/*-src.zip
2025-04-02 11:39:13 -04:00
ghizard
c32bc2a129 GP-5559 - PDB - Work around issue with finding primary vxt by symbol 2025-04-02 11:24:33 -04:00
Ryan Kurtz
7f889d7812 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-4-2-25' 2025-04-02 10:00:36 -04:00
dragonmacher
413cd88a87 test fixes 2025-04-02 09:56:49 -04:00
Ryan Kurtz
90a16f9963 GP-0: Certify 2025-04-02 09:21:37 -04:00
Ryan Kurtz
7c1f73d6e2 GP-0: Tidying up Mach-O things 2025-04-02 07:22:00 -04:00
Ryan Kurtz
e4036f04b9 Merge remote-tracking branch 'origin/patch' 2025-04-02 06:21:53 -04:00
Sullivan DeVries
f29fb24ee8 GP-5558: fixed ndata post-increment instead of pre-increment causing
return case to be missed (Closes #7973, Closes #7974)
2025-04-02 06:18:26 -04:00
Ryan Kurtz
06e4d8783f Merge remote-tracking branch 'origin/patch' 2025-04-02 06:02:08 -04:00
ghidra1
59c55fdb6b GP-5556 Corrected structure editor transaction error on launch 2025-04-01 17:08:50 -04:00
Ryan Kurtz
97134cd8fa Merge remote-tracking branch 'origin/GP-5550_ghidra1_GTreeStartEditingTaskSelection--SQUASHED' 2025-04-01 14:50:17 -04:00
Ryan Kurtz
cd3ba7fb07 GP-5554: Fixed a bug that resulted in incorrect external addresses of
Mach-O undefined symbols (Closes #5941)
2025-04-01 13:12:18 -04:00
ghidra1
168fce3eda GP-5550 Revised GTreeStartEditingTask node re-selection 2025-04-01 12:34:09 -04:00
Ryan Kurtz
58979e0bfb Merge remote-tracking branch 'origin/GP-5552_ryanmkurtz_ub' 2025-04-01 11:54:21 -04:00
Ryan Kurtz
c611f6e5d2 Merge remote-tracking branch 'origin/patch' 2025-04-01 11:54:04 -04:00
Ryan Kurtz
88b9fd3481 Merge remote-tracking branch
'origin/GP-5549_NullCheck_VTMatchWithAddressNotInMemory' into patch
(Closes #7964)
2025-04-01 11:50:36 -04:00
Ryan Kurtz
87fdda4981 GP-5552: Universal Binary Mach-O Loader 2025-04-01 11:22:26 -04:00
Ryan Kurtz
30f30149f3 Merge remote-tracking branch 'origin/patch' 2025-04-01 09:21:24 -04:00
Ryan Kurtz
ecb4d0d92d Merge remote-tracking branch 'origin/GP-5503-dragonmacher-gnu-demangler-simplify-update' into patch 2025-04-01 09:10:26 -04:00
Ryan Kurtz
d4b7f3504f Merge remote-tracking branch 'origin/GP-5466_d-millar_gdb_evt_exc_RB250331--SQUASHED' 2025-04-01 09:01:56 -04:00
Ryan Kurtz
f0f0f8a86b Merge remote-tracking branch 'origin/GP-5546_d-millar_standalone_listener' 2025-04-01 09:00:23 -04:00
Ryan Kurtz
a9122c1a59 Merge remote-tracking branch 'origin/GP-4786_d-millar_dbgeng_events_RB250331--SQUASHED' 2025-04-01 08:57:59 -04:00
Ryan Kurtz
96786024b1 Merge remote-tracking branch 'origin/GP-5438_Dan_fixSelectAllDynamic--SQUASHED' 2025-04-01 08:56:01 -04:00
Ryan Kurtz
5297954c6c Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-20250331-1' 2025-04-01 08:54:03 -04:00
Dan
d7f63a9075 GP-5438: Fix 'Select All' and others in Dynamic Listing. (syncing needs follow-up work.) 2025-04-01 12:48:30 +00:00
d-millar
7447fc621b GP-4786: format
GP-4786: running
GP-4786: more from review
GP-4786: post-review
GP-4786: types
GP-4786: events listing
GP-4786: savingGP-4786: how to pass an arrayGP-4786: exceptionsGP-4786: refresh methodsGP-4786: first half toggleGP-4786: toggle workingGP-4786: combining arb/spc
2025-03-31 18:20:10 -04:00
ghidra007
f37eac9a82 GP-5549 added cu null check for case where address is not in memory. 2025-03-31 19:51:59 +00:00
Dan
e746694706 GP-0: Fix panel default to provider default. Fix tests. 2025-03-31 18:56:26 +00:00
d-millar
ccc2a1ddaf GP-5466: post-review
GP-5466: types
GP-5466: additional methods
2025-03-31 13:52:05 -04:00
Ryan Kurtz
7ab4989d4b Merge branch 'GP-5547_ryanmkurtz_gradle-clang' (Closes #7958) 2025-03-31 13:48:20 -04:00
Ryan Kurtz
d6cfb2e0b9 GP-5547: Improved Gradle support for building natives on AARCH64 2025-03-31 13:04:36 -04:00
Ryan Kurtz
f2890f02dd GP-0: Fixing Gradle warning 2025-03-31 07:57:50 -04:00
Ryan Kurtz
8527ce64b6 Merge remote-tracking branch 'origin/GP-0_ghidraffe_GhidraGoTestFix' 2025-03-31 07:35:03 -04:00
ghidraffe
3f61c478b3 GP-0 fix test issue for GhidraGo 2025-03-31 11:34:05 +00:00
Ryan Kurtz
c4fefb5924 Merge remote-tracking branch 'origin/GP-5536-dragonmacher-vt-tool-issue--SQUASHED' 2025-03-31 06:07:36 -04:00
Ryan Kurtz
e3958c3904 Merge remote-tracking branch 'origin/GP-5528_dev747368_fix_toggleopenclosed_data_task_progress' 2025-03-31 06:06:12 -04:00
Ryan Kurtz
e903eed362 Merge remote-tracking branch 'origin/GP-0_d-millar_fix_for_tests' 2025-03-31 06:05:10 -04:00
Peter Belm
64b6a358a0 FEAT: OMF-51 Library filesystem 2025-03-29 22:59:14 +00:00
dragonmacher
1f0fae0ffc GP-5503 - Demangler - Removed some namespace simplifications to prevent
class conflicts
2025-03-29 12:25:05 -04:00
ghidra1
22460b41d6 GP-0 Improved some unsupported content error handling. 2025-03-28 18:06:04 -04:00
dragonmacher
f7dc225c38 GP-5536 - Version Tracking - Fixed issue with incorrect plugins being loaded from saved tool 2025-03-28 17:35:33 -04:00
d-millar
be98f20ed0 GP-5546: standalone listener 2025-03-28 17:30:04 -04:00
d-millar
d5f29b47d6 GP-0: more from unit tests 2025-03-28 20:33:46 +00:00
d-millar
e19ff2a739 GP-0: test errors 2025-03-28 20:08:45 +00:00
Ryan Kurtz
8ca0372831 Merge remote-tracking branch 'origin/GP-0_ghidragon_fixing_a_few_lines_of_outdated_help' 2025-03-28 15:58:18 -04:00
ghidragon
3451b18061 GP-0 fixing a few lines of outdated help info. 2025-03-28 15:56:23 -04:00
Ryan Kurtz
b319b3df7f Merge remote-tracking branch 'origin/GP-5534_BSim_protobuf_upgrade' 2025-03-28 14:34:39 -04:00
Ryan Kurtz
9d379a3717 Merge remote-tracking branch 'origin/GP-5542_d-millar_bad_annot' 2025-03-28 14:33:22 -04:00
Ryan Kurtz
eb9db12ae0 Merge remote-tracking branch 'origin/GP-5539_d-millar_fullmem_lldb'
(Closes #7955)
2025-03-28 14:31:28 -04:00
Ryan Kurtz
c98abe17b4 Merge remote-tracking branch 'origin/GP-5504_ghidraffe_GhidraGoCliImprovements--SQUASHED' 2025-03-28 14:29:54 -04:00
ghidraffe
cdf4a51725 GP-5504 improved GhidraGo CLI with usage message and GhidraURL validation. 2025-03-28 18:27:50 +00:00
Ryan Kurtz
779f90860b GP-0: Making headless run configuration run in java headless mode 2025-03-28 07:29:17 -04:00
d-millar
7c7d203342 GP-5542: bad annotation 2025-03-27 19:10:25 +00:00
d-millar
f5df0a5de4 GP-5539: default to fullmem 2025-03-27 17:17:59 +00:00
Ryan Kurtz
24f46bb22c GP-5515: Follow-on commit to address bug (all PE's being id's as Rust) 2025-03-27 12:17:40 -04:00
Ryan Kurtz
074417eab8 Merge branch 'GP-0_ryanmkurtz_PR-7914_peterbelm_omf51' 2025-03-27 11:28:38 -04:00
Ryan Kurtz
0105f68329 GP-0: OMF-51 PR tweaks 2025-03-27 11:25:04 -04:00
Ryan Kurtz
2b99f5d15e Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-3-27-25' 2025-03-27 11:03:05 -04:00
dragonmacher
86f2874e3b Test fixes 2025-03-27 10:21:11 -04:00
Ryan Kurtz
b734df8129 Merge remote-tracking branch 'origin/GP-5499_Dan_timeTimeColumn--SQUASHED' 2025-03-27 09:37:52 -04:00
Ryan Kurtz
da477560a1 Merge remote-tracking branch 'origin/GP-5511_d-millar_drgn_types--SQUASHED' 2025-03-27 09:36:22 -04:00
Ryan Kurtz
eb45b79fd0 Merge remote-tracking branch 'origin/patch' 2025-03-27 09:35:27 -04:00
Ryan Kurtz
fe9acef391 Merge remote-tracking branch 'origin/GP-5522_Dan_orderLifeSetSpans' into patch 2025-03-27 09:31:43 -04:00
Ryan Kurtz
7e3395dc62 Merge remote-tracking branch 'origin/GP-5530_ryanmkurtz_maploader'
(Closes #7945)
2025-03-27 06:15:43 -04:00
Ryan Kurtz
2b34e8c9f7 Merge remote-tracking branch 'origin/patch' 2025-03-27 06:14:39 -04:00
Ryan Kurtz
a5caa4886d Merge remote-tracking branch
'origin/GP-0_d-millar_fix_for_spaces_in_paths' into patch (Closes #7943)
2025-03-27 06:12:42 -04:00
Dan
97e6205802 GP-5522: Order LifeSet.spans() 2025-03-26 19:57:34 +00:00
d-millar
5d4b56b7e4 GP-5511: final review set
GP-5511: post-re-review
GP-5511: fix for require_tx bug
GP-5511: minor fixes
GP-5511: fixups using vscode - something broken
GP-5511: finsihing up
GP-5511: most things covered
GP-5511: commands (first pass)
GP-5511: arch
2025-03-26 15:32:11 -04:00
d-millar
0b5a833339 GP-0: fix for spaces in paths 2025-03-26 15:19:00 -04:00
Dan
9016ed28f1 GP-5499: Add 'Time' column to Time table. 2025-03-26 19:03:51 +00:00
d-millar
11fe2a4ab7 GP-5534: 3.17->3.21 2025-03-26 18:26:10 +00:00
Ryan Kurtz
d11682d405 Merge remote-tracking branch 'origin/GP-5496_ryanmkurtz_headless-markdown' 2025-03-26 14:22:25 -04:00
Ryan Kurtz
b1f6fce9c5 Merge remote-tracking branch 'origin/GP-5421_ghidra1_ZeroLengthComponentMerge' 2025-03-26 14:05:53 -04:00
Ryan Kurtz
9f12dbebf1 GP-5532: Fixed an issue in the Mach-O loader that prevented
uninitialized segments from being mapped into memory (Closes #7949)
2025-03-26 13:06:16 -04:00
Ryan Kurtz
9a739ad311 GP-5530: The MapLoader now parses and applies the symbols found in the
"Static symbols" section of a MAP file
2025-03-26 11:06:32 -04:00
ghidra1
1a80aff30a GP-0 Corrected test issues 2025-03-26 10:36:32 -04:00
Ryan Kurtz
f2e8afff9c Merge remote-tracking branch
'origin/GP-5474-dragonmacher-symbol-tree-events--SQUASHED'
(Closes #7889, Closes #7891)
2025-03-26 09:09:07 -04:00
ghidra1
5cd0862969 GP-5527 Added structure unpack support for zero-length component edge
case
2025-03-26 07:30:23 -04:00
Ryan Kurtz
e594438eda Merge remote-tracking branch 'origin/patch' 2025-03-26 06:18:02 -04:00
Ryan Kurtz
83098ce2b5 Merge remote-tracking branch 'origin/GP-0_ghizard_RN_fixes' into patch 2025-03-26 06:15:10 -04:00
ghizard
163d96af2d GP-0 RN doc fixes 2025-03-26 06:11:15 -04:00
ghidra1
fe944640b9 GP-5421 Ensure merge inserts structure components in the correct
sequence to account for zero-length overlapping components. Refactor how
dataTypeDeleted and dataTypeReplaced are handled.  Use blocking error
message popup during most Merge operations.
2025-03-26 06:11:03 -04:00
ghidra1
dcc87e7fb7 GP-5527 Sturcture component unpack bug 2025-03-25 22:37:26 -04:00
ghidra1
877ff2e8ad Merge remote-tracking branch 'origin/GP-5527_ghidra1_StructureEdtorUnpackAction' 2025-03-25 18:52:43 -04:00
ghidra1
b2d85bd1c6 Merge remote-tracking branch 'origin/GP-4951_ghidra1_ZeroLengthComponentActions' 2025-03-25 18:52:17 -04:00
ghidra1
cac6b83929 Merge remote-tracking branch 'origin/patch' 2025-03-25 18:51:29 -04:00
ghidra1
52e02bf012 GP-5527 Structure editor unpack action improvement and zero-length
component fix
2025-03-25 18:44:32 -04:00
ghidra1
584026d817 GP-4951 Corrected structure editor component actions related to 0-length
components and arrays.
2025-03-25 17:24:48 -04:00
ghidra1
23b60335ca GP-0 Corrected DbViewerPlugin_Refresh help warning 2025-03-25 16:45:28 -04:00
dev747368
21aadafacf GP-5528 fix toggle data open/closed to not use task thread
Causes unnecessary progress dialog.  Also improve where the cursor is
left when collapsing something when the cursor is on a child field.
2025-03-25 20:07:38 +00:00
ghidragon
b7a23cacd4 GP-5326 adding "Add Date" and "Add Address" to edit data field dialog 2025-03-25 14:20:30 -04:00
Ryan Kurtz
1bed582491 Merge remote-tracking branch 'origin/patch' 2025-03-25 14:17:57 -04:00
Ryan Kurtz
1865142776 Merge remote-tracking branch 'origin/GP-5517_Dan_addStackToEmuSchema' into patch 2025-03-25 14:15:07 -04:00
dragonmacher
5f17963eba GP-5474 - Symbol Tree - Event handling improvements to maintain user view position; added an option for org node group threshold; Fixed missing nodes under classes 2025-03-25 14:14:03 -04:00
Dan
2261fde014 GP-5517: Add Stack/Frames to "pure emulation" schema. 2025-03-25 18:03:30 +00:00
Ryan Kurtz
907e5c563f GP-5521: pyghidra.open_program() now accepts a program_name parameter,
which can be used to override the program name derived from the
binary_path parameter
2025-03-25 13:44:04 -04:00
ghidra1
3acd4aede7 GP-0 Corrected spelling error 2025-03-25 13:11:06 -04:00
Ryan Kurtz
7ca36e01d9 Merge remote-tracking branch 'origin/GP-5436_Dan_torchAsyncComm--SQUASHED' 2025-03-25 12:46:21 -04:00
Dan
14d0432554 GP-5436: Move AsyncComm remains into Generic 2025-03-25 16:44:37 +00:00
Ryan Kurtz
587571ea4f Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-03-25-2' 2025-03-25 12:13:29 -04:00
Ryan Kurtz
39aa8542cd GP-0: Fixing javadoc 2025-03-25 12:08:02 -04:00
ghidra1
67c11735e6 GP-0 Corrected documention error 2025-03-25 12:06:51 -04:00
Dan
d95b8a20b2 GP-0: Correct viewport tests now with implied snap-0 post GP-4209 2025-03-25 13:28:55 +00:00
Dan
ee0a031261 GP-0: Correct assertions for new packet format post GP-4209 2025-03-25 13:22:05 +00:00
Ryan Kurtz
397a814f5f Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-03-25-1' 2025-03-25 09:15:47 -04:00
Dan
422372a69e GP-0: Try python3 first. 2025-03-25 13:12:12 +00:00
Dan
d35e321e9c GP-0: Ensure OS check happens first. 2025-03-25 13:04:33 +00:00
Ryan Kurtz
5d50b6236a Merge remote-tracking branch 'origin/GP-0_Dan_buildFixes-2025-03-25-1' 2025-03-25 08:57:19 -04:00
Dan
df74c44dd6 GP-0: Fix help sort-groups post 0a30e924 and GP-870 2025-03-25 12:48:30 +00:00
Ryan Kurtz
8f30c4da14 Merge remote-tracking branch 'origin/GP-870_d-millar_TimeOverview_RB250303--SQUASHED' 2025-03-25 06:39:36 -04:00
Ryan Kurtz
01652d9ba1 Merge remote-trackng branch 'origin/patch' 2025-03-25 06:37:02 -04:00
Ryan Kurtz
39cf3a794a Merge remote-tracking branch 'origin/GP-5460_Dan_fixIndirectsInInjects' into patch 2025-03-25 06:18:26 -04:00
Ryan Kurtz
e2103ebda4 Merge remote-tracking branch 'origin/GP-5459_Dan_fixEmptyStructuredOps' into patch 2025-03-25 06:16:45 -04:00
Dan
f0a9e138e2 GP-5460: Fix branching from injected p-code in emulation. 2025-03-24 20:04:23 +00:00
d-millar
c9ba81bd3d GP-870: oops
GP-870: help
GP-870: object restore
GP-870: slight refactoring
GP-870: first pass
GP-870: preliminary codeGP-870: partially functionalGP-870: simplificationsGP-870: added selectionGP-870: refactored somewhatGP-870: minor additionsGP-870: fix for post-rebase errorGP-870: rebaseGP-870: mods to match memviewGP-870: address -> snapGP-870: less brokenGP-870: better colors, shift dragGP-870: general post-review clean-upGP-870: changes lost, maybe restoredGP-870: minor improvementsGP-870: better selection logic
2025-03-24 15:47:10 -04:00
Ryan Kurtz
8fcda62c5b Merge remote-tracking branch 'origin/GP-0_d-millar_memview_mods' 2025-03-24 15:20:08 -04:00
Dan
852db3a80a GP-5459: For userop libraries, treat empty as empty, not unimpl 2025-03-24 19:19:06 +00:00
Ryan Kurtz
8d18be9e39 Merge remote-tracking branch 'origin/GP-4611_d-millar_better_launch_defaults' 2025-03-24 15:18:47 -04:00
Ryan Kurtz
a416ca7bad Merge remote-tracking branch 'origin/GP-4209_Dan_ttdIntegration--SQUASHED' 2025-03-24 15:14:13 -04:00
Dan
21a1602579 GP-4209: GhidraTime-MSTTD integration. Type hints for (most) Python agents. 2025-03-24 18:28:07 +00:00
Ryan Kurtz
bd60eda15e Merge remote-tracking branch 'origin/GP-5458_ryanmkurtz_project-lock--SQUASHED' 2025-03-24 14:06:03 -04:00
Ryan Kurtz
87c4b19b84 GP-5458: Fixing repetitive project lock dialogs 2025-03-24 14:05:20 -04:00
Ryan Kurtz
b06e992e91 Merge remote-tracking branch 'origin/GP-5074_ghizard_CPP_PDB_vxtable_composition_squashrebase20250318--SQUASHED' 2025-03-24 10:58:42 -04:00
Ryan Kurtz
4519440f53 GP-0: Removing 'numSections' parameter from SegmentCommand.create(),
since creating sections is not supported (Closes #7428)
2025-03-24 10:56:24 -04:00
ghidra1
deb49d5322 Merge remote-tracking branch 'origin/patch' 2025-03-24 09:57:16 -04:00
ghidra1
6b24b84bd8 Merge remote-tracking branch 'origin/GP-5519_ghidra1_FileSystemErrorHandling' into patch 2025-03-24 09:49:49 -04:00
ghidra1
b1c6beb494 GP-5519 Improved handling of unsupported project files and smooth over
project content incompatibilities that may arise
2025-03-24 09:39:55 -04:00
ghizard
edb277177d GP-5074 - CPP PDB vxtable datatype composition 2025-03-24 06:51:40 -04:00
Ryan Kurtz
e2132136c7 Merge remote-tracking branch 'origin/GP-5515_ryanmkurtz_rust-search'
(#7885)
2025-03-21 18:24:29 -04:00
Ryan Kurtz
7cb5e844b3 Merge remote-tracking branch 'origin/GP-5514_dev747368_fix_golang_itab_fun_field_lookup' 2025-03-21 16:14:53 -04:00
Ryan Kurtz
3f337a76ba Merge remote-tracking branch 'origin/patch' 2025-03-21 16:14:23 -04:00
Ryan Kurtz
ed8898cbbb Merge remote-tracking branch 'origin/GP-5505_ghidra007_RTTIscript_improveLowBitCodeModeUsage--SQUASHED' into patch 2025-03-21 15:12:46 -04:00
Ryan Kurtz
cb949f275a GP-5515: Faster Rust signature search 2025-03-21 14:44:25 -04:00
ghidra007
2f83e26c0e GP-5505 Improved RecoverClassesFromRTTIScript abilty to use the LowCodeModeBit to find code references. 2025-03-21 18:40:16 +00:00
Ryan Kurtz
cdd68cc791 Merge branch 'GP-5429_ryanmkurtz_reexport-obj-fix' 2025-03-21 13:18:27 -04:00
Ryan Kurtz
e514c63b7f Merge remote-tracking branch
'origin/GP-5373_dev747368_golang_gcwritebarrier_flag' (Closes #7484)
2025-03-21 13:16:46 -04:00
Ryan Kurtz
1345dbb192 GP-5429: Reexport fix for Mach-O object files where header is not at
imagebase
2025-03-21 12:50:49 -04:00
dev747368
937b1035c9 GP-5514 fix hard coded struct field ordinal for golang 1.23+ 2025-03-21 16:42:30 +00:00
Ryan Kurtz
69a66e0eec Merge remote-tracking branch 'origin/patch' 2025-03-21 06:12:55 -04:00
dev747368
aea65727fe GP-5373 markup golang's runtime.writeBarrier flag 2025-03-20 22:59:42 +00:00
ghidra1
5eb247f5cd GP-0 Corrected test screenshot failure 2025-03-20 14:51:29 -04:00
Ryan Kurtz
23d45e44e9 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-3-20-25' 2025-03-20 14:26:45 -04:00
dragonmacher
c02a321aef Test fixes 2025-03-20 14:25:03 -04:00
Ryan Kurtz
9fb80d2c0a Merge remote-tracking branch 'origin/patch' 2025-03-20 13:55:18 -04:00
Ryan Kurtz
122bd22317 Merge remote-tracking branch 'origin/GP-5502_ghidra007_rtti_gcc_verify_typeinfonames_are_strings--SQUASHED' into patch 2025-03-20 13:39:10 -04:00
Ryan Kurtz
85b24c686d Merge branch 'GP-0_ryanmkurtz_PR-7885_cyberkaida_stripped-rust-detect' 2025-03-20 13:28:59 -04:00
Ryan Kurtz
fa41bb3556 GP-0: Certify 2025-03-20 13:27:23 -04:00
ghidra007
24556abe4b GP-5502 added extra typeinfo validation by checking that typeinfoname is a string 2025-03-20 16:29:28 +00:00
ghidra1
22f36c2769 Merge branch 'GP-5480_ghidra1_ExternalLocationMerge_Fixes' 2025-03-20 09:38:15 -04:00
ghidra1
5aec479fb2 GP-5480 Additinal improvement/fixes for ExternalLocation merge support
to address test failures.
2025-03-20 09:37:05 -04:00
Ryan Kurtz
6cc201b572 Merge remote-tracking branch
'origin/GP-3182_ryanmkurtz_PR-5004_colinbourassa_unix-aout-loader'
(Closes #4943, Closes #5004)
2025-03-19 16:17:56 -04:00
Ryan Kurtz
6beee36e57 GP-3182: Certify and cleanup 2025-03-19 14:27:46 -04:00
Ryan Kurtz
b3ed5feaea Merge remote-tracking branch 'origin/patch' 2025-03-19 13:16:18 -04:00
Ryan Kurtz
fa554361d5 Merge remote-tracking branch 'origin/GP-5485-dragonmacher-union-editor-ordinal-col' into patch 2025-03-19 13:10:06 -04:00
Ryan Kurtz
595e66d698 Merge remote-tracking branch 'origin/GP-5501_ghidra007_gcc_rtti_improve_typeinfoStruct_validation' into patch 2025-03-19 13:08:49 -04:00
Ryan Kurtz
8d010a877c Merge remote-tracking branch
'origin/GP-5500_ghidra007_addValidBlockCheckForVftableAddresses' into
patch (Closes #7927)
2025-03-19 13:07:35 -04:00
Colin Bourassa
c9ab679e53 Feature: UNIX A.out Loader
With fixes/improvements from Jean-Baptiste Boric:
* fix package declarations
* don't special-case defined symbols with zero value
a.out object files can define symbols at the very start of a section.
* mark undefined symbols with non-zero value as bss candidates
* use FSRL to get filename

This is required when invoking loaders on subsets of files, such as
bulk-importing object files from static archives.

* don't use filename in memory block names
* reformat Unix Aout loader
* rename UnixAoutRelocation class
* rename UnixAoutSymbol class
* rework Unix Aout loader
2025-03-19 07:29:49 -04:00
ghidra1
ce6bef1e12 Merge branch 'GP-5369_FunctionStorageEditor_RegChooser' 2025-03-18 16:03:42 -04:00
dragonmacher
e7b6bb1fcb GP-5369 Use DropDownTextFieldDataModel for function
editor register storage cell editor
2025-03-18 15:22:28 -04:00
ghidra007
e9e127da89 GP-5501 improved rtti script gcc typeinfo creation 2025-03-18 19:03:54 +00:00
ghidra007
d43a827c7c GP-5500 add check that potential vftable address is in valid memory
block
2025-03-18 18:11:33 +00:00
ghidra1
65c496d833 Merge remote-tracking branch 'origin/GP-5326_ghidragon_update_to_datatype_component_field_name_changes' 2025-03-18 13:21:37 -04:00
ghidragon
9429fa0a8e GP-5326 fixed junit tests and removed check for default field names 2025-03-18 12:30:03 -04:00
Ryan Kurtz
2f581d0ead Merge remote-tracking branch 'origin/patch' 2025-03-18 12:17:44 -04:00
Ryan Kurtz
227497e0fa Merge remote-tracking branch
'origin/GP-5299_ghidorahrex_x86_pop_macro_fix' into patch (Closes #7326)
2025-03-18 12:14:01 -04:00
ghidra007
39a6a73c6d GP-5487 improved RecoverClassesFromRTTI gcc rtti detection
(Closes #7904)
2025-03-18 12:11:34 -04:00
Ryan Kurtz
a48b7cf495 Merge remote-tracking branch 'origin/GP-0_dev747368_fix_NPE_in_decompiler_text_finder' 2025-03-18 11:05:26 -04:00
Ryan Kurtz
6ecbf69e57 Merge remote-tracking branch
'origin/GP-5455_dev747368_golang_interface_method_calling'
(Closes #7529)
2025-03-18 11:03:54 -04:00
Ryan Kurtz
16780fc443 GP-5478: Fixing issue from cleanup effort 2025-03-18 11:02:52 -04:00
Ryan Kurtz
c187f26cfc Merge remote-tracking branch 'origin/GP-5492_ghizard_PdbReader_modify_and_bring_method_records_into_alignment' 2025-03-18 10:59:07 -04:00
dragonmacher
80bc6de413 GP-5485 - Added an optional 'ordinal' column to the union editor 2025-03-18 10:50:03 -04:00
Ryan Kurtz
95060a2dd8 GP-5496: Converting headless readme to markdown 2025-03-18 08:58:07 -04:00
ghidra1
6ab0beeeb7 GP-5480 Additional corrections and test fixes to handling of external
locations during merge
2025-03-17 18:56:13 -04:00
dev747368
5ca24f0001 GP-0 fix NPE in decompiler text finder when decompiler errors 2025-03-17 20:18:58 +00:00
dev747368
2d3922d41f GP-5455 golang interface method calling and decl
Improve how golang interface methods are handled.

Model the 'vtable' (runtime.itab) for a golang interface so each method
declared by the interface gets a funcdef that specifies the method's
params.
2025-03-17 20:07:45 +00:00
ghizard
766c4c7c04 GP-5492 - PdbReader - bring method records into alignment with each
other; expose thisAdjuster; change output format and tests
2025-03-17 15:58:56 -04:00
Ryan Kurtz
6d44b9bad7 Merge remote-tracking branch 'origin/GP-5435_ghidra2_MakeBSimInstalledByDefault' 2025-03-17 14:24:04 -04:00
Peter Belm
0f5e9c9ad4 BUG: OMFs with no exports caused an exception 2025-03-17 15:46:00 +00:00
ghidra1
ecfd6d39d8 Merge remote-tracking branch 'origin/patch' 2025-03-17 10:24:32 -04:00
Ryan Kurtz
a4ebfc5b33 Merge remote-tracking branch 'origin/GP-5475_ghidragon_disallow_spaces_in_fieldNames--SQUASHED' 2025-03-17 06:26:10 -04:00
Peter Belm
951fd9ec6b OMF-51 Loader Fixups & Public/External Refs implementation 2025-03-15 20:30:06 +00:00
ghidragon
0ea4e754b9 GP-5475 changed composite field names so that any whitespace is converted to underscores 2025-03-14 14:36:39 -04:00
Ryan Kurtz
6337086703 Merge remote-tracking branch
'origin/GP-5477-dragonmacher-decomp-hl-slowness' (Closes #7520)
2025-03-14 13:44:46 -04:00
ghidra1
6c00c68e2b GP-0 test fix 2025-03-14 10:51:02 -04:00
ghidra1
9fbcf838ca GP-0 Corrected StorageEditorModel related test failure 2025-03-14 09:33:32 -04:00
Ryan Kurtz
0a7db0d624 Merge remote-tracking branch 'origin/GP-5480_ghidra1_MergeExternalLocations' 2025-03-14 08:44:38 -04:00
Ryan Kurtz
88a35769a2 GP-0: Fixing some more javadoc 2025-03-14 08:34:43 -04:00
Ryan Kurtz
c964163c80 GP-0: Fixing some javadoc 2025-03-14 07:06:01 -04:00
ghidra1
905b4d78bd GP-5480 Corrected Merge tool rendering of external locations within
multi-listing.
2025-03-13 19:55:17 -04:00
dragonmacher
6fa543c2e2 GP-5477 - Decompiler - Fixed performance when using many global
highlighters; updated the highlight service to allow for
function-specific highlighting
2025-03-13 17:06:09 -04:00
Ryan Kurtz
825e8b811d Merge remote-tracking branch 'origin/patch' 2025-03-13 12:12:27 -04:00
Ryan Kurtz
7970f0c45a Merge remote-tracking branch
'origin/GP-5479_ghidra1_FunctionStorageEditor' into patch (Closes #7900)
2025-03-13 11:18:50 -04:00
Ryan Kurtz
24ca217a5a Merge remote-tracking branch 'origin/patch' 2025-03-13 11:09:53 -04:00
Noah Gregory
a962761ac0 Backporting "Start using long for symbol table offsets instead of
`int`" to patch (#7436, #7882)
2025-03-13 11:01:53 -04:00
Ryan Kurtz
2d29dd713a Merge remote-tracking branch 'origin/patch' 2025-03-13 09:06:31 -04:00
Ryan Kurtz
718987e811 GP-7899: Fixing issue with Mach-O stubs when local or absolute symbols
are present in the dynamic symbol table.  Also fixing first entry of
string table on dyld extractions. (Closes #7899)
2025-03-13 08:53:55 -04:00
Ryan Kurtz
869e32dd8e Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-cleanup' 2025-03-13 07:26:33 -04:00
ghidra1
15e4335eda GP-5479 Corrected Function Storage Editor issues 2025-03-12 15:47:59 -04:00
dragonmacher
c0f2edd2da Test update for closing windows that are dialogs 2025-03-12 14:02:38 -04:00
Ryan Kurtz
5a31ded2e0 Merge remote-tracking branch 'origin/GP-1-dragonmacher-help-reload-fix' 2025-03-12 13:01:52 -04:00
Ryan Kurtz
928fd09692 Merge remote-tracking branch
'origin/GP-5326_ghidragon_edit_structure_field--SQUASHED' (Closes #7407)
2025-03-12 12:59:58 -04:00
Ryan Kurtz
678209dbc3 Merge remote-tracking branch 'origin/GP-5478_ryanmkurtz_libs' 2025-03-12 12:58:34 -04:00
Ryan Kurtz
3f9f79b49f GP-5478: Cleaning up library loading code 2025-03-12 06:28:54 -04:00
d-millar
7ed42228a0 GP-0: memview mods 2025-03-11 16:40:01 -04:00
ghidragon
0b0b330bac GP-5326 created edit structure field action and dialog. 2025-03-11 16:13:24 -04:00
Ryan Kurtz
f183b758a0 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-3-11-25' 2025-03-11 14:31:37 -04:00
dragonmacher
04f1cca0ab Test fixes 2025-03-11 14:27:00 -04:00
Ryan Kurtz
515fd01489 GP-0: Upping Gradle wrapper to 8.1 2025-03-11 13:32:55 -04:00
Ryan Kurtz
19b6b17a23 GP-5429: More Mach-O reexport progress bar improvements 2025-03-11 13:31:32 -04:00
Ryan Kurtz
636f28dbdc Merge remote-tracking branch 'origin/GP-5462_dev747368_missing_gotype_subst' 2025-03-11 06:54:43 -04:00
Ryan Kurtz
f0542ccd6c Merge remote-tracking branch 'origin/patch' 2025-03-11 06:53:37 -04:00
Ryan Kurtz
a15e86832a Merge remote-tracking branch
'origin/GP-5461_ghidra007_RTTIScriptHandleMultipleVftableSymbolsAtSameAddr'
into patch (#7876)
2025-03-11 06:48:26 -04:00
dragonmacher
ef7c79f0c0 Updated the help window to not preserve the previous location on a new
request for the same page
2025-03-10 19:01:48 -04:00
d-millar
17d6f49bd7 GP-4611: not a perfect solution, but better 2025-03-10 17:42:09 -04:00
ghidorahrex
7413204896 GP-5469: Added additional arm VMRS/VMSR instruction variants 2025-03-10 16:16:04 +00:00
Ryan Kurtz
73d29e3488 Merge remote-tracking branch
'origin/GP-5468-dragonmacher-renderer-font-warning-fix' (Closes #7886)
2025-03-10 11:45:52 -04:00
Ryan Kurtz
117989eeda Merge remote-tracking branch 'origin/GP-1-dragonmacher-help-toc-sort-fix' 2025-03-10 11:44:45 -04:00
dragonmacher
88dc8a65bc GP-5468 - Updated the cell renderer setFont() warning to only show once 2025-03-08 16:51:09 -05:00
dragonmacher
0a30e924dd Updated the help build to detect re-used sort group values 2025-03-07 22:55:00 -05:00
カイダ
2b7663d7e5 Detect more rust binaries
Some rust binaries do not contain the `rustc` or `RUST_BACKTRACE` strings. Also detect `RUST_MIN_STACK` which is in these binaries.
2025-03-08 12:37:18 +09:00
ghidra007
e2b60a52f9 GP-5461 updated RecoverClassesFromRTTI script to correctly handle case
where some vftable addresses have more than one valid vftable symbol.
2025-03-07 21:33:16 +00:00
dev747368
e72b17b0db GP-5462 add some missing gotype name substitutions 2025-03-07 21:18:53 +00:00
Ryan Kurtz
7b9183b2db Merge remote-tracking branch 'origin/GP-1-dragonmacher-escape-window-fix' 2025-03-07 15:29:27 -05:00
Ryan Kurtz
0c56a9070c Merge remote-tracking branch 'origin/GP-4037_ghidragon_show_offcut_comments_in_listing--SQUASHED' 2025-03-07 15:19:59 -05:00
dragonmacher
0bb48934e8 Fixed escape key binding collision with closing windows by only enabling
the action when there is a selection
2025-03-07 12:55:53 -05:00
ghidragon
36b12ad8fe GP-4037 Changes the various listing comment fields (PRE, POST, EOL, PLATE) to also display offcut comments, colored red 2025-03-07 12:25:49 -05:00
Ryan Kurtz
b22c84a3be Merge remote-tracking branch 'origin/GP-2432_dev747368_golang_apisnapshot' 2025-03-07 11:58:13 -05:00
dev747368
36c6c8ef77 GP-2432 golang api snapshot, generics, closures, gcwritebarrier
Apply golang runtime function signatures from info stored in json api
snapshot files.

The api snapshot files are created by a custom go helper program that
uses the go compiler parser to parse the go toolchain source tree and
writes the discovered function and type info into a json file.

The go-api-parser helper program is based off of work contributed by
github user monoidic via issue #6367.

Updates generic functions to take a generic dictionary RTTI
parameter (mostly to allow correct assignment of other parameters).

Updates closure functions to take a closure context parameter.  Closure
contexts are passed via a register that is not involved in normal
parameter passing.

Tweaks the signature of gcWriteBarrier functions so that they don't mess
up decompilation of functions that use them.
2025-03-07 16:44:48 +00:00
Ryan Kurtz
2896551d68 Merge remote-tracking branch 'origin/GP-5457_dev747368_fix_gnunote_conflict' 2025-03-07 05:54:49 -05:00
dev747368
017cef88cd GP-5457 fix error when marking up gnu note items during import
was trying to markup the same gnu note via section name and pt_note
2025-03-06 19:48:57 +00:00
Ryan Kurtz
7055edf3fa Merge branch 'GP-5458_ryanmkurtz_GhidraProject-exceptions' (#7536) 2025-03-06 12:39:18 -05:00
Ryan Kurtz
1990d2ed4b GP-5458: GhidraProject and DefaultProjectManager methods for opening
projects now throw more granular exceptions
2025-03-06 12:37:30 -05:00
Ryan Kurtz
5361a47df2 Merge remote-tracking branch 'origin/patch' 2025-03-06 12:07:16 -05:00
Ryan Kurtz
b2d3c28ca7 Merge remote-tracking branch
'origin/GP-4648_ghidorahrex_PR-6531_Sleigh-InSPECtor_aarch32_vselgt'
into patch (Closes #6531)
2025-03-06 12:02:13 -05:00
Ryan Kurtz
5a8c2fbfa6 Merge branch 'GP-5444_ryanmkurtz_pyghidra-lock' into patch
(Closes #7536)
2025-03-06 12:00:09 -05:00
Ryan Kurtz
abb65d1b8c GP-5444: PyGhidra open_program() now handles locked projects better 2025-03-06 11:58:12 -05:00
Ryan Kurtz
b88a82dae1 Merge remote-tracking branch 'origin/GP-0_ghidragon_fixing_encoded_string_test' 2025-03-06 11:36:42 -05:00
ghidragon
260375351d GP-0 fixed bug introduced when adding accessible name 2025-03-06 11:34:58 -05:00
Ryan Kurtz
df57cf3351 Merge branch 'GP-0_ryanmkurtz_PR-6204_antoniovazquezblanco_pic' 2025-03-06 11:32:36 -05:00
Ryan Kurtz
40fecbc8dc Merge remote-tracking branch 'origin/GP-0_d-millar_test_fixes_250306' 2025-03-06 10:19:39 -05:00
d-millar
72bf384d7b GP-0: test fix 2025-03-06 15:14:35 +00:00
Ryan Kurtz
5b6c26ad05 Merge remote-tracking branch 'origin/GP-5227_Dan_splitConnectorHelps--SQUASHED' 2025-03-06 09:27:14 -05:00
Ryan Kurtz
ec743e0280 Merge remote-tracking branch
'origin/GP-5346-dragonmacher-decompiler-function-color-bug'
(Closes #7453)
2025-03-06 09:25:37 -05:00
Ryan Kurtz
7ebcb3fa88 Merge remote-tracking branch 'origin/GP-5434_ghidragon_fixed_datatype_tree_node_tooltip_cache--SQUASHED' 2025-03-06 09:23:54 -05:00
Ryan Kurtz
95782ad486 GP-5429: DyldCacheExtractLoader and MachoFileSetExtractLoader no longer
try to handle reexports
2025-03-06 09:20:49 -05:00
ghidragon
75d5db56a3 GP-5434 fixed data type tree node tooltip cache being stale. 2025-03-05 18:39:37 -05:00
Dan
9cf438bccd GP-5227: Split launchers help apart. 2025-03-05 20:17:43 +00:00
Ryan Kurtz
ff90737bdc Merge remote-tracking branch 'origin/GP-5452_d-millar_rr--SQUASHED'
(Closes #3133)
2025-03-05 10:37:17 -05:00
Ryan Kurtz
a0c5e18fcc Merge remote-tracking branch 'origin/GP-5265_Dan_moveScheduleDisplay--SQUASHED' 2025-03-05 10:34:19 -05:00
Ryan Kurtz
99eaf163ca Merge remote-tracking branch
'origin/GP-5414-dragonmacher-decompiler-hl-fix--SQUASHED' (Closes #7527)
2025-03-05 10:32:29 -05:00
Ryan Kurtz
7bbbc20cdf Merge remote-tracking branch 'origin/GP-4393_ghidragon_add_hover_to_show_symbol_source--SQUASHED' 2025-03-05 10:25:28 -05:00
Ryan Kurtz
6a8724a984 Merge remote-tracking branch 'origin/patch' 2025-03-05 10:24:32 -05:00
Ryan Kurtz
57784ead36 Merge remote-tracking branch 'origin/GP-5411_emteere_PPCpltThunk' into patch 2025-03-05 10:18:52 -05:00
d-millar
44c2a6dd26 GP-3133: per review
GP-3133: docs
GP-3133: basic methods
GP-3133: first pass
2025-03-05 10:11:35 -05:00
Dan
273dfba1ac GP-5265: Move schedule display from Threads to Listing tabs 2025-03-05 15:07:14 +00:00
Ryan Kurtz
22f733c19e Merge remote-tracking branch
'origin/GP-5451_ghidra007_removedOldGccRTTIAnalysisScript'
(Closes #7871)
2025-03-05 10:02:42 -05:00
Ryan Kurtz
825b6754f1 GP-0: Improving Mach-O loader progress messages (#7863) 2025-03-05 09:48:19 -05:00
dragonmacher
f078e5fe62 GP-5346 - Decompiler - Fixed sporadic function color bug that caused bad
function colors to oscillate
2025-03-04 18:06:51 -05:00
dragonmacher
99659967e2 GP-5414 - Decompiler - Updated highlighting to ignore syntax tokens 2025-03-04 17:26:33 -05:00
ghidragon
2a1a158578 GP-4393 add hover to show symbol source type 2025-03-04 16:17:03 -05:00
ghidra2
c809166c33 Make BSim install by default for public release. 2025-03-04 19:29:12 +00:00
ghidra007
2e26a0db35 GP-5451 removed old GCCRTTIAnalysisScript because
RecoverClassesFromRTTIScript has the latest Gcc class recovery
mechanisms in it.
2025-03-04 19:26:26 +00:00
Ryan Kurtz
802586c6fb Merge remote-tracking branch 'origin/GP-5408_ghizard_Rework_hierarchical_class_layout_and_vxt_understanding--SQUASHED' 2025-03-04 14:01:01 -05:00
Ryan Kurtz
75288d7d32 Merge remote-tracking branch 'origin/GP-5407_d-millar_TTD_putmem_state--SQUASHED' 2025-03-04 13:57:06 -05:00
ghizard
380a0dbe69 GP-5408 - C++ and PDB - rework hierarchical class layout and VxTable understanding 2025-03-04 13:50:28 -05:00
Ryan Kurtz
6d4f6e0854 Merge branch 'GP-0_ryanmkurtz_PR-7877_bmacphee_dyld-addend-mask-fix' 2025-03-04 13:15:51 -05:00
Ryan Kurtz
6d7f8a0b5e GP-0: Certify 2025-03-04 13:14:36 -05:00
Ryan Kurtz
4b82dad771 Merge remote-tracking branch 'origin/GP-5193_Dan_cleanLegacyGuiTables--SQUASHED' 2025-03-04 13:07:20 -05:00
Ryan Kurtz
d0fa5865c0 Merge remote-tracking branch 'origin/patch' 2025-03-04 13:06:23 -05:00
Ryan Kurtz
aa0753dbef Merge branch
'GP-5449_ryanmkurtz_PR-7868_Lehona_tricore_fix_relocation_24REL' into
patch (Closes #7868)
2025-03-04 13:04:03 -05:00
Ryan Kurtz
4a8b802178 GP-5449: Certify 2025-03-04 13:03:10 -05:00
d-millar
a2e42f5fe2 GP-5407: from review
GP-5407: from review
GP-5407: rebase
GP-5407: minor fix
GP-5407: new launcherGP-5407: new launcherGP-5407: working (?) open traceGP-5407: modules sort of worksGP-5407: mostly sane (threads+modules)GP-5407: start on methodsGP-5407: refresh fixGP-5407: update on refreshGP-5407: need a better fix for displaysGP-5407: backwards methodsGP-5407: add actionGP-5407: add actionGP-5407: working back buttonGP-5407: experimentingGP-5407: events workingGP-5407: clearer optionsGP-5407: minorGP-5407: actions->methods (step_ext)GP-5407: iconsGP-5407: iconsGP-5407: icons pt.2GP-5407: fix for KMEM/UMEMGP-5407: deprecate pyttdGP-5407: deprecate pyttdGP-5407: launchers updateGP-5407: ??
2025-03-04 13:02:21 -05:00
Dan
a1ff800559 GP-5193: Delete Legacy UI table panels. 2025-03-04 18:02:13 +00:00
lmulert@emproof.de
334eecbd16 Fix tricore relocation 24REL handling 2025-03-04 12:58:16 -05:00
Brad MacPhee
fdc3dd080a
DyldChainedImport: fix offset mask bug
fix name_offset extraction to support values stored in the high 32 bits that are larger than 2G (highest bit set)

this bug may not occur in practice, but is easy to prevent by using a long literal for the masking, rather than integer
2025-03-04 13:39:37 -04:00
Ryan Kurtz
4cf5d25bc8 Merge remote-tracking branch 'origin/GP-4555_GhidraKraken_DialogNames' 2025-03-04 12:21:45 -05:00
Ryan Kurtz
87a7caa90c Merge remote-tracking branch 'origin/GP-5430_ghidra007_ImageRuntimeFunctionEntryChange--SQUASHED' 2025-03-04 12:20:09 -05:00
Ryan Kurtz
1e18516eb5 Merge remote-tracking branch
'origin/GP-5440_ghidragon_fixing_nav_history_when_repeating_mem_search'
(Closes #7445)
2025-03-04 12:18:34 -05:00
Ryan Kurtz
92258b5b1b Merge remote-tracking branch 'origin/GP-2040_Dan_cleanAsyncUtils--SQUASHED' 2025-03-04 12:14:22 -05:00
Dan
922c4d0186 GP-2040: Remove garbage from AsyncUtils. 2025-03-04 17:09:06 +00:00
ghidra007
a19d6ab459 GP-5430 Updated the PE ImageRuntimeFunctionEntry structures to make EndAddress a Dword since it is really the address after the end of the given function and was causing bad references and code to be created. 2025-03-04 16:49:31 +00:00
Ryan Kurtz
66ac37b368 Merge branch 'GP-0_ryanmkurtz_PR-7875_XeR_memory-map' 2025-03-04 10:33:46 -05:00
Ryan Kurtz
45552147ec Merge remote-tracking branch
'origin/GP-5402_James_aarch64_fp_comparisons--SQUASHED' into patch
(Closes #7479, Closes #7855)
2025-03-04 10:10:09 -05:00
Ryan Kurtz
9515da9b19 Merge remote-tracking branch 'origin/GP-5441_ryanmkurtz_dyld-archs'
(#7863)
2025-03-04 10:03:33 -05:00
Ryan Kurtz
66d3a0d7c1 Merge remote-tracking branch 'origin/GP-5429_ryanmkurtz_reexports'
(Closes #7537)
2025-03-04 09:56:52 -05:00
Ryan Kurtz
9cca167f77 Merge remote-tracking branch 'origin/GP-5425_Dan_fixRefreshToggleInModelView--SQUASHED' 2025-03-04 09:55:00 -05:00
James
1bcc69aece GP-5402 aarch64 floating point comparisons and NAN 2025-03-04 09:20:45 -05:00
Dan
a94b0493c9 GP-5425: Encapsulate object-discovery policy, sort REFRESH, incorporate schema into specificity 2025-03-04 14:15:07 +00:00
XeR
c7336e8d19 Memory Map: ensure columns exist on initialization
The Memory Map plugin configures the maximum and minimum size of some of
the columns.

This initialization does not take into account that a user is able to
hide columns, which results in a null pointer exception.

This commit checks that these objects are not null before configuring
them.

Fixes: f4b89fd26c ("GP-4984 - Fixed row selection while using the filter; updated columns to be resizable")
2025-03-04 12:40:05 -01:00
Ryan Kurtz
17910774cd GP-5429: Support for Mach-O LC_REEXPORT_DYLIB 2025-03-04 06:25:58 -05:00
emteere
208f6f3ed1 GP-5411 Added plt thunk patterns, pre-fill of edit thunk GUI, loosened
thunk address calculation for more complicated thunks
2025-03-03 22:37:45 +00:00
GhidraKraken
6121818cd3 GP-4555 set accessible names for components 2025-03-03 15:24:58 -05:00
Ryan Kurtz
9890a88911 GP-5441: Don't try to load libraries from dyld_shared_cache files of
wrong architecture...waste of memory
2025-03-03 13:55:58 -05:00
ghidragon
bc2f0c135e GP-5440 fixed action Repeat Memory Search (F3) to update navigation
history
2025-03-03 13:34:20 -05:00
Ryan Kurtz
136a944796 Merge remote-tracking branch 'origin/GP-2148_ghidragon_change_byteviewer_to_center_when_goto_is_offscreen' 2025-03-03 13:10:29 -05:00
Ryan Kurtz
3c76ab787a Merge remote-tracking branch 'origin/GP-5379_Dan_fixKeyReuse--SQUASHED'
(Closes #7497)
2025-03-03 13:08:01 -05:00
Ryan Kurtz
e08184f5db Merge remote-tracking branch 'origin/patch' 2025-03-03 13:07:03 -05:00
Ryan Kurtz
c2533aaf6e Merge remote-tracking branch 'origin/GP-5394_Dan_fixWatchDeref' into patch 2025-03-03 13:05:07 -05:00
Ryan Kurtz
32a287aab8 Merge remote-tracking branch 'origin/GP-5416_Dan_terminalScrollingOnSelect' into patch 2025-03-03 13:01:35 -05:00
Ryan Kurtz
73810bb7b9 Merge remote-tracking branch 'origin/GP-4915_Dan_fixPlotColumnIssues--SQUASHED' into patch 2025-03-03 13:00:08 -05:00
Ryan Kurtz
973a0ea1c3 Merge remote-tracking branch 'origin/GP-5383_Dan_watchesUpdateOnRegChange' into patch 2025-03-03 12:58:33 -05:00
Dan
789a9fa4b7 GP-5379: Require snap parameter in object getters/setters. Lots of fallout. 2025-03-03 17:29:24 +00:00
Dan
2aedd75059 GP-4915: Scan view columns, not model columns, to detect Plot removal. 2025-03-03 17:09:42 +00:00
ghidragon
49d9afdbfb GP-2148 changed Byteviewer to center cursor on screen when jumping to
offscreen location to be consistent with listing
2025-03-03 11:57:42 -05:00
Ryan Kurtz
3d7089d391 Merge remote-tracking branch
'origin/GP-5310_ghidragon_search_and_replace--SQUASHED'
2025-03-03 06:23:24 -05:00
Ryan Kurtz
7475ff424c Merge remote-tracking branch
'origin/GP-5428_ghidragon_scripts_menu--SQUASHED' (#7521)
2025-03-03 06:18:56 -05:00
ghidragon
9a973787dc GP-5428 - Scripts without menu paths are put into default menu when added to tool 2025-02-28 20:09:57 -05:00
ghidragon
6fb115358a GP-5310 Created global search and replace feature 2025-02-28 20:08:40 -05:00
Ryan Kurtz
f1dcb64e22 Merge remote-tracking branch 'origin/patch' 2025-02-28 16:38:51 -05:00
Ryan Kurtz
3ed75673dd Merge remote-tracking branch 'origin/GP-5422_ghidra007_RTTIUtil_fixReplaceTickIssue' into patch 2025-02-28 16:35:59 -05:00
Dan
891d7a5d78 GP-5383: Include register spaces in Watch update on RESTORED event. 2025-02-28 21:03:27 +00:00
Dan
6c28d25214 GP-5394: Fix issue evaluating watches when no thread (on previous coords) 2025-02-28 20:46:10 +00:00
Dan
183b862e14 GP-5416: Fix annoying Terminal scrolling when selecting. 2025-02-28 19:45:14 +00:00
Ryan Kurtz
d0bd4e3184 Merge remote-tracking branch 'origin/patch' 2025-02-28 13:52:28 -05:00
Ryan Kurtz
7e3468a17e Merge remote-tracking branch 'origin/GP-5419_Dan_fixDocsRePybag' into patch 2025-02-28 13:38:56 -05:00
Dan
67bca91abb GP-5419: Fix installation guide re/ pybag version required. 2025-02-28 17:58:40 +00:00
Ryan Kurtz
507d5cfbea Merge remote-tracking branch 'origin/patch' 2025-02-28 11:05:29 -05:00
Ryan Kurtz
3b421a4f42 Merge remote-tracking branch 'origin/GP-5431_ghidra1_BitfieldEditorNPE'
into patch (Closes #7865)
2025-02-28 11:02:00 -05:00
ghidra1
be2381e5cb Corrected BitFieldEditorPanel NPE when getActionContext invoked with
null event.
2025-02-28 08:55:15 -05:00
Ryan Kurtz
58e19e947c Merge remote-tracking branch
'origin/GP-5424_ghidracadabra_PR-6601_Sleigh-InSPECtor_x86_pushf_popf'
(Closes #6601)
2025-02-27 14:00:58 -05:00
James
74066cdf78 GP-5424 updated x86 version numbers 2025-02-26 20:29:50 +00:00
Sleigh-InSPECtor
6e8ef8deb1 x86: PUSHF/POPF address size fixes (64-bit mode) 2025-02-26 20:18:13 +00:00
ghidra007
9bc59fa383 GP-5422 fix RTTIAnalyzer replace tick after just removed issue 2025-02-26 18:48:10 +00:00
Ryan Kurtz
9a7a06f5f6 Merge remote-tracking branch
'origin/GP-5191_James_x86_fpu_ip_updates--SQUASHED' (Closes #7205,
Closes #7508)
2025-02-26 12:47:39 -05:00
Ryan Kurtz
56867a2696 Merge remote-tracking branch 'origin/GP-5388_James_bsim_feature_visualizer_option_improvement--SQUASHED' 2025-02-26 12:45:51 -05:00
Ryan Kurtz
496ad864d6 Merge remote-tracking branch 'origin/GP-1-dragonmacher-frustration-disable' 2025-02-26 12:44:44 -05:00
Ryan Kurtz
836a01ac11 Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-2-26-25' 2025-02-26 12:43:56 -05:00
dragonmacher
b04ff770b3 Test fixes 2025-02-26 12:42:09 -05:00
dragonmacher
fc68df0927 Updated the Window menu actions to not show frustration 2025-02-25 14:35:52 -05:00
James
3d09c029cd GP-5388 use drop-down in bsim feature visualizer options 2025-02-25 12:46:51 -05:00
James
f8b0d83b16 GP-5191 x86 fpu ip updates 2025-02-25 12:19:27 -05:00
Ryan Kurtz
cc1228bdaa Merge remote-tracking branch 'origin/GP-1-dragonmacher-project-open-tree-fix--SQUASHED' 2025-02-25 11:57:44 -05:00
Ryan Kurtz
fbf4ecb188 Merge remote-tracking branch 'origin/patch' 2025-02-25 11:57:11 -05:00
Ryan Kurtz
f80934d684 Merge remote-tracking branch 'origin/GP-5406_ghidra1_ElfMipsDebugImport' into patch 2025-02-25 11:54:32 -05:00
ghidra1
8e09813393 GP-5406 Correct ELF import issue for MIPS debug file which fails on
.reginfo data read
2025-02-25 09:57:25 -05:00
Ryan Kurtz
22a4de14ea GP-0: OMF-51 improvements 2025-02-25 09:35:32 -05:00
dragonmacher
1d5da6dae1 Fixed open program dialog to not repeatedly load the root node 2025-02-25 09:14:56 -05:00
Ryan Kurtz
26d3c933e7 Merge remote-tracking branch 'origin/GP-1-dragonmacher-front-end-fix' 2025-02-25 07:12:15 -05:00
Ryan Kurtz
a60ef336ea Merge remote-tracking branch 'origin/patch' 2025-02-25 07:06:13 -05:00
Ryan Kurtz
f6671b7c21 Merge remote-tracking branch
'origin/GP-5412_ghidra1_StructureEditorTransactionError' into patch
(Closes #7853)
2025-02-25 07:00:56 -05:00
Ryan Kurtz
de95e7e4a9 Merge remote-tracking branch
'origin/GP-5413_ghidra1_x86ElfGotAllocError' into patch (Closes #7525)
2025-02-25 06:59:19 -05:00
dragonmacher
e767916357 Fixed the Close action to not close the Front End provider 2025-02-24 18:47:46 -05:00
ghidra1
4b4d2f00d1 GP-5413 Improve error handling for x86 ELF GOT allocation failure during
relocation processing.
2025-02-24 18:15:30 -05:00
ghidra1
0fc1805695 GP-5412 Corrected structure editor transaction error 2025-02-24 17:13:00 -05:00
Ryan Kurtz
93c19e3cc6 GP-5396: Fixing a recent regression in DyldChainedFixups.java 2025-02-24 05:49:10 -05:00
Ryan Kurtz
59194d4927 Merge remote-tracking branch 'origin/patch' 2025-02-21 14:21:16 -05:00
Ryan Kurtz
8213dbb71a Merge remote-tracking branch 'origin/GP-5404_compiler_spec_fixes' into patch 2025-02-21 14:18:46 -05:00
Ryan Kurtz
b1f1edb524 Merge remote-tracking branch 'origin/GP-5255_James_source_file_transform_file_chooser--SQUASHED' 2025-02-21 14:11:58 -05:00
Ryan Kurtz
43b0621e4a Merge remote-tracking branch
'origin/GP-5331_Dan_gdbSignErrors--SQUASHED' (Closes #6787)
2025-02-21 14:10:14 -05:00
d-millar
5e7af583cc GP-5404: sigh 2025-02-21 15:04:06 +00:00
James
aa68aec59d GP-5255 source file transform file chooser 2025-02-21 09:38:20 -05:00
Dan
7c983f7bb5 GP-5331: Gdb address signedness. 2025-02-20 19:36:36 +00:00
Ryan Kurtz
aaf910bd82 Merge remote-tracking branch 'origin/GP-5319_James_source_map_help_improvements--SQUASHED' 2025-02-20 13:11:08 -05:00
Ryan Kurtz
e2435030bc Merge branch 'GP-5396_ryanmkurtz_libobjc' 2025-02-20 13:10:51 -05:00
Ryan Kurtz
1a28788aec Merge remote-tracking branch 'origin/patch' 2025-02-20 13:10:25 -05:00
Ryan Kurtz
93c2a52653 Merge branch 'GP-0_ryanmkurtz_PR-7510_sethcg_fix-warning' 2025-02-20 13:10:05 -05:00
Ryan Kurtz
a28ef36998 GP-5396: The extracted dyld_shared_cache component loader now has
options to automatically add common components that contribute to better
analysis such as libobjc.dylib, constant data, text stubs, etc
2025-02-20 11:58:13 -05:00
James
752edc8084 GP-5319 source map help improvements 2025-02-20 11:03:17 -05:00
Ryan Kurtz
6cec02eb9f GP-0: Certify 2025-02-20 07:46:53 -05:00
ghidra1
97c8b3975c GP-5395 Corrected Memory Search region choice selection bug 2025-02-19 20:12:34 -05:00
Ryan Kurtz
0948dfbde4 Merge remote-tracking branch 'origin/GP-5099_ghizard_Continued_investigation_redesign_of_MsftVxtManager' 2025-02-19 11:29:39 -05:00
Ryan Kurtz
85ed9774c0 Merge remote-tracking branch 'origin/patch' 2025-02-19 11:28:28 -05:00
Ryan Kurtz
4829ecd670 Merge remote-tracking branch 'origin/GP-5389_ghidra007_addVmiCheck' into
patch (Closes #7516)
2025-02-19 11:21:32 -05:00
Ryan Kurtz
0855e61d74 Merge remote-tracking branch 'origin/patch' 2025-02-19 10:28:05 -05:00
Ryan Kurtz
0966be0995 Merge remote-tracking branch
'origin/GP-5386_ghidorahrex_ARM_thumb_strt_patch' into patch
(Closes #7514)
2025-02-19 10:17:34 -05:00
Ryan Kurtz
2e9f555aa9 Merge remote-tracking branch
'origin/GP-4649_ghidorahrex_PR-6542_Sleigh-InSPECtor_aarch32_vdup' into
patch (Closes #6542)
2025-02-19 10:12:35 -05:00
Ryan Kurtz
f23ae988bc Merge remote-tracking branch
'origin/GP-5314_Dan_liveMemHandlerBroke--SQUASHED' (Closes #7413)
2025-02-19 06:10:13 -05:00
ghidra1
558b785484 GP-0 Set next patch version to 11.3.2 2025-02-18 17:14:02 -05:00
ghidra007
1b6254547c GP-5389 added check in vmi structure creation so numBases is valid 2025-02-18 21:41:38 +00:00
ghidra1
405e6126c2 Merge remote-tracking branch 'origin/patch' 2025-02-18 15:14:53 -05:00
ghizard
eb5c9c88af GP-5099 - CPP and PDB - Continued work on redesigned VxtManager 2025-02-18 15:02:27 -05:00
Dan
bef0660e6a GP-5314: Destroy LiveMemoryHandler 2025-02-18 18:23:30 +00:00
sethcg
281ce0ab91 Fixed comments to pull request 2025-02-18 12:38:23 -05:00
ghidorahrex
a2af457dea GP-5386: Added missing ARM thumb strt instruction 2025-02-18 14:03:42 +00:00
Ryan Kurtz
c8937df382 Merge remote-tracking branch 'origin/GP-5375-dragonmacher-gtree-get-child--SQUASHED' 2025-02-18 07:15:29 -05:00
Ryan Kurtz
8a87b946d9 Merge remote-tracking branch 'origin/GP-5385_ghizard_PDB_U_Change_constructor_return_type' 2025-02-18 07:11:38 -05:00
Ryan Kurtz
92f748d50d Merge remote-tracking branch
'origin/GP-5384_ghidracadabra_PR-7388_gemesa_bsim-pg-arm64'
(Closes #7388, Closes #7387)
2025-02-18 07:08:56 -05:00
sethcg
c34988bbbd Fixed some references to generic types 2025-02-15 16:02:16 -05:00
dragonmacher
e868fdd344 GP-5375 - Added GTree.getChildren(String) to handle potential duplicate child nodes 2025-02-14 19:32:44 -05:00
ghizard
46cc9139f6 GP-5385 - PDB U - Change constructor return type 2025-02-14 15:55:33 -05:00
Andras Gemes
1c94f5145d BSim: Document PostgreSQL support on arm64 2025-02-14 17:55:30 +00:00
Ryan Kurtz
2eff37f655 Merge remote-tracking branch 'origin/patch' 2025-02-14 12:12:52 -05:00
Ryan Kurtz
a950ecd5f2 Merge remote-tracking branch 'origin/GP-1-dragonmacher-help-fix' 2025-02-14 11:49:24 -05:00
dragonmacher
2a2251c04c Fixed bad help location 2025-02-14 11:42:21 -05:00
ghidra1
a8f446f603 Merge remote-tracking branch 'origin/patch' 2025-02-14 11:01:23 -05:00
ghidra1
391101cf98 Merge remote-tracking branch 'origin/patch' 2025-02-14 09:35:05 -05:00
Ryan Kurtz
f33e358cea Merge branch 'GP-0_ryanmkurtz_PR-7493_gtackett_OMF51_objectmarkup' 2025-02-14 06:52:26 -05:00
Ryan Kurtz
733e0650c1 GP-0: Review fixes 2025-02-14 06:51:58 -05:00
Ryan Kurtz
0048d2e307 Merge remote-tracking branch 'origin/patch' 2025-02-14 05:53:01 -05:00
Ryan Kurtz
c186ac2f41 Merge remote-tracking branch 'origin/GP-5360_d-millar_bat_script_fixes'
(Closes #4977)
2025-02-13 14:52:03 -05:00
d-millar
55ea88ddb0 GP-5360: first pass - gdb working
GP-5360: working lldb.bat

GP-5360: allow empty listing for dbgeng

GP-5360: bat equivs

GP-5360: bat equivs

GP-5360: ssh adds for lldb

GP-5360: missed one

GP-5360: missed one

GP-5360: wow this sucks

GP-5360: post-review
2025-02-13 14:47:37 -05:00
Ryan Kurtz
f0a21fe60f Merge remote-tracking branch 'origin/patch' 2025-02-13 14:32:43 -05:00
Ryan Kurtz
b7548c55cd Merge remote-tracking branch
'origin/GP-5286_ghidorahrex_PR-6470_Sleigh-InSPECtor_aa64_ldnr_regs'
(Closes #6470)
2025-02-13 14:06:10 -05:00
Ryan Kurtz
2b3b59af01 Merge remote-tracking branch 'origin/patch' 2025-02-13 14:02:32 -05:00
Ryan Kurtz
5353c46d7a Merge remote-tracking branch 'origin/GP-1-dragonmacher-component-provider-frustration-fix' 2025-02-13 09:40:26 -05:00
Ryan Kurtz
d46fcb6b9d Merge remote-tracking branch
'origin/GP-5342-dragonmacher-dt-actions--SQUASHED' (Closes #7408)
2025-02-13 09:38:16 -05:00
dragonmacher
408de9af75 GP-5342 - Updated some Data Types actions to be enabled with a selection containing folders 2025-02-12 19:58:01 -05:00
dragonmacher
e5988853aa Disabled frustration timeout when animation is disabled 2025-02-12 19:31:51 -05:00
gtackett
26365e9e25 Add content records (restoring files accidentally removed) 2025-02-12 17:19:58 -05:00
Ryan Kurtz
4247ae7956 Merge remote-tracking branch 'origin/GP-5371_ryanmkurtz_macho-longs'
(#7436)
2025-02-12 12:23:28 -05:00
Ryan Kurtz
3398fbedd9 Merge remote-tracking branch 'origin/GP-5357_ryanmkurtz_dyld-fixups'
(#7289)
2025-02-12 12:21:05 -05:00
Ryan Kurtz
15cb055073 Merge remote-tracking branch 'origin/patch' 2025-02-12 12:20:07 -05:00
Ryan Kurtz
bf92745d25 GP-5371: MachoLoader now uses longs to model native uint32_t 2025-02-12 12:11:38 -05:00
Ryan Kurtz
c474967356 Improving the efficiency of fixing up dyld_shared_cache slide pointers 2025-02-12 09:17:14 -05:00
Ryan Kurtz
eaa8aeb0c8 Merge branch 'GP-5371_ryanmkurtz_PR-7436_nmggithub_macho-ints' 2025-02-12 06:23:17 -05:00
Ryan Kurtz
31ad7c033b GP-5371: Certify 2025-02-12 06:21:51 -05:00
Ryan Kurtz
2e857e1591 Merge remote-tracking branch 'origin/patch' 2025-02-11 13:54:55 -05:00
Ryan Kurtz
db1b6860c9 Merge remote-tracking branch 'origin/patch' 2025-02-11 06:09:46 -05:00
Ryan Kurtz
7c74de60e6 Merge remote-tracking branch 'origin/GP-5354_James_function_tags_selection_action--SQUASHED' 2025-02-10 14:52:36 -05:00
James
1a47e8f41a GP-5354 added selection action to function tags window 2025-02-10 13:53:21 -05:00
Ryan Kurtz
0c3f714f50 Merge remote-tracking branch 'origin/GP-wkshp_d-millar_RB250207--SQUASHED' 2025-02-10 13:30:53 -05:00
Ryan Kurtz
7e04770b23 Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-2025-02-10-1' 2025-02-10 13:29:31 -05:00
d-millar
0fac9cc491 GP-wkshp: post-review
GP-wkshp: minor mod
GP-wkshp: post-rebase
GP-wkshp: rebase
GP-5290: first pass
GP-5290: fixes for abstract state; set sizeGP-5290: basically workingGP-5290: state updates in motionGP-5290: some cleanupGP-5290: mid-reviewGP-5290: lose the interfaceGP-wkshp: add opsGP-wkshp: trimGP-wkshp: first pass on exportGP-wkshp: error in writeRule?GP-wkshp: working version of source exportGP-wkshp: more tweaksGP-wkshp: unnecessary
2025-02-10 13:15:57 -05:00
Dan
19edc7028c GP-0: Fix MethodInvocation dialog tests. 2025-02-10 18:15:37 +00:00
Ryan Kurtz
f0afe9123e Merge remote-tracking branch 'origin/patch' 2025-02-10 08:40:42 -05:00
Ryan Kurtz
ad1c2afefa Merge remote-tracking branch 'origin/GP-5349_ryanmkurtz_dyld' (#7289) 2025-02-10 07:08:50 -05:00
Ян Ли
bfb5553fc0 RecoverClassesFromRTTIScript.java | Fix misspelling of the word
'analyzer' (Closes #7464)
2025-02-10 07:08:06 -05:00
Ryan Kurtz
3cda119889 GP-5349: Improvements to the DyldCacheFileSystem 2025-02-10 06:59:58 -05:00
Ryan Kurtz
69439da80a Merge remote-tracking branch 'origin/GP-5344-dragonmacher-front-end-tool-closing-fix' 2025-02-07 14:24:32 -05:00
Ryan Kurtz
55cc6fceaa Merge remote-tracking branch
'origin/GP-5332_dev747368_FSRL_backslash_paths' (Closes #7278)
2025-02-07 14:22:58 -05:00
Ryan Kurtz
684ed5ec6c Merge remote-tracking branch 'origin/patch' 2025-02-07 09:56:36 -05:00
Ryan Kurtz
23d6530aaa Merge remote-tracking branch 'origin/GP-0_dev747368_fix_dwarf_npe_when_missing_reginfo' 2025-02-07 08:17:43 -05:00
Ryan Kurtz
d63717fcae Merge remote-tracking branch 'origin/patch' 2025-02-07 08:17:18 -05:00
dragonmacher
df439e9a49 GP-5344 - Prevent the Front End tool disappearing by not allowing
component provider actions to close the provider if it is the last one
in the window
2025-02-06 19:22:41 -05:00
dev747368
20739feef0 GP-5332 fix backslash handling in unix filenames, FSB browser
enhancements

Don't unnecessarily convert backslashes into fwd slashes for FSRLs.
Add "My Computer" location to FSB Browser (exercising other FSRL
handling issues)
Tweaked FSB icons for file system nodes in the tree and for each FSB
component window

Fixes issue #7278
2025-02-06 22:23:54 +00:00
Ryan Kurtz
738fe8bc4f Merge branch 'GP-0_ryanmkurtz_PR-7421_ds5678_pcodeop-tostring-segmentop' 2025-02-06 12:39:23 -05:00
Ryan Kurtz
3703852dd4 Merge remote-tracking branch
'origin/GP-5303-dragonmacher-edit-stack-enablement' (Closes #6970)
2025-02-06 11:55:57 -05:00
Ryan Kurtz
c760193537 Merge remote-tracking branch
'origin/GP-5341-dragonmacher-decompiler-bg-color-fix' (Closes #7431)
2025-02-06 11:53:21 -05:00
Ryan Kurtz
706b5db3ee Merge branch 'GP-0_ryanmkurtz_PR-7429_boppitybop_fid-rust-swift-demanglers' 2025-02-06 11:51:40 -05:00
Ryan Kurtz
9de99669a8 GP-0: Certify 2025-02-06 11:49:52 -05:00
Ryan Kurtz
6ef6a85c11 Merge remote-tracking branch
'origin/GP-3450_Dan_dbgStructHovers--SQUASHED' (#5337)
2025-02-06 08:44:54 -05:00
Ryan Kurtz
207d26146d Merge remote-tracking branch
'origin/GP-3771_Dan_unwindArmThumb--SQUASHED' (Closes #5658)
2025-02-06 08:43:02 -05:00
Ryan Kurtz
65d6c3b188 Merge remote-tracking branch 'origin/GP-4546_Dan_breakExpressionActions--SQUASHED' 2025-02-06 08:34:30 -05:00
Dan
871557c555 GP-3450: Heuristic for assignment statements, evaluating lhs. Docs. Test. (Fixes a hover issue noticed in #5337) 2025-02-06 13:21:08 +00:00
Dan
655082ecb5 GP-3771: Add mask to the unwind analyzer (Fixes unwind with ARM/THUMB) 2025-02-06 13:18:15 +00:00
Dan
fb9a7c62a2 GP-4546: Add 'Set breakpoint' multi-action to Breakpoints window. 2025-02-06 13:15:45 +00:00
Ryan Kurtz
ccae2f85ad Merge remote-tracking branch 'origin/patch' 2025-02-06 07:55:48 -05:00
Ryan Kurtz
28fd6a1222 Merge remote-tracking branch 'origin/GP-1-dragonmacher-dark-search-highlights' 2025-02-06 07:14:11 -05:00
Ryan Kurtz
e14fede14f Merge remote-tracking branch 'origin/GP-5183_ghintern_x86_x64_cspecs--SQUASHED' 2025-02-06 07:11:36 -05:00
Ryan Kurtz
969d1df6fc Merge remote-tracking branch
'origin/GP-5337-dragonmacher-table-fitler-bug' (Closes #7444)
2025-02-06 07:08:50 -05:00
Ryan Kurtz
443dd9b845 Merge remote-tracking branch 'origin/GP-5297-dragonmacher-search-text-fix' 2025-02-06 07:05:34 -05:00
dragonmacher
3717622c60 GP-5341 - Decompiler - Fixed background not painting fully for undefined
functions
2025-02-05 21:04:50 -05:00
dragonmacher
2e6e1022bc GP-5297 - Fixed a bug that prevented comment searching of annotations
for working correctly
2025-02-05 20:34:44 -05:00
ghidra1
cdfcc71255 Merge remote-tracking branch 'origin/patch' 2025-02-05 18:49:35 -05:00
ghidra1
e653e82c3e Merge remote-tracking branch 'origin/patch' 2025-02-05 18:44:54 -05:00
dev747368
d7ed3a1d35 GP-0 fix DWARF NPEs when missing regmapping info 2025-02-05 21:36:44 +00:00
dragonmacher
1f6d121cc6 GP-5303 - Updated the Edit Stack Frame action to be enabled anywhere in
the body of a function
2025-02-05 13:04:33 -05:00
Ryan Kurtz
5002de13f4 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-02-05 06:55:37 -05:00
dragonmacher
f36814243c Tweaked find highlight colors 2025-02-04 18:08:28 -05:00
dragonmacher
9be78bcd02 GP-5337 - Table Filters - fixed a bug that prevented a filter using an
escaped glob character from matching items
2025-02-04 17:00:55 -05:00
ghintern
69dd166c3a GP-5183 Fixes to x86 and x64 cspecs 2025-02-04 21:37:27 +00:00
Sleigh-InSPECtor
065ef72288 AArch32: fixed vdup
* 8byte vector duplication to 16byte performed bitwise AND (destructive) instead of OR of the 8byte shifted results, causing all 16byte vector duplications to be 0
* non-thumb constraints were used in a thumb instruction, added thumb specific constraints and separated them using TMode ctx field
2025-02-04 16:36:32 +00:00
Sleigh-InSPECtor
26acd697ac AArch32: fixed vselgt
* added 'and N == V' check missed in the vselcond "gt"
2025-02-04 16:33:04 +00:00
Ryan Kurtz
17419c57fe Merge remote-tracking branch 'origin/GP-5076_ghizard_base_class_names_and_categories' 2025-02-04 09:07:30 -05:00
Ryan Kurtz
5a3a8c36c8 Merge remote-tracking branch
'origin/GP-5316-dragonmacher-function-editor-key-binding--SQUASHED'
(#7241)
2025-02-03 17:14:37 -05:00
Ryan Kurtz
70d43e73d8 Merge remote-tracking branch 'origin/GP-5290_d-millar_angr--SQUASHED' 2025-02-03 16:11:13 -05:00
Ryan Kurtz
a3b4b48ff4 Merge remote-tracking branch
'origin/GP-5317-dragonmacher-tree-copy--SQUASHED' (Closes #7417)
2025-02-03 16:08:36 -05:00
dragonmacher
b04e6e58b6 GP-5317 - GTree - Added an action to allow users to copy the selected paths and preserve the indentation. Moved some help to the Docking module. 2025-02-03 15:44:07 -05:00
Ryan Kurtz
3773ca550b Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-02-03 15:31:52 -05:00
d-millar
efc18fad3b GP-5290: from review
GP-5290: lose the interface
GP-5290: mid-review
GP-5290: some cleanup
GP-5290: state updates in motion
GP-5290: basically working
GP-5290: fixes for abstract state; set size
GP-5290: first pass
2025-02-03 12:24:15 -05:00
ghizard
ed7cc31cfd GP-5076 change PDB class naming for bases and internal category and
significant change to tests
2025-02-03 11:44:29 -05:00
Ryan Kurtz
d23e67a088 GP-0: Cleaning up certain types of javadoc errors 2025-02-03 06:13:50 -05:00
Ryan Kurtz
6086ba9bfb Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-1-30-25' 2025-02-02 13:39:07 -05:00
Ryan Kurtz
2f61a6c88a Merge remote-tracking branch 'origin/GP-5323_ghizard_PDB_improve_vxtables_and_test_setup--SQUASHED' 2025-02-02 13:37:31 -05:00
Noah Gregory
dfd0652ec1 Start using long for symbol table offsets instead of int 2025-02-01 12:30:32 -05:00
ghidra1
5b818293dc Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-31 12:09:40 -05:00
ghidra1
0a3d4a28d0 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-31 09:16:06 -05:00
Stanley He
41fc219469 FunctionID: Add Rust and Swift demanglers to headless Prescript 2025-01-31 15:08:27 +11:00
dragonmacher
2f5faafeb7 Test fixes 2025-01-30 18:56:27 -05:00
dragonmacher
9a80d532a3 GP-5316 - Function Editor - Updated the editor's table edit key binding to find the next editable cell 2025-01-30 17:30:37 -05:00
ghizard
c6a3300fe8 GP-5323 - PDB - improve vxtables and test set up 2025-01-30 15:38:28 -05:00
Ryan Kurtz
c693e963eb Merge remote-tracking branch 'origin/GP-4732_d-millar_remote_dbgeng_RB250130--SQUASHED' 2025-01-30 14:37:51 -05:00
Ryan Kurtz
6b0a707850 Merge remote-tracking branch
'origin/GP-5324_dev747368_bad_path_in_import' (Closes #7267)
2025-01-30 14:36:19 -05:00
d-millar
05ed589fa0 GP-4732: from the demo (lol)
GP-4732: frome review
GP-4732: working until we step
GP-4732: manifestGP-4732: works, except for resumeGP-4732: successGP-4732: frome review
2025-01-30 12:57:47 -05:00
Ryan Kurtz
e0fd708d30 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-30 06:27:40 -05:00
dev747368
55901c83fe GP-5324 fix default path suggested during import
Fix suggested import path when double-clicking to start import (vs.
right click import action)
2025-01-29 21:19:31 +00:00
Ryan Kurtz
e158337a0f Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-29 13:57:42 -05:00
Ryan Kurtz
0dc9950550 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-29 12:23:11 -05:00
Ryan Kurtz
cefe8fec6a Merge remote-tracking branch 'origin/GP-3870-dragonmacher-dt-filters'
(Closes #5734)
2025-01-29 06:29:03 -05:00
Ryan Kurtz
edf127ae6d Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-29 06:21:02 -05:00
ghidra1
b8ac0c46b7 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-28 16:46:45 -05:00
ghidra1
25cda5d8a5 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-28 16:43:03 -05:00
dragonmacher
ba15d9368d GP-3870 - Data Types - Added more filterable types 2025-01-28 15:05:25 -05:00
Ryan Kurtz
537be9f060 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-28 11:51:51 -05:00
Ryan Kurtz
9f1aac6886 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-28 09:33:43 -05:00
Jeremy Pritts
e71b4381b4
Add missing switch case in PcodeOp.toString for SEGMENTOP 2025-01-28 03:56:22 -05:00
Ryan Kurtz
2ec84c2fb4 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-27 13:01:37 -05:00
Ryan Kurtz
b1370e1368 Merge remote-tracking branch 'origin/GP-5047-dragonmacher-dt-preview-fix' 2025-01-27 12:51:13 -05:00
Ryan Kurtz
5e8f059b7e Merge remote-tracking branch 'origin/GP-0_Dan_fixMemEditorCleanup' 2025-01-27 12:48:21 -05:00
Dan
11a9541417 GP-0 (rel #7413): Clean up LiveMemoryHandler on tool closure. 2025-01-27 17:28:40 +00:00
Ryan Kurtz
21893b10f6 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-27 10:23:27 -05:00
Ryan Kurtz
44fc352b9a Merge branch 'GP-0_ryanmkurtz_PR-7414_hippietrail_mirrors-apostrophe' 2025-01-27 06:33:07 -05:00
Ryan Kurtz
f8476cb82e GP-0: Certify 2025-01-27 06:31:07 -05:00
Ryan Kurtz
ffe3a46892 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-27 06:17:07 -05:00
hippietrail
41c69f58af "Mirror" seems to be a verb rather than the owner of the interface 2025-01-25 13:33:05 +08:00
dragonmacher
ed88e0feb5 GP-5047 - Updated the preview pane to correctly use html when first
shown
2025-01-24 19:11:12 -05:00
Ryan Kurtz
383c0ed20c Merge remote-tracking branch 'origin/GP-4151_ghidragon_fixing_wizard--SQUASHED' 2025-01-24 17:46:26 -05:00
Ryan Kurtz
d4249c470e Merge remote-tracking branch 'origin/GP-0-dragonmacher-screenshot-fix-1-24-25' 2025-01-24 17:45:42 -05:00
ghidragon
32bf68b8f3 GP-4151 fixing wizard pattern to better handle expensive checks between panels. 2025-01-24 17:31:03 -05:00
dragonmacher
7679fed7a2 Fix for screenshot user name 2025-01-24 17:28:46 -05:00
Ryan Kurtz
06a5691a0c Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-24 13:40:58 -05:00
Ryan Kurtz
ff5ef9347e Merge branch 'GP-0_ryanmkurtz_PR-7399_gtackett_OMF51_objectmarkup'
(Closes #7399)
2025-01-24 06:04:45 -05:00
Ryan Kurtz
d08c215029 GP-0: Formatting 2025-01-24 06:03:47 -05:00
gtackett
047f006c55 Update Omf51RecordTypes.java
Added several more Keil-specific record formats and changed naming
scheme for Keil-specifics.
Update Omf51RecordTypes.java

Change "LibModName" to "LibModNames" (record is a sequence of module
names, not a single module name)
Update Omf51RecordFactory.java

Change "LibModName" to "LibModNames" (record is a sequence of module
names)
Update Omf51RecordTypes.java

Restored accidentally deleted "getRecordName", grouped all new record
types together.
Update Omf51RecordTypes.java

Make all the Keil-specific symbolic names start with "Keil"
Update Omf51RecordTypes.java

Fixed typo/accidental change of case.
2025-01-24 05:59:25 -05:00
Ryan Kurtz
278b6558bc Merge remote-tracking branch 'origin/GP-5256_ModelRuleExt' 2025-01-24 05:46:04 -05:00
Ryan Kurtz
a3a727272f Merge remote-tracking branch 'origin/GP-5307_ryanmkurtz_tlb' 2025-01-24 05:44:26 -05:00
caheckman
00f9789116 GP-5256 ExtraStack, sizes attribute, merge join sequence 2025-01-24 00:05:14 +00:00
ghidra1
acbda8b076 Merge remote-tracking branch 'origin/GP-2614_d-millar_warn_on_mismatch--SQUASHED' 2025-01-23 16:23:48 -05:00
ghidra1
92640122b6 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-23 16:19:44 -05:00
d-millar
fdf1c04e2c GP-2614: from review
GP-2614: minor fix
2025-01-23 15:59:00 -05:00
Ryan Kurtz
ff290dcefc GP-5307: Looking for dbgmodel.tlb in dependencies directory 2025-01-23 13:47:24 -05:00
Ryan Kurtz
6d65367390 Merge remote-tracking branch 'origin/GP-5270_d-millar_eng_options--SQUASHED' 2025-01-23 11:57:35 -05:00
d-millar
0b13f8de50 GP-5270: post-review
GP-5720: engine options
GP-5720: engine options
2025-01-23 11:47:51 -05:00
Ryan Kurtz
f96731be7f Merge remote-tracking branch 'origin/GP-5285_Dan_testArmThumbSkip' 2025-01-23 11:31:14 -05:00
Ryan Kurtz
ac617a796b Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-01-23-25' 2025-01-23 10:46:55 -05:00
dragonmacher
d9b2861d0e Test fix 2025-01-23 10:43:33 -05:00
ghidorahrex
48ae03833e GP-5299: Fixed pop instruction macros 2025-01-23 14:58:46 +00:00
ghidra1
4d546d8be9 Merge branch 'Ghidra_11.3' 2025-01-23 09:09:21 -05:00
Ryan Kurtz
7a37920a21 Merge remote-tracking branch 'origin/GP-5274_ghizard_DefaultCompositeMember_improve_align_add_nopack_option--SQUASHED' 2025-01-22 13:54:35 -05:00
Ryan Kurtz
56960ff779 Merge remote-tracking branch
'origin/GP-5294_d-millar_fix_for_latest_pybag--SQUASHED' (Closes #7397)
2025-01-22 13:53:05 -05:00
Ryan Kurtz
f1f8827878 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-22 13:51:58 -05:00
ghizard
47eeb8b256 GP-5274 - PDB DefaultCompositeMember - improve alignment, add nopack option 2025-01-22 13:39:05 -05:00
d-millar
670b2841ae GP-5294: better still
GP-5294: latest pybag uses py-win32more
2025-01-22 13:28:20 -05:00
Ryan Kurtz
c49f60366b Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-22 13:21:54 -05:00
Dan
836272b909 GP-5285: Add test showing it's not a problem in new stuff. 2025-01-22 16:08:48 +00:00
Ryan Kurtz
4db0ccc8ec Merge remote-tracking branch
'origin/GP-3858-dragonmacher-console-find--SQUASHED'
(Closes #2567, #7136)
2025-01-22 09:09:08 -05:00
Ryan Kurtz
65a284a604 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-22 08:51:58 -05:00
dragonmacher
2208c6ef86 GP-3858 - Console Find - Added a find feature the the Console providers 2025-01-21 16:43:07 -05:00
Ryan Kurtz
ddc5b6d330 Merge branch 'GP-5293_ryanmkurtz_omf-strings' 2025-01-21 13:23:24 -05:00
Ryan Kurtz
0f3f6095d3 GP-5293: Using pascal strings in OMF 2025-01-21 13:22:40 -05:00
Ryan Kurtz
421cb0a691 Merge remote-tracking branch
'origin/GP-5267_ghidracadabra_PR-6520_Sleigh-InSPECtor_x86_sspd'
(Closes #6520)
2025-01-21 13:13:54 -05:00
Ryan Kurtz
f94a76e875 Merge branch 'GP-5291_ryanmkurtz_dyld' (Closes #7396) 2025-01-21 13:12:22 -05:00
Ryan Kurtz
2fc7ffc474 GP-5291: Adding getter methods for fields in DyldCacheHeader. Parsing
new "tpro mapping" fields.
2025-01-21 13:10:39 -05:00
Ryan Kurtz
34e38c3d48 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-21 10:18:58 -05:00
Ryan Kurtz
b1f5cd452a Merge branch 'GP-0_ryanmkurtz_PR-7394_hippietrail_input-spelling' 2025-01-21 07:25:02 -05:00
Ryan Kurtz
b73cdad6fe GP-0: Certify 2025-01-21 07:23:40 -05:00
Ryan Kurtz
df992d04a1 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-21 07:13:18 -05:00
hippietrail
138133c95e correct past & continuous forms of "to input" 2025-01-20 23:12:12 +08:00
Ryan Kurtz
bb4853e414 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-17 14:00:26 -05:00
James
c7be8e9629 GP-5267 updated language version 2025-01-17 18:21:07 +00:00
Sleigh-InSPECtor
1574864072 x86: Fix overlap issue with INCSS/RDSSP 2025-01-17 18:13:59 +00:00
Ryan Kurtz
c5d7728ed3 Merge branch 'GP-5282_ryanmkurtz_make-postgres--SQUASHED' (Closes #7287) 2025-01-17 10:30:47 -05:00
Ryan Kurtz
483dee2889 GP-5282: Adding linux_arm_64 and mac_arm_64 support to make-postgres.sh 2025-01-17 10:30:09 -05:00
Ryan Kurtz
5ca27e36c9 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-17 08:16:33 -05:00
ghidorahrex
e6b326700c GP-4731: Fixed decode for mrs 2025-01-16 20:13:39 +00:00
Ryan Kurtz
d4db37b425 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-16 09:24:14 -05:00
Ryan Kurtz
8a716001ea Merge remote-tracking branch 'origin/GP-5257_ryanmkurtz_gradle-warnings' 2025-01-16 09:01:26 -05:00
Ryan Kurtz
6b148e2cf9 Merge remote-tracking branch 'origin/GP-5238_d-millar_ctadl_mods--SQUASHED' 2025-01-16 06:11:42 -05:00
Ryan Kurtz
cb71c97740 Merge remote-tracking branch 'origin/GP-5203_d-millar_deepfreeze' 2025-01-16 06:10:35 -05:00
Ryan Kurtz
466ba95857 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-16 06:00:06 -05:00
d-millar
dc1b9ae900 GP-5238: from review
GP-5238: adding a sanity check
GP-5238: allow switching between frames
GP-5238: comments
GP-5238: fix for hv matches
GP-5238: chooser for cutsom query
GP-5238: delta working?
GP-5238: first pass at delta
GP-5238: oops
GP-5238: key bindings
GP-5238: better options + docs
2025-01-15 16:59:51 -05:00
d-millar
6cf1f71204 GP-5203: strip DF refs 2025-01-15 02:10:52 +00:00
Ryan Kurtz
73b74cced5 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-14 14:01:51 -05:00
Ryan Kurtz
2589aae3a4 Merge remote-tracking branch 'origin/GP-5262_AutoKilledByCall' 2025-01-14 13:33:34 -05:00
Ryan Kurtz
247e8eada5 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-14 13:32:45 -05:00
caheckman
eba4fc7803 GP-5262 Adjustments to auto killbycall attribute 2025-01-14 16:49:36 +00:00
Ryan Kurtz
0b670e1a25 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-14 09:25:48 -05:00
Ryan Kurtz
9eedabdbe4 GP-0: Fixing test 2025-01-14 08:04:15 -05:00
Ryan Kurtz
79de6c6bf9 GP-0: Adding Troubleshooting section to DevGuide 2025-01-14 07:46:43 -05:00
Ryan Kurtz
4c532fa90b Merge remote-tracking branch
'origin/GP-5258-dragonmacher-symbol-tree-filter-bug--SQUASHED'
(Closes #7365)
2025-01-14 05:56:44 -05:00
dragonmacher
9ae412a0b3 GP-5258 - Fixed a Symbol Tree bug that caused an empty tree when showing the tree with a filter applied 2025-01-13 16:41:36 -05:00
Ryan Kurtz
2138250644 Merge remote-tracking branch 'origin/GP-5257_ryanmkurtz_gradle-warnings' 2025-01-13 16:00:05 -05:00
Ryan Kurtz
44fb13b292 GP-5257: Fixing Gradle warnings 2025-01-13 13:52:50 -05:00
Ryan Kurtz
1a693c40b9 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-13 13:40:51 -05:00
Ryan Kurtz
a41fbeda2f GP-5259: Removing FileBytesProvider check from
AbstractLibrarySupportLoader
2025-01-13 13:15:51 -05:00
Ryan Kurtz
eaa2a5c6b3 Merge remote-tracking branch 'origin/GP-0_d-millar_test_failures_pt2' 2025-01-13 05:45:37 -05:00
d-millar
c4c88e71be GP-0: drgn test failures revisited 2025-01-11 16:47:55 +00:00
Ryan Kurtz
a6256817d4 Merge remote-tracking branch 'origin/GP-5240_SplitPieceLate'
(Closes #7277)
2025-01-10 18:01:58 -05:00
Ryan Kurtz
0f569fbf57 Merge remote-tracking branch 'origin/GP-0_d-millar_drgn_test_failures' 2025-01-10 15:54:05 -05:00
d-millar
fe71611803 GP-0: from review 2025-01-10 20:50:09 +00:00
d-millar
4fd092bb73 GP-0: drgn test failures 2025-01-10 19:20:55 +00:00
ghidra1
74d7fa50ef Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 12:34:13 -05:00
Ryan Kurtz
7a288b3b8c Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 11:24:29 -05:00
Ryan Kurtz
a56c9b3ec6 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 11:03:06 -05:00
Ryan Kurtz
d87b514baa Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 09:49:55 -05:00
Ryan Kurtz
9ecfbd9199 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 08:41:37 -05:00
ghidra1
6583ef3f1a Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 08:17:49 -05:00
Ryan Kurtz
fdd15b7635 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-10 08:05:06 -05:00
Ryan Kurtz
0e95068223 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-08 19:10:00 -05:00
caheckman
53d8d182e3 GP-5240 Simplify late expressions where a SUBPIECE is taken of a PIECE 2025-01-08 23:04:23 +00:00
Ryan Kurtz
502eea1c22 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-08 17:10:31 -05:00
Ryan Kurtz
52a1550eff Merge remote-tracking branch 'origin/GP-326_d-millar_how_to_add_a_debugger--SQUASHED' 2025-01-08 14:56:18 -05:00
d-millar
d5df1c16bb GP-326: never say die
GP-326: recompiling to htmnl
GP-326: recompiling to htmnl
GP-326: last?
GP-326: getting there
GP-326: roll along
GP-326: rolling along
GP-326: test fix
GP-326: miscellaneous post-review fixes
GP-326: complicated stuff
GP-326: more simple stuff
GP-326: navhead fix
GP-326: better docs
GP-326: html for md
GP-326: html for md
GP-326: tutorial edits
GP-326: tutorial edits
GP-326: re-arranging docs
GP-326: from review
GP-326: adding a debugger
GP-326: docs
GP-326: using TestResources - tests pass
GP-326: working tests
GP-326: most cmd/meth tests working
GP-326: cmd tests pass
GP-326: passes thru putmem
GP-326: one test running
GP-326: better startup logic
GP-326: first pass tests
GP-326: misc cleanup
GP-326: cleaner startup
GP-326: cleanup
GP-326: fixes for crash dump
GP-326: util cleanup
GP-326: objects cont.
GP-326: first pass at objects
GP-326: some cleanup
GP-326: regions
GP-326: sections
GP-326: modules
GP-326: alt launchers
GP-326: symbols
GP-326: memory
GP-326: stack frame - regs + locals
GP-326: frames
GP-326: threads
GP-326: better start sequence
GP-326: working launcher
GP-326: util.version
GP-326: arch
2025-01-08 13:16:34 -05:00
Ryan Kurtz
989eb74bf4 GP-0: Bumping master to 11.4 2025-01-07 20:30:58 -05:00
Ryan Kurtz
12551554c1 Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-07 20:29:12 -05:00
ghidra1
409efdfaee Merge remote-tracking branch 'origin/Ghidra_11.3' 2025-01-07 17:29:26 -05:00
befoulad
0c43ccb360 wrap stack limit instruction decoders in ifdef block 2024-12-08 18:52:24 +00:00
befoulad
bb39e4398b define stack limit registers for armv8-m 2024-12-08 18:49:34 +00:00
Behrang
68171d3302
Merge branch 'NationalSecurityAgency:master' into armv8-splimit 2024-12-08 13:11:17 +00:00
ghidorahrex
96c1ec0970 GP-5131: Fixed MIPS16e instruction delayslot relative addressing 2024-11-15 16:14:12 +00:00
philpem
c86d9069c5
Update 6805.slaspec 2024-10-29 19:31:21 +00:00
philpem
e04e47a745
Update HCS_HC.sinc
Incorporate fixes from PR
2024-10-29 19:25:20 +00:00
philpem
67bfea173f
Update HCS_HC.sinc
Fixes https://github.com/NationalSecurityAgency/ghidra/issues/7064 for 68HC05
2024-10-17 01:24:10 +01:00
philpem
270e6867db
Update 6805.slaspec
Fix for https://github.com/NationalSecurityAgency/ghidra/issues/7064 (incorrect handling of X-indexed JMP and JSR)
2024-10-17 00:10:26 +01:00
Sleigh-InSPECtor
8473b248a1 AA64: fix ld<n>r registers 2024-04-30 15:43:55 +09:30
Vesa-Pekka Palmu
387c283e89 Github issue #5767 - 6x09.sinc: Fix COM instruction
The complement macro was erroneously always complementing A register
instead of the macro parameter op. This caused errors with the COMB
and COM OP1 instructions.

Closes #5767.
2024-03-20 17:56:14 +02:00
Antonio Vázquez Blanco
a38d30f233 processors:pic: Fix PIC16F description 2024-02-15 23:06:22 +01:00
Behrang Fouladi
220763c40f instruction decoding for armv8 stack pointer limit registers 2023-04-24 12:25:49 +02:00
5373 changed files with 522802 additions and 121466 deletions

View file

@ -29,98 +29,106 @@ Patches should be submitted in the form of Pull Requests to the Ghidra
[repository] on GitHub. But first, consider the following tips to ensure a [repository] on GitHub. But first, consider the following tips to ensure a
smooth process when submitting a patch: smooth process when submitting a patch:
- Ensure that the patch compiles and does not break any build-time tests. - Ensure that the patch compiles and runs in at least our development environment, and ideally our
- Be understanding, patient, and friendly; developers may need time to review full build too. Even the most trivial change done in the GitHub editor has a chance to cause
your submissions before they can take action or respond. This does not mean problems in the full development environment for unexpected reasons.
your contribution is not valued. If your contribution has not received a - If using "AI" to assist in development, please apply extra scrutity to its suggestions, in terms
response in a reasonable time, consider commenting with a polite inquiry for of both correctness and adherence to our [legal](#legal) requirements.
an update. - Be understanding, patient, and friendly; developers may need time to review your submissions
- Limit your patches to the smallest reasonable change to achieve your intended before they can take action or respond. This does not mean your contribution is not valued. If
goal. For example, do not make unnecessary indentation changes; but don't go your contribution has not received a response in a reasonable time, consider commenting with a
out of your way to make the patch so minimal that it isn't easy to read, polite inquiry for an update.
either. Consider the reviewer's perspective. - Limit your patches to the smallest reasonable change to achieve your intended goal. For example,
- Unless previously authorized by the Ghidra team, repackaging, renaming, and do not make unnecessary indentation changes; but don't go out of your way to make the patch so
other refactoring should not be part of any pull request. These types of minimal that it isn't easy to read, either. Consider the reviewer's perspective.
changes are difficult to review, pollute the git history making it harder - Unless previously authorized by the Ghidra team, repackaging, renaming, and other refactoring
to do git forensics on regressions, and will likely conflict with other should not be part of any pull request. These types of changes are difficult to review, pollute
changes that the Ghidra team is making internally. the git history making it harder to do git forensics on regressions, and will likely conflict with
- Avoid "find and replace" changes in your pull request. While it may be other changes that the Ghidra team is making internally.
tempting to globally replace calls to deprecated methods or change the style - Avoid "find and replace" changes in your pull request. While it may be tempting to globally
of the code to fit your personal preference, these types of seemingly trivial replace calls to deprecated methods or change the style of the code to fit your personal
changes have likely not already been performed by the Ghidra team for good preference, these types of seemingly trivial changes have likely not already been performed by the
reason. Ghidra team for good reason.
- Focus your patches on bug fixes that were discovered through real-world - Focus your patches on bug fixes that were discovered through real-world usage and testing, and on
usage and testing, and on improvements that clearly satisfy a need in improvements that clearly satisfy a need in Ghidra's functionality. Before you begin
Ghidra's functionality. Before you begin implementing, consider first implementing, consider first opening a dialogue with the Ghidra team to ensure that your efforts
opening a dialogue with the Ghidra team to ensure that your efforts will will align with the goals of the project. This will significantly improve the odds that your
align with the goals of the project. This will significantly improve the odds patch gets accepted.
that your patch gets accepted. - Unless it addresses a critical security update, avoid pull requests that update jars or other 3rd
- Unless it addresses a critical security update, avoid pull requests that update party libraries. It is preferred that these changes are made internally by the team. If you have
jars or other 3rd party libraries. It is preferred that these changes are made a need for an updated library, please submit an issue with your request instead of a pull request.
internally by the team. If you have a need for an updated library, please - Before submission, please squash your commits to using a message that starts with the issue number
submit an issue with your request instead of a pull request. and a description of the changes.
- Before submission, please squash your commits to using a message that starts - Isolate multiple patches from each other. If you wish to make several independent patches, do so
with the issue number and a description of the changes. in separate, smaller pull requests that can be reviewed more easily.
- Isolate multiple patches from each other. If you wish to make several - Avoid submitting self-generated binary files as part of your pull request. Despite your best
independent patches, do so in separate, smaller pull requests that can be intentions, our policy forbids accepting them because we cannot effectively review and validate
reviewed more easily. their content.
- Be prepared to answer questions from reviewers. They may have further - Be prepared to answer questions from reviewers. They may have further questions before accepting
questions before accepting your patch, and may even propose changes. Please your patch, and may even propose changes. Please accept this feedback constructively, and not as a
accept this feedback constructively, and not as a rejection of your proposed rejection of your proposed change.
change.
## Review ## Review
- We welcome code reviews from anyone. A committer is required to formally - We welcome code reviews from anyone. A committer is required to formally accept and merge the
accept and merge the changes. changes.
- Reviewers will be looking for things like threading issues, performance - Reviewers will be looking for things like threading issues, performance implications, API design,
implications, API design, duplication of existing functionality, readability duplication of existing functionality, readability and code style, avoidance of bloat
and code style, avoidance of bloat (scope-creep), etc. (scope-creep), etc.
- Reviewers will likely ask questions to better understand your change. - Reviewers will likely ask questions to better understand your change.
- Reviewers will make comments about changes to your patch: - Reviewers will make comments about changes to your patch:
- MUST means that the change is required - MUST means that the change is required
- SHOULD means that the change is suggested, further discussion on the - SHOULD means that the change is suggested, further discussion on the subject may be required
subject may be required
- COULD means that the change is optional - COULD means that the change is optional
## Getting Started ## Getting Started
Once available, please see the [developer's guide][devguide] for instructions to set up a suitable development environment. Once available, please see the [developer's guide][devguide] for instructions to set up a suitable
development environment.
## Timeline and Managing Expectations ## Timeline and Managing Expectations
As we continue to engage contributors and learn best practices for running a successful open source project, our processes As we continue to engage contributors and learn best practices for running a successful open source
and guidance will likely evolve. We will try to communicate expectations as we are able and to always be responsive. We project, our processes and guidance will likely evolve. We will try to communicate expectations as
hope that the community will share their suggestions for improving this engagement. Based on the level of initial interest we are able to and be responsive. We hope that the community will share their suggestions for
we receive and the availability of resources to evaluate contributions, we anticipate the following: improving this engagement. Based on the level of initial interest we receive and the availability
of resources to evaluate contributions, we anticipate the following:
- We will initially prioritize pull requests that include small bug fixes and code that addresses potential vulnerabilities - We will initially prioritize pull requests that include small bug fixes and code that addresses
as well as pull requests that include improvements for processor language specifications because these require a potential vulnerabilities as well as pull requests that include improvements for processor
reasonable amount of effort to evaluate and will help us exercise and revise our process for accepting contributions. In language specifications because these require a reasonable amount of effort to evaluate and will
other words, we are going to start small in order to work out the kinks first. help us exercise and revise our process for accepting contributions. In other words, we are going
- We are committed to maintaining the integrity and security of our code base. In addition to the careful review the to start small in order to work out the kinks first.
maintainers will give to code contributions to make sure they do not introduce new bugs or vulnerabilities, we will be - We are committed to maintaining the integrity and security of our code base. In addition to the
trying to identify best practices to incorporate with our open source project so that contributors can have more control careful review the maintainers will give to code contributions to make sure they do not introduce
over whether their contributions are accepted. These might include things like style guides and requirements for tests and new bugs or vulnerabilities, we will be trying to identify best practices to incorporate with our
documentation to accompany some code contributions. As a result, it may take a long time for some contributions to be open source project so that contributors can have more control over whether their contributions
accepted. This does not mean we are ignoring them. are accepted. These might include things like style guides and requirements for tests and
- We are committed to integrating this GitHub project with our team's regular development work flow so that the open source documentation to accompany some code contributions. As a result, it may take a long time for some
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests contributions to be accepted. This does not mean we are ignoring them.
quickly. This does not mean we are ignoring them. - We are committed to integrating this GitHub project with our team's regular development work flow
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community. so that the open source project remains dynamic and relevant. This may affect our responsiveness
There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own and ability to accept pull requests quickly. This does not mean we are ignoring them.
repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we - Not all innovative ideas need to be accepted as pull requests into this GitHub project to be
may seek to incorporate them with our baseline. valuable to the community. There may be times when we recommend that you just share your code for
some enhancement to Ghidra from your own repository. As we identify and recognize extensions that
are of general interest to the reverse engineering community, we may seek to incorporate them with
our baseline.
## Legal ## Legal
Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and Section 5. of the Apache License, Version 2.0, the project maintainer for this project accepts contributions using the inbound=outbound model. Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and Section 5. of the Apache
When you submit a pull request to this repository (inbound), you are agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound). License, Version 2.0, the project maintainer for this project accepts contributions using the
inbound=outbound model. When you submit a pull request to this repository (inbound), you are
agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound).
This is an open source project. This is an open source project. Contributions you make to this public U.S. Government ("USG")
Contributions you make to this public U.S. Government ("USG") repository are completely voluntary. repository are completely voluntary. When you submit an issue, bug report, question, enhancement,
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against the USG related to your contribution, and you acknowledge that this does not create an obligation on the part of the USG of any kind. pull request, etc., you are offering your contribution without expectation of payment, you expressly
Furthermore, your contributing to this project does not create an employer-employee relationship between the United States ("U.S.") Government and the contributor. waive any future pay claims against the USG related to your contribution, and you acknowledge that
this does not create an obligation on the part of the USG of any kind. Furthermore, your
contributing to this project does not create an employer-employee relationship between the United
States ("U.S.") Government and the contributor.
[issues]: https://github.com/NationalSecurityAgency/ghidra/issues [issues]: https://github.com/NationalSecurityAgency/ghidra/issues
[repository]: https://github.com/NationalSecurityAgency/ghidra/ [repository]: https://github.com/NationalSecurityAgency/ghidra/

View file

@ -41,6 +41,12 @@ will be stored at `$HOME/.gradle/`.
gradle prepdev gradle prepdev
``` ```
Clean up repository build files. In rare circumstances this may be necessary after a `git pull` to
fix unexplainable compilation errors.
```
gradle clean
```
Generate nested Eclipse project files which can then be imported into Eclipse as "existing Generate nested Eclipse project files which can then be imported into Eclipse as "existing
projects". projects".
``` ```
@ -354,6 +360,53 @@ We also provide out-of-the-box QEMU integration via GDB.
When submitting help tickets and pull requests, please tag those related to the debugger with "Debugger" so that we can triage them more quickly. When submitting help tickets and pull requests, please tag those related to the debugger with "Debugger" so that we can triage them more quickly.
## Troubleshooting and Help
### Eclipse Issues
After pulling or syncing with the latest Ghidra source repository, you might run into the following
issues in Eclipse:
* __Problem:__ _There are Eclipse compilation errors that I don't know how to deal with...I give up!_
* __Solution:__
* From Eclipse, collapse all projects in the _Package Explorer_ or _Project Explorer_ by
clicking the `⊟` icon in that frame
* Locate any projects in the _Package Explorer_ or _Project Explorer_ that have little `?` icons
on them (these projects should no longer be in source control)
* Right-click on __only them__, and then click _Delete_.
* __CHECK__ the _"Delete project contents on disk"_ checkbox.
* Click _OK_ (confirm git does not contain any new unstaged files for delete)
* Select all projects in the _Package Explorer_ or _Project Explorer_
* Right-click on them, and then click _Delete_ (this may not work if projects are not collapsed)
* Leave _"Delete project contents on disk"_ checkbox __UNCHECKED__
* Click _OK_. You should now have an empty _Package Explorer_ or _Project Explorer_.
* `gradle -I gradle/support/fetchDependencies.gradle`
* `gradle prepdev cleanEclipse eclipse buildNatives`
* From Eclipse, _File -> Import..._
* _General | Existing Projects into Workspace_
* Select root directory to be your downloaded or cloned ghidra source repository
* Check _"Search for nested projects"_
* Click _Finish_
This should get Eclipse back to a fresh state. There should never be a need to re-clone the
repository.
* __Problem:__ _The Ghidra run configurations (launchers) are missing_.
* __Solution:__
The Ghidra run configurations are kept under source control in various modules' `.launch/`
directories (i.e., `Ghidra/Features/Base/.launch/`). As long as the corresponding module
project is imported into Eclipse (i.e., `Features Base`), the run configurations should be
available in Eclipse under _Run -> Run Configurations_. If they aren't there and the
projects are imported, try closing and reopening Eclipse.
__NOTE:__ Sometimes you have to launch Ghidra via the _Run -> Run Configurations..._ window one
time for the run configuration to show up under the favorites menu in the main Eclipse button
bar.
__NOTE:__ Never address missing run configurations by manually importing them via _File ->
Import... -> Run/Debug -> Launch Configurations._ This avoids the real issue and will
inevitably result in duplicate run configurations showing up one day, which can cause
additional confusion.
## Known Issues ## Known Issues
* There is a known issue in Gradle that can prevent it from discovering native toolchains on Linux * There is a known issue in Gradle that can prevent it from discovering native toolchains on Linux
if a non-English system locale is being used. As a workaround, set the following environment if a non-English system locale is being used. As a workaround, set the following environment
@ -363,7 +416,7 @@ When submitting help tickets and pull requests, please tag those related to the
[java]: https://dev.java [java]: https://dev.java
[cpp]: https://isocpp.org [cpp]: https://isocpp.org
[sleigh]: https://htmlpreview.github.io/?https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraDocs/languages/index.html [sleigh]: https://htmlpreview.github.io/?https://github.com/NationalSecurityAgency/ghidra/blob/stable/GhidraDocs/languages/index.html
[python]: https://www.python.org [python]: https://www.python.org
[venv]: https://docs.python.org/3/tutorial/venv.html [venv]: https://docs.python.org/3/tutorial/venv.html
[jython]: https://www.jython.org [jython]: https://www.jython.org

View file

@ -13,9 +13,6 @@ package mobiledevices.dmg.ghidra;
public class GDataConverterBE implements GDataConverter { public class GDataConverterBE implements GDataConverter {
public static final GDataConverterBE INSTANCE = new GDataConverterBE(); public static final GDataConverterBE INSTANCE = new GDataConverterBE();
/**
*
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
@ -27,6 +24,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getShort(byte[]) * @see GDataConverter#getShort(byte[])
*/ */
@Override
public final short getShort(byte[] b) { public final short getShort(byte[] b) {
return getShort(b, 0); return getShort(b, 0);
} }
@ -34,6 +32,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getShort(byte[], int) * @see GDataConverter#getShort(byte[], int)
*/ */
@Override
public short getShort(byte[] b, int offset) { public short getShort(byte[] b, int offset) {
return (short) (((b[offset] & 0xff) << 8) | (b[offset + 1] & 0xff)); return (short) (((b[offset] & 0xff) << 8) | (b[offset + 1] & 0xff));
} }
@ -41,6 +40,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getInt(byte[]) * @see GDataConverter#getInt(byte[])
*/ */
@Override
public final int getInt(byte[] b) { public final int getInt(byte[] b) {
return getInt(b, 0); return getInt(b, 0);
} }
@ -48,6 +48,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getInt(byte[], int) * @see GDataConverter#getInt(byte[], int)
*/ */
@Override
public int getInt(byte[] b, int offset) { public int getInt(byte[] b, int offset) {
int v = b[offset]; int v = b[offset];
for (int i = 1; i < 4; i++) { for (int i = 1; i < 4; i++) {
@ -59,6 +60,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getLong(byte[]) * @see GDataConverter#getLong(byte[])
*/ */
@Override
public final long getLong(byte[] b) { public final long getLong(byte[] b) {
return getLong(b, 0); return getLong(b, 0);
} }
@ -66,6 +68,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getLong(byte[], int) * @see GDataConverter#getLong(byte[], int)
*/ */
@Override
public long getLong(byte[] b, int offset) { public long getLong(byte[] b, int offset) {
long v = b[offset]; long v = b[offset];
for (int i = 1; i < 8; i++) { for (int i = 1; i < 8; i++) {
@ -77,6 +80,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getValue(byte[], int) * @see GDataConverter.util.DataConverter#getValue(byte[], int)
*/ */
@Override
public long getValue(byte[] b, int size) { public long getValue(byte[] b, int size) {
return getValue(b, 0, size); return getValue(b, 0, size);
} }
@ -84,6 +88,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getValue(byte[], int, int) * @see GDataConverter.util.DataConverter#getValue(byte[], int, int)
*/ */
@Override
public long getValue(byte[] b, int offset, int size) { public long getValue(byte[] b, int offset, int size) {
if (size > 8) { if (size > 8) {
throw new IndexOutOfBoundsException("size exceeds sizeof long: " + size); throw new IndexOutOfBoundsException("size exceeds sizeof long: " + size);
@ -98,6 +103,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(short, byte[]) * @see GDataConverter#getBytes(short, byte[])
*/ */
@Override
public final void getBytes(short value, byte[] b) { public final void getBytes(short value, byte[] b) {
getBytes(value, b, 0); getBytes(value, b, 0);
} }
@ -105,6 +111,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(short, byte[], int) * @see GDataConverter#getBytes(short, byte[], int)
*/ */
@Override
public void getBytes(short value, byte[] b, int offset) { public void getBytes(short value, byte[] b, int offset) {
b[offset] = (byte) (value >> 8); b[offset] = (byte) (value >> 8);
b[offset + 1] = (byte) (value & 0xff); b[offset + 1] = (byte) (value & 0xff);
@ -113,6 +120,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(int, byte[]) * @see GDataConverter#getBytes(int, byte[])
*/ */
@Override
public final void getBytes(int value, byte[] b) { public final void getBytes(int value, byte[] b) {
getBytes(value, b, 0); getBytes(value, b, 0);
} }
@ -120,6 +128,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(int, byte[], int) * @see GDataConverter#getBytes(int, byte[], int)
*/ */
@Override
public void getBytes(int value, byte[] b, int offset) { public void getBytes(int value, byte[] b, int offset) {
b[offset + 3] = (byte) (value); b[offset + 3] = (byte) (value);
for (int i = 2; i >= 0; i--) { for (int i = 2; i >= 0; i--) {
@ -131,6 +140,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(long, byte[]) * @see GDataConverter#getBytes(long, byte[])
*/ */
@Override
public final void getBytes(long value, byte[] b) { public final void getBytes(long value, byte[] b) {
getBytes(value, 8, b, 0); getBytes(value, 8, b, 0);
} }
@ -138,6 +148,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(long, byte[], int) * @see GDataConverter#getBytes(long, byte[], int)
*/ */
@Override
public void getBytes(long value, byte[] b, int offset) { public void getBytes(long value, byte[] b, int offset) {
getBytes(value, 8, b, offset); getBytes(value, 8, b, offset);
} }
@ -145,6 +156,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getBytes(long, int, byte[], int) * @see GDataConverter.util.DataConverter#getBytes(long, int, byte[], int)
*/ */
@Override
public void getBytes(long value, int size, byte[] b, int offset) { public void getBytes(long value, int size, byte[] b, int offset) {
for (int i = size - 1; i >= 0; i--) { for (int i = size - 1; i >= 0; i--) {
b[offset + i] = (byte) value; b[offset + i] = (byte) value;
@ -155,6 +167,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putInt(byte[], int, int) * @see GDataConverter.util.DataConverter#putInt(byte[], int, int)
*/ */
@Override
public final void putInt(byte[] b, int offset, int value) { public final void putInt(byte[] b, int offset, int value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -162,6 +175,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putInt(byte[], int) * @see GDataConverter.util.DataConverter#putInt(byte[], int)
*/ */
@Override
public final void putInt(byte[] b, int value) { public final void putInt(byte[] b, int value) {
getBytes(value, b); getBytes(value, b);
} }
@ -169,6 +183,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putLong(byte[], int, long) * @see GDataConverter.util.DataConverter#putLong(byte[], int, long)
*/ */
@Override
public final void putLong(byte[] b, int offset, long value) { public final void putLong(byte[] b, int offset, long value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -176,6 +191,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putLong(byte[], long) * @see GDataConverter.util.DataConverter#putLong(byte[], long)
*/ */
@Override
public final void putLong(byte[] b, long value) { public final void putLong(byte[] b, long value) {
getBytes(value, b); getBytes(value, b);
} }
@ -183,6 +199,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putShort(byte[], int, short) * @see GDataConverter.util.DataConverter#putShort(byte[], int, short)
*/ */
@Override
public final void putShort(byte[] b, int offset, short value) { public final void putShort(byte[] b, int offset, short value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -190,6 +207,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#putShort(byte[], short) * @see GDataConverter.util.DataConverter#putShort(byte[], short)
*/ */
@Override
public final void putShort(byte[] b, short value) { public final void putShort(byte[] b, short value) {
getBytes(value, b); getBytes(value, b);
} }
@ -197,6 +215,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getBytes(int) * @see GDataConverter.util.DataConverter#getBytes(int)
*/ */
@Override
public byte[] getBytes(int value) { public byte[] getBytes(int value) {
byte[] bytes = new byte[4]; byte[] bytes = new byte[4];
getBytes(value, bytes); getBytes(value, bytes);
@ -206,6 +225,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getBytes(long) * @see GDataConverter.util.DataConverter#getBytes(long)
*/ */
@Override
public byte[] getBytes(long value) { public byte[] getBytes(long value) {
byte[] bytes = new byte[8]; byte[] bytes = new byte[8];
getBytes(value, bytes); getBytes(value, bytes);
@ -215,6 +235,7 @@ public class GDataConverterBE implements GDataConverter {
/** /**
* @see GDataConverter.util.DataConverter#getBytes(short) * @see GDataConverter.util.DataConverter#getBytes(short)
*/ */
@Override
public byte[] getBytes(short value) { public byte[] getBytes(short value) {
byte[] bytes = new byte[2]; byte[] bytes = new byte[2];
getBytes(value, bytes); getBytes(value, bytes);

View file

@ -11,9 +11,7 @@ package mobiledevices.dmg.ghidra;
public class GDataConverterLE implements GDataConverter { public class GDataConverterLE implements GDataConverter {
public static GDataConverterLE INSTANCE = new GDataConverterLE(); public static GDataConverterLE INSTANCE = new GDataConverterLE();
/**
*
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
@ -25,6 +23,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getShort(byte[]) * @see GDataConverter#getShort(byte[])
*/ */
@Override
public final short getShort(byte[] b) { public final short getShort(byte[] b) {
return getShort(b, 0); return getShort(b, 0);
} }
@ -32,6 +31,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getShort(byte[], int) * @see GDataConverter#getShort(byte[], int)
*/ */
@Override
public short getShort(byte[] b, int offset) { public short getShort(byte[] b, int offset) {
return (short) (((b[offset + 1] & 0xff) << 8) | (b[offset] & 0xff)); return (short) (((b[offset + 1] & 0xff) << 8) | (b[offset] & 0xff));
} }
@ -39,6 +39,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getInt(byte[]) * @see GDataConverter#getInt(byte[])
*/ */
@Override
public final int getInt(byte[] b) { public final int getInt(byte[] b) {
return getInt(b, 0); return getInt(b, 0);
} }
@ -46,6 +47,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getInt(byte[], int) * @see GDataConverter#getInt(byte[], int)
*/ */
@Override
public int getInt(byte[] b, int offset) { public int getInt(byte[] b, int offset) {
int v = b[offset + 3]; int v = b[offset + 3];
for (int i = 2; i >= 0; i--) { for (int i = 2; i >= 0; i--) {
@ -57,6 +59,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getLong(byte[]) * @see GDataConverter#getLong(byte[])
*/ */
@Override
public final long getLong(byte[] b) { public final long getLong(byte[] b) {
return getLong(b, 0); return getLong(b, 0);
} }
@ -64,6 +67,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getLong(byte[], int) * @see GDataConverter#getLong(byte[], int)
*/ */
@Override
public long getLong(byte[] b, int offset) { public long getLong(byte[] b, int offset) {
long v = b[offset + 7]; long v = b[offset + 7];
for (int i = 6; i >= 0; i--) { for (int i = 6; i >= 0; i--) {
@ -75,6 +79,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getValue(byte[], int) * @see ghidra.util.GDataConverter#getValue(byte[], int)
*/ */
@Override
public long getValue(byte[] b, int size) { public long getValue(byte[] b, int size) {
return getValue(b, 0, size); return getValue(b, 0, size);
} }
@ -82,6 +87,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getValue(byte[], int, int) * @see ghidra.util.GDataConverter#getValue(byte[], int, int)
*/ */
@Override
public long getValue(byte[] b, int offset, int size) { public long getValue(byte[] b, int offset, int size) {
if (size > 8) { if (size > 8) {
throw new IndexOutOfBoundsException("size exceeds sizeof long: " + size); throw new IndexOutOfBoundsException("size exceeds sizeof long: " + size);
@ -96,6 +102,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(short, byte[]) * @see GDataConverter#getBytes(short, byte[])
*/ */
@Override
public final void getBytes(short value, byte[] b) { public final void getBytes(short value, byte[] b) {
getBytes(value, b, 0); getBytes(value, b, 0);
} }
@ -103,6 +110,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(short, byte[], int) * @see GDataConverter#getBytes(short, byte[], int)
*/ */
@Override
public void getBytes(short value, byte[] b, int offset) { public void getBytes(short value, byte[] b, int offset) {
b[offset + 1] = (byte) (value >> 8); b[offset + 1] = (byte) (value >> 8);
b[offset] = (byte) (value & 0xff); b[offset] = (byte) (value & 0xff);
@ -111,6 +119,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(int, byte[]) * @see GDataConverter#getBytes(int, byte[])
*/ */
@Override
public final void getBytes(int value, byte[] b) { public final void getBytes(int value, byte[] b) {
getBytes(value, b, 0); getBytes(value, b, 0);
} }
@ -118,6 +127,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(int, byte[], int) * @see GDataConverter#getBytes(int, byte[], int)
*/ */
@Override
public void getBytes(int value, byte[] b, int offset) { public void getBytes(int value, byte[] b, int offset) {
b[offset] = (byte) (value); b[offset] = (byte) (value);
for (int i = 1; i < 4; i++) { for (int i = 1; i < 4; i++) {
@ -129,6 +139,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(long, byte[]) * @see GDataConverter#getBytes(long, byte[])
*/ */
@Override
public final void getBytes(long value, byte[] b) { public final void getBytes(long value, byte[] b) {
getBytes(value, 8, b, 0); getBytes(value, 8, b, 0);
} }
@ -136,6 +147,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see GDataConverter#getBytes(long, byte[], int) * @see GDataConverter#getBytes(long, byte[], int)
*/ */
@Override
public void getBytes(long value, byte[] b, int offset) { public void getBytes(long value, byte[] b, int offset) {
getBytes(value, 8, b, offset); getBytes(value, 8, b, offset);
} }
@ -143,6 +155,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getBytes(long, int, byte[], int) * @see ghidra.util.GDataConverter#getBytes(long, int, byte[], int)
*/ */
@Override
public void getBytes(long value, int size, byte[] b, int offset) { public void getBytes(long value, int size, byte[] b, int offset) {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
b[offset + i] = (byte) value; b[offset + i] = (byte) value;
@ -153,6 +166,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putInt(byte[], int, int) * @see ghidra.util.GDataConverter#putInt(byte[], int, int)
*/ */
@Override
public final void putInt(byte[] b, int offset, int value) { public final void putInt(byte[] b, int offset, int value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -160,6 +174,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putInt(byte[], int) * @see ghidra.util.GDataConverter#putInt(byte[], int)
*/ */
@Override
public final void putInt(byte[] b, int value) { public final void putInt(byte[] b, int value) {
getBytes(value, b); getBytes(value, b);
} }
@ -167,6 +182,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putLong(byte[], int, long) * @see ghidra.util.GDataConverter#putLong(byte[], int, long)
*/ */
@Override
public final void putLong(byte[] b, int offset, long value) { public final void putLong(byte[] b, int offset, long value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -174,6 +190,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putLong(byte[], long) * @see ghidra.util.GDataConverter#putLong(byte[], long)
*/ */
@Override
public final void putLong(byte[] b, long value) { public final void putLong(byte[] b, long value) {
getBytes(value, b); getBytes(value, b);
} }
@ -181,6 +198,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putShort(byte[], int, short) * @see ghidra.util.GDataConverter#putShort(byte[], int, short)
*/ */
@Override
public final void putShort(byte[] b, int offset, short value) { public final void putShort(byte[] b, int offset, short value) {
getBytes(value, b, offset); getBytes(value, b, offset);
} }
@ -188,6 +206,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#putShort(byte[], short) * @see ghidra.util.GDataConverter#putShort(byte[], short)
*/ */
@Override
public final void putShort(byte[] b, short value) { public final void putShort(byte[] b, short value) {
getBytes(value, b); getBytes(value, b);
} }
@ -195,6 +214,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getBytes(int) * @see ghidra.util.GDataConverter#getBytes(int)
*/ */
@Override
public byte[] getBytes(int value) { public byte[] getBytes(int value) {
byte[] bytes = new byte[4]; byte[] bytes = new byte[4];
getBytes(value, bytes); getBytes(value, bytes);
@ -204,6 +224,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getBytes(long) * @see ghidra.util.GDataConverter#getBytes(long)
*/ */
@Override
public byte[] getBytes(long value) { public byte[] getBytes(long value) {
byte[] bytes = new byte[8]; byte[] bytes = new byte[8];
getBytes(value, bytes); getBytes(value, bytes);
@ -213,6 +234,7 @@ public class GDataConverterLE implements GDataConverter {
/** /**
* @see ghidra.util.GDataConverter#getBytes(short) * @see ghidra.util.GDataConverter#getBytes(short)
*/ */
@Override
public byte[] getBytes(short value) { public byte[] getBytes(short value) {
byte[] bytes = new byte[2]; byte[] bytes = new byte[2];
getBytes(value, bytes); getBytes(value, bytes);

View file

@ -35,8 +35,8 @@ def srcVersion24 = "src/demangler_gnu_v2_24"
*/ */
task zipBuildableSource(type:Zip) { task zipBuildableSource(type:Zip) {
group 'private' group = 'private'
description "Collects the source files needed to build this module." description = "Collects the source files needed to build this module."
archiveBaseName = project.name + "-src-for-build" archiveBaseName = project.name + "-src-for-build"
archiveExtension = 'zip' archiveExtension = 'zip'

View file

@ -76,8 +76,8 @@ gradle.taskGraph.whenReady {
* Task to unpack the standard binutils zip file * Task to unpack the standard binutils zip file
*******************************************************************************************/ *******************************************************************************************/
task binutilsUnpack { task binutilsUnpack {
description "Unpack binutils (for building gdis)" description = "Unpack binutils (for building gdis)"
group "Native Build Dependencies" group = "Native Build Dependencies"
outputs.file { binutilsUnpackDir } outputs.file { binutilsUnpackDir }
onlyIf { !binutilsUnpackDir.exists() } onlyIf { !binutilsUnpackDir.exists() }
@ -104,8 +104,8 @@ supportedPlatforms.each { platform ->
def artifactsDir = file("build/binutils/${platform}") def artifactsDir = file("build/binutils/${platform}")
task(buildName) { task(buildName) {
description "Configure and make binutils for $platform (for building gdis)" description ="Configure and make binutils for $platform (for building gdis)"
group "Native Prebuild Dependencies" group = "Native Prebuild Dependencies"
onlyIf { !configDir.exists() } onlyIf { !configDir.exists() }
@ -122,21 +122,21 @@ supportedPlatforms.each { platform ->
println "Configuring binutils - config directory: $configDir" println "Configuring binutils - config directory: $configDir"
println "${binutilsDir}/configure --prefix=\"${configDir}\" --enable-targets=all --with-zlib=no --disable-nls --disable-werror" println "${binutilsDir}/configure --prefix=\"${configDir}\" --enable-targets=all --with-zlib=no --disable-nls --disable-werror"
configDir.mkdirs(); configDir.mkdirs();
exec { providers.exec {
workingDir configDir workingDir configDir
commandLine "${binutilsDir}/configure", "--prefix=${configDir}", "--enable-targets=all", "--with-zlib=no", "--disable-nls", "--disable-werror" commandLine "${binutilsDir}/configure", "--prefix=${configDir}", "--enable-targets=all", "--with-zlib=no", "--disable-nls", "--disable-werror"
} }.result.get()
println "Building binutils - config directory: $configDir" println "Building binutils - config directory: $configDir"
exec { providers.exec {
commandLine "make", "-C", "${configDir}", "all" commandLine "make", "-C", "${configDir}", "all"
} }.result.get()
} }
} }
task(postBuildName, type: Copy) { task(postBuildName, type: Copy) {
description "Copy binutil artifcacts for $platform (for building gdis)" description = "Copy binutil artifcacts for $platform (for building gdis)"
group "Native Prebuild Dependencies" group = "Native Prebuild Dependencies"
dependsOn buildName dependsOn buildName

View file

@ -34,39 +34,25 @@ model {
} }
} }
// The toolChains block is needed because Gradle doesn't find gcc/clang on ARM-based Linux // The toolChains block is needed because Gradle doesn't find the native toolchain in various
// and macOS platforms without explicitly declaring their targets. Might be a bug in the // scenarios. These checks, can be removed when Gradle fixes them, and we advertise a
// native Gradle plugin. // minimum Gradle version that includes the fix.
toolChains { toolChains {
if (isCurrentLinux()) { def current = getCurrentPlatformName()
gcc(Gcc) { if (isLinux(current)) {
if (isCurrentArm_64()) { // https://github.com/gradle/gradle/issues/17660 (fixed in Gradle 8.11)
target("linux_arm_64") gcc(Gcc).target(current)
clang(Clang).target(current)
} }
if (isFreeBSD(current)) {
// https://github.com/gradle/gradle/issues/32895
gcc(Gcc).target(current)
clang(Clang).target(current)
} }
} if (isWindows(current) && VISUAL_STUDIO_INSTALL_DIR) {
if (isCurrentMac()) { // https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
clang(Clang) {
if (isCurrentArm_64()) {
target("mac_arm_64")
}
}
}
if (isCurrentFreeBSD()) {
gcc(Gcc) {
if (isCurrentArm_64()) {
target("freebsd_arm_64")
}
else {
target("freebsd_x86_64")
}
}
}
if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR) {
// specify installDir because Gradle doesn't find VS Build Tools.
// See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
visualCpp(VisualCpp) { visualCpp(VisualCpp) {
installDir VISUAL_STUDIO_INSTALL_DIR installDir = VISUAL_STUDIO_INSTALL_DIR
} }
} }
} }
@ -121,6 +107,9 @@ def isNativeBinaryMakeTask(Task task, String platform) {
* *
******************************************************************************************/ ******************************************************************************************/
def shouldSkipNative(task) { def shouldSkipNative(task) {
if (rootProject.hasProperty("skipAllNatives")) {
return true;
}
return task.ext.has("skipNative") && task.ext.get("skipNative") return task.ext.has("skipNative") && task.ext.get("skipNative")
} }

View file

@ -34,7 +34,7 @@ def configureVisualStudio() {
println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=<vswhere path>\" to the Gradle command line arguments" println " -> To manually specify the location of vswhere.exe, add \"-PvswherePath=<vswhere path>\" to the Gradle command line arguments"
return return
} }
def vswhereProcess = "\"${vswherePath}\" -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute() def vswhereProcess = "\"${vswherePath}\" -products * -sort -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json -utf8".execute()
def vswhereOutput = vswhereProcess.text.trim() def vswhereOutput = vswhereProcess.text.trim()
def vswhereExit = vswhereProcess.exitValue() def vswhereExit = vswhereProcess.exitValue()
if (vswhereExit != 0) { if (vswhereExit != 0) {
@ -45,15 +45,31 @@ def configureVisualStudio() {
println " -> Visual Studio vswhere.exe returned an error code (${vswhereExit})!" println " -> Visual Studio vswhere.exe returned an error code (${vswhereExit})!"
} }
println " -> Please confirm ${vswherePath} is version 2.5 or later." println " -> Please confirm ${vswherePath} is version 2.5 or later."
println " -> Please check README.md or InstallationGuide.html to verify you are using a supported version of Visual Studio." println " -> Please check README.md or GettingStarted.md to verify you are using a supported version of Visual Studio."
return return
} }
def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput); def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput);
if (vswhereJson.isEmpty()) { def usePrerelease = project.hasProperty("vswherePrerelease")
def i = -1
println " -> Searching for Visual Studio installations..."
vswhereJson.eachWithIndex { item, index ->
def isPrerelease = item.get("isPrerelease")
def name = item.get("displayName") + (isPrerelease ? " Prerelease" : "")
if (i == -1) {
if (usePrerelease || !isPrerelease) {
i = index
}
}
println " ${index + 1}: ${name}" +
(i == index ? " (selected)" : "") +
(isPrerelease && !usePrerelease ? " (enable with -PvswherePrerelease)" : "")
}
if (i == -1) {
println " -> Visual Studio not found!" println " -> Visual Studio not found!"
return return
} }
def vsInstallDir = vswhereJson[0].installationPath
def vsInstallDir = vswhereJson[i].installationPath
println " -> Installation Directory: ${vsInstallDir}" println " -> Installation Directory: ${vsInstallDir}"
// Use vcvarsall.bat to determine the latest Visual Studio's default SDK and tool versions // Use vcvarsall.bat to determine the latest Visual Studio's default SDK and tool versions

View file

@ -5,7 +5,7 @@ to analyze compiled code on a variety of platforms including Windows, MacOS, and
include disassembly, assembly, decompilation, debugging, emulation, graphing, and scripting, along include disassembly, assembly, decompilation, debugging, emulation, graphing, and scripting, along
with hundreds of other features. Ghidra supports a wide variety of processor instruction sets and with hundreds of other features. Ghidra supports a wide variety of processor instruction sets and
executable formats and can be run in both user-interactive and automated modes. Users may also executable formats and can be run in both user-interactive and automated modes. Users may also
develop their own Ghidra plug-in components and/or scripts using the exposed API. In addition there develop their own Ghidra plug-in components and/or scripts using the exposed API. In addition, there
are numerous ways to extend Ghidra such as new processors, loaders/exporters, automated analyzers, are numerous ways to extend Ghidra such as new processors, loaders/exporters, automated analyzers,
and new visualizations. and new visualizations.
@ -15,17 +15,17 @@ applied Ghidra SRE capabilities to a variety of problems that involve analyzing
generating deep insights for NSA analysts who seek a better understanding of potential generating deep insights for NSA analysts who seek a better understanding of potential
vulnerabilities in networks and systems. vulnerabilities in networks and systems.
# What's New in Ghidra 11.3 # What's New in Ghidra 12.0
This release includes new features, enhancements, performance improvements, quite a few bug fixes, This release includes new features, enhancements, performance improvements, quite a few bug fixes,
and many pull-request contributions. Thanks to all those who have contributed their time, thoughts, and many pull-request contributions. Thanks to all those who have contributed their time, thoughts,
and code. The Ghidra user community thanks you too! and code. The Ghidra user community thanks you too!
### The not-so-fine print: Please Read! ### The not-so-fine print: Please Read!
Ghidra 11.3 is fully backward compatible with project data from previous releases. However, programs Ghidra 12.0 is fully backward compatible with project data from previous releases. However, programs
and data type archives which are created or modified in 11.3 will not be usable by an earlier Ghidra and data type archives which are created or modified in 12.0 will not be usable by an earlier Ghidra
version. version.
**IMPORTANT:** Ghidra 11.3 requires at minimum JDK 21 to run. **IMPORTANT:** Ghidra 12.0 requires, at minimum, JDK 21 to run.
**IMPORTANT:** To use the Debugger or do a full source distribution build, you will need Python3 **IMPORTANT:** To use the Debugger or do a full source distribution build, you will need Python3
(3.9 to 3.13 supported) installed on your system. (3.9 to 3.13 supported) installed on your system.
@ -35,18 +35,23 @@ for `CVE-2024-31083` in X.org software in April 2024 introduced a regression, wh
in xwayland 23.2.6 and xorg-server 21.1.13. If you experience any crashing of Ghidra, most likely in xwayland 23.2.6 and xorg-server 21.1.13. If you experience any crashing of Ghidra, most likely
causing a full logout, check if your xorg-server has been updated to at least the noted version. causing a full logout, check if your xorg-server has been updated to at least the noted version.
**NOTE:** Each build distribution will include native components (e.g., decompiler) for at least one **NOTE:** Each build distribution will include native components (e.g., Decompiler) for at least one
platform (e.g., Windows x86-64). If you have another platform that is not included in the build platform (e.g., Windows x86-64). If you have another platform that is not included in the build
distribution, you can build native components for your platform directly from the distribution. distribution, you can build native components for your platform directly from the distribution.
See the *Installation Guide* for additional information. Users running with older shared libraries See the *Getting Started* document for additional information. Users running with older shared
and operating systems (e.g., CentOS 7.x) may also run into compatibility errors when launching libraries and operating systems (e.g., CentOS 7.x) may also run into compatibility errors when
native executables such as the Decompiler and GNU Demangler which may necessitate a rebuild of launching native executables such as the Decompiler and GNU Demangler which may necessitate a
native components. rebuild of native components.
**NOTE:** Ghidra Server: The Ghidra 11.x server is compatible with Ghidra 9.2 and later Ghidra **NOTE:** Ghidra Server: The Ghidra 12.0 server is compatible with Ghidra 9.2 and later Ghidra
clients. Ghidra 11.x clients are compatible with all 10.x and 9.x servers. Although, due to clients, although the presence of any newer link-files within a repository may not be handled properly
potential Java version differences, it is recommended that Ghidra Server installations older than by client versions prior to 12.0 which lack support for the new storage format. Ghidra 12.0 clients
10.2 be upgraded. Those using 10.2 and newer should not need a server upgrade. that introduce new link-files into a project will not be able to add such files into version
control if connected to older Ghidra Server versions.
**NOTE:** Ghidra Server: Due to potential Java version differences, it is
recommended that Ghidra Server installations older than 10.2 be upgraded. Those using 10.2 and newer
should not need a server upgrade unless they need to work with link-files within a shared repository.
**NOTE:** Programs imported with a Ghidra beta version or code built directly from source code **NOTE:** Programs imported with a Ghidra beta version or code built directly from source code
outside of a release tag may not be compatible, and may have flaws that won't be corrected by using outside of a release tag may not be compatible, and may have flaws that won't be corrected by using
@ -59,111 +64,85 @@ process that will provide better results than prior Ghidra versions. You might
fresh import of any program you will continue to reverse engineer to see if the latest Ghidra fresh import of any program you will continue to reverse engineer to see if the latest Ghidra
provides better results. provides better results.
## Project Link Files
Support for link-files within a Ghidra Project has been significantly expanded with this release and
with it a new file storage type has been introduced which can create some incompatibilities if
projects and repositories containing such files are used by older version of Ghidra or the Ghidra
Server.
Previously only external folder and file links were supported through the use of a Ghidra URL. With
12.0 the ability to establish internal folder and file links has been introduced. The new storage
format avoids the use of a database and relies only on a light-weight property file. Internal
project links also allow for either absolute or relative links. Due to the fact that Ghidra allows
a folder or file to have the same pathname, some ambiguities can result. It is highly recommended
that the use of conflicting folder and file pathnames be avoided.
The use of internally linked folders and files allows batch import processing to more accurately
reflect the native file-system and its use of symbolic links which allow for the same content to
be referenced by multiple paths. Allowing this within a Ghidra project can avoid the potential for
importing content multiple times with the different paths and simply import once with additional
link-files which reference it. How best to leverage links very much depends on the end-user's
needs and project file management preferences. Special care must be taken when defining or
traversing link-files to avoid external and circular references.
Additional Ghidra API methods have been provided or refined on the following classes to leverage
link-files: `DomainFolder`, `DomainFile`, `LinkFile`, `LinkHandler`, `DomainFileFilter`,
`DomainFileIterator`, etc.
...TO BE CONTINUED...
## Filesystem Mirroring
An option has been added to mirror the local filesystem when importing programs and their libraries.
Programs and libraries that exist on the local filesystem as symbolic links will have both their
corresponding link file and resolved program file mirrored in the project. Filesystem mirroring
can also be used in headless mode with the new `-mirror` command line option.
## PyGhidra ## PyGhidra
The PyGhidra Python library, originally developed by the Department of Defense Cyber Crime Center PyGhidra 3.0.0 (compatible with Ghidra 12.0 and later) introduces many new Python-specific API
(DC3) under the name *Pyhidra*, is a Python library that provides direct access to the Ghidra API methods with the goal of making the most common Ghidra tasks quick and easy, such as opening a
within a native CPython 3 interpreter using JPype. PyGhidra contains some conveniences for setting project, getting a program, and running a GhidraScript. Legacy API functions such as
up analysis on a given sample and running a Ghidra script locally. It also contains a Ghidra plugin `pyghidra.open_program()` and `pyghidra_run_script()` have been deprecated in favor of the new
to allow the use of CPython 3 from the Ghidra GUI. methods, which are outlined at https://pypi.org/project/pyghidra.
To launch Ghidra in PyGhidra mode, run `./support/pyghidra` (or `support\pyghidra.bat`). See the The default Python scripting engine has been changed in Ghidra 12.0 from Jython to PyGhidra.
*"PyGhidra Mode"* section of the *Installation Guide* and `Ghidra/Features/PyGhidra/README.html` Existing Jython scripts will need to include the `# @runtime Jython` script header in order to
for more information. continue running within the Jython environment.
## Visual Studio Code ## Z3 Concolic Emulation and Symbolic Summary
Ghidra 11.2 introduced a `VSCodeProjectScript.java` GhidraScript to assist in setting up Visual Studio Code We've added an experimental Z3-based symbolic emulator, which runs as an "auxiliary" domain to the
project folders for Ghidra module development and debugging. This GhidraScript has been replaced in concrete emulator, effectively constructing what is commonly called a "concolic" emulator. The
Ghidra 11.3 by 2 new actions, accessible from a *CodeBrowser* tool: symbolic emulator creates Z3 expressions and branching constraints, but it only follows the path
+ *Tools -> Create VSCode Module Project...* determined by concrete emulation. This is most easily accessed by installing the "SymbolicSummaryZ3"
+ "*Edit Script with Visual Studio Code*" button in the Script Manager extension (**File** -> **Install Extensions**) and then enabling the `Z3SummaryPlugin` in the
Debugger or Emulator tool, which includes a GUI for viewing and sorting through the results. The Z3
emulator requires z3-4.13.0, available from https://github.com/Z3Prover/z3. Other versions may work,
but our current test configuration uses 4.13.0. Depending on the release and your platform, the
required libraries may be missing or incompatible. If this is the case, you will need to download
Z3, or build it from source with Java bindings, and install the libraries into
`Ghidra/Extensions/SymbolicSummaryZ3/os/<platform>/`.
The "*Create VSCode Module Project...*" action provides the same capability as the old ## Emulation API
`VSCodeProjectScript.java` GhidraScript, creating a Visual Studio Code project folder that contains a The `PcodeEmulator` and related API has undergone substantial changes in preparation for integrating
skeleton module which can be used to build a variety of different Ghidra extension points our JIT-accelerated emulator into the GUI. Please see the **Notable API Changes** section of our
(Plugins, Analyzers, Loaders, etc). Launchers are also provided to run and debug the module in [Change History](ChangeHistory.md). The goal is to facilitate integration by composition; whereas,
Ghidra, as well as a Gradle task to export the module as a distributable Ghidra extension zip file. it had previously required inheritance, which is now considered poor design. Essentially, we've
introduced a set of callbacks that integrators can use to detect when certain things have happened
in emulation, as well as offer some control of machine-state behavior; e.g., to facilitate lazily
loading from a snapshot.
The "*Edit Script with Visual Studio Code*" button in the Script Manager enables quick editing and Extensions that currently integrate via inheritance can continue to do so, but will still need to
debugging of the selected script in a Visual Studio Code workspace that is automatically created apply some minimal changes to satisfy interface and constructor changes. The developers of such
behind the scenes in Ghidra's user settings directory. This provides a much snappier and modern extensions ought to consider porting their integrations to the compositional/callback-based
alternative to Eclipse, while maintaining all of the core fuctionality you would expect from an IDE mechanism. A careful assessment may be required depending on the nature of the extension. Extensions
(auto complete, hover, navigation, etc). that merely integrate with emulation should consider the compositional/callback-based mechanism.
Extensions that incorporate new domains (e.g. Z3) or novel behaviors (e.g. JIT) should continue
Ghidra will do its best to automatically locate your Visual Studio Code installation, but if cannot using inheritance.
find it, it can be set via the Front-End GUI at *Edit -> Tool Options -> Visual Studio Code
Integration*.
## Debugger
The old "IN-VM" and "GADP" launchers and connectors have been removed, as their replacement
TraceRmi-based implementations have been satisfactorily completed. On that same note, the entire API
and supporting code base for IN-VM and GADP connectors have been removed.
We've begun to explore more kernel-level debugging. Our lldb connector can now debug the macOS
kernel, and our dbgeng connector can now debug a Windows kernel running in a VM via eXDI.
## Emulator
We have introduced a new accelerated p-code emulator that uses Jit-in-Time translation (JIT).
This is *not* currently integrated in the UI but is available for scripting and plugin developers.
Its implementation is named `JitPcodeEmulator`, and it's a near drop-in replacement for `PcodeEmulator`.
See its javadoc for usage and implementation details. The JIT emulator is very new, so there may
still be many bugs.
## Source File Information
Source file and line information can now be added to Ghidra using a Program's SourceFileManager.
The DWARF, PDB, and Go analyzers now record this information by default. Source information can also
be added programmatically; see the example scripts in the *SourceMapping* script category.
Source information can be viewed in the *"Source Map"* Listing Field or the `SourceFilesTablePlugin`,
which is accessible from the Code Browser via *Window -> Source Files and Transforms*.
The *"View Source..."* Listing action, enabled on addresses with source file information, opens a
source file at the correct line in either Eclipse or Visual Studio Code (there is a *"Source Files
and Transforms"* tool option to determine the viewer). The SourceFilesTablePlugin can be used to
modify the source file paths stored in the SourceFileManager before sending them to Eclipse or
Visual Studio Code.
## Function Graph
The Function Graph has had a number of improvements:
+ Added new *"Flow Chart"* layouts
+ Position of the satellite view can be configured
+ Ctrl-Space toggles between the Listing and the Function Graph (starting fully zoomed in vs. fully
zoomed out is controlled by a Function Graph option)
## String Translation and Text Search
+ String translation has an additional translator available using the LibreTranslate service.
The LibreTranslate project (currently hosted at libretranslate.com) is an independent project
that provides an open source translation package that can be self-hosted, meaning you can translate
strings without sending them to a second party to translate, using an existing LibreTranslate server.
For more information search for LibreTranslate in the online Ghidra help pages.
**NOTE:** The LibreTranslate plugin is not enabled by default, and is added in the
*File -> Configure* menu.
+ The ability to search the text of all decompiled functions has been added. Decompilation during
search occurs on the fly, so the latest decompilation results of all functions are used for the
search. The search can take some time depending on the number and size of functions in your binary.
The new action can be found at *Search -> Decompiled Text...*.
## Processors
+ The x86 EVEX instruction write and read masking has been implemented for all AVX-512 instructions.
The handling of the mask is necessary as semantics are added for individual AVX-512 instructions.
+ TI_MSP430 decompilation has been improved through numerous changes to the processor's compiler
specifications file.
+ Corrected ARM VFPv2 instructions which were not disassembling correctly.
## Other Improvements ## Other Improvements
+ Much of Ghidra's standalone documentation has been modernized to the Markdown format. Generated + Added the ability to toggle the displaying of function variables (parameters and locals) that are
HTML versions are provided alongside the Markdown files for convenience. Converting all relevant normally displayed just below the function signature. The variables display can be turned on/off
documents to Markdown remains an ongoing process. **NOTE:** There are no plans to convert the globally or individually per function.
internal Ghidra help system to Markdown, as the Java Help library does not support it.
+ Libraries can now be loaded into an already-imported program with the *File -> Load Libraries...*
action.
+ The CParser macro pre-processing will now halt on *"#error"* directives. This change had a ripple
effect and uncovered a myriad of bugs which have been addressed. In addition, the interim parsing
output has been improved to allow easier diagnosis when problems in parsing occur due to incorrect
define values or other header file issues.
+ Finally, a new `CreateUEFIGDTArchivesScript.java` parsing script has been added to parse UEFI header files
available from `github.com/tianocore/edk2`. Using a script vice released pre-parsed GDT files allows the
end user to parse the correct version with a configuration fitting their needs.
## Additional Bug Fixes and Enhancements ## Additional Bug Fixes and Enhancements
Numerous other new features, improvements, and bug fixes are fully listed in the Numerous other new features, improvements, and bug fixes are fully listed in the
[Change History](ChangeHistory.html) file. [Change History](ChangeHistory.md) file.

View file

@ -9,6 +9,7 @@
<INCLUDE CLASS="ghidra.app.plugin.core.interpreter.InterpreterPanelPlugin" /> <INCLUDE CLASS="ghidra.app.plugin.core.interpreter.InterpreterPanelPlugin" />
<INCLUDE CLASS="ghidra.app.plugin.core.editor.TextEditorManagerPlugin" /> <INCLUDE CLASS="ghidra.app.plugin.core.editor.TextEditorManagerPlugin" />
</PACKAGE> </PACKAGE>
<PACKAGE NAME="BSim" />
<ROOT_NODE X_POS="409" Y_POS="179" WIDTH="1637" HEIGHT="931" EX_STATE="0" FOCUSED_OWNER="CodeBrowserPlugin" FOCUSED_NAME="Listing" FOCUSED_TITLE="Listing: "> <ROOT_NODE X_POS="409" Y_POS="179" WIDTH="1637" HEIGHT="931" EX_STATE="0" FOCUSED_OWNER="CodeBrowserPlugin" FOCUSED_NAME="Listing" FOCUSED_TITLE="Listing: ">
<SPLIT_NODE WIDTH="1621" HEIGHT="816" DIVIDER_LOCATION="148" ORIENTATION="VERTICAL"> <SPLIT_NODE WIDTH="1621" HEIGHT="816" DIVIDER_LOCATION="148" ORIENTATION="VERTICAL">
<COMPONENT_NODE TOP_INFO="0"> <COMPONENT_NODE TOP_INFO="0">

View file

@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
// Not technically a Java project, but required to be a Help project
apply from: "${rootProject.projectDir}/gradle/javaProject.gradle"
apply from: "${rootProject.projectDir}/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle" apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
@ -20,20 +23,36 @@ apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply plugin: 'eclipse' apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-dbgeng' eclipse.project.name = 'Debug Debugger-agent-dbgeng'
ext.tlb = file("build/os/win_x86_64/dbgmodel.tlb") dependencies {
// Only for Help :/
api project(':Debugger-rmi-trace')
}
if ("win_x86_64".equals(getCurrentPlatformName())) { def tlb = file("build/os/win_x86_64/dbgmodel.tlb")
def depsFile = file("${DEPS_DIR}/Debugger-agent-dbgeng/dbgmodel.tlb")
def binRepoFile = file("${BIN_REPO}/${getGhidraRelativePath(project)}/os/win_x86_64/dbgmodel.tlb")
tasks.assemblePyPackage {
def prebuiltTlb = depsFile.exists() ? depsFile : (binRepoFile.exists() ? binRepoFile : null)
assert prebuiltTlb != null : "Failed to locate prebuilt TLB file"
from(prebuiltTlb) {
into("src/ghidradbg/dbgmodel/tlb")
}
}
task buildTlb(type: Exec) {
def tmpBatch = file("build/buildTlb.bat")
def idl = file("src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl")
String makeName = "win_x86_64DbgmodelTlbMake"
task(type: Exec, makeName) {
ext.tmpBatch = file("build/buildTlb.bat")
ext.idl = file("src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl")
inputs.file(idl) inputs.file(idl)
outputs.file(tlb) outputs.file(tlb)
doFirst { doFirst {
assert isCurrentX86_64() && isCurrentWindows() : "Can only build TLB on Windows x86"
file(tlb).parentFile.mkdirs() file(tlb).parentFile.mkdirs()
def midlCmd = "midl /tlb ${tlb} ${idl}" def midlCmd = "midl /tlb \"${tlb}\" \"${idl}\""
println "Executing: " + midlCmd println "Executing: " + midlCmd
tmpBatch.withWriter { out -> tmpBatch.withWriter { out ->
@ -41,6 +60,7 @@ if ("win_x86_64".equals(getCurrentPlatformName())) {
out.println midlCmd out.println midlCmd
} }
} }
doLast { doLast {
assert file(tlb).exists() : "Failed to build dbgmodel.tlb" assert file(tlb).exists() : "Failed to build dbgmodel.tlb"
} }
@ -48,33 +68,16 @@ if ("win_x86_64".equals(getCurrentPlatformName())) {
commandLine "cmd", "/c", tmpBatch commandLine "cmd", "/c", tmpBatch
} }
tasks.assemblePyPackage { task prebuildTlb(type: Copy) {
from(tasks."$makeName") {
into("src/ghidradbg/dbgmodel/tlb") dependsOn buildTlb
}
} from tlb
} into binRepoFile.parentFile
else if (file(tlb).exists()) {
// required for multi-platform build doFirst {
tasks.assemblePyPackage { assert file(BIN_REPO).exists() : "Bin repo doesn't exist"
from(tlb) { file(binRepoFile).parentFile.mkdirs()
println "Copying existing tlb build artifact: " + tlb
into("src/ghidradbg/dbgmodel/tlb")
}
}
}
else {
def prebuiltTlb = new File(rootProject.BIN_REPO + '/' + getGhidraRelativePath(project) + "/os/win_x86_64/dbgmodel.tlb")
if (prebuiltTlb.exists()) {
println "Copying prebuilt dbgmodel.tlb"
tasks.assemblePyPackage {
from(rootProject.BIN_REPO + '/' + getGhidraRelativePath(project) + "/os/win_x86_64/dbgmodel.tlb") {
into("src/ghidradbg/dbgmodel/tlb")
}
}
}
else {
println "WARNING: dbgmodel.tlb omitted from ghidradbg python package"
} }
} }

View file

@ -3,17 +3,13 @@
##MODULE IP: MIT ##MODULE IP: MIT
Module.manifest||GHIDRA||||END| Module.manifest||GHIDRA||||END|
README.md||GHIDRA||||END| README.md||GHIDRA||||END|
data/debugger-launchers/kernel-dbgeng.bat||GHIDRA||||END| src/main/help/help/TOC_Source.xml||GHIDRA||||END|
data/debugger-launchers/local-dbgeng-attach.bat||GHIDRA||||END| src/main/help/help/topics/dbgeng/dbgeng.html||GHIDRA||||END|
data/debugger-launchers/local-dbgeng-ext.bat||GHIDRA||||END|
data/debugger-launchers/local-dbgeng.bat||GHIDRA||||END|
data/debugger-launchers/local-ttd.bat||GHIDRA||||END|
data/debugger-launchers/remote-dbgeng.bat||GHIDRA||||END|
src/main/py/LICENSE||GHIDRA||||END| src/main/py/LICENSE||GHIDRA||||END|
src/main/py/MANIFEST.in||GHIDRA||||END| src/main/py/MANIFEST.in||GHIDRA||||END|
src/main/py/README.md||GHIDRA||||END| src/main/py/README.md||GHIDRA||||END|
src/main/py/pyproject.toml||GHIDRA||||END| src/main/py/pyproject.toml||GHIDRA||||END|
src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl||GHIDRA||||END| src/main/py/src/ghidradbg/dbgmodel/DbgModel.idl||GHIDRA||||END|
src/main/py/src/ghidradbg/py.typed||GHIDRA||||END|
src/main/py/src/ghidradbg/schema.xml||GHIDRA||||END| src/main/py/src/ghidradbg/schema.xml||GHIDRA||||END|
src/main/py/src/ghidradbg/schema_exdi.xml||GHIDRA||||END| src/main/py/src/ghidradbg/schema_exdi.xml||GHIDRA||||END|
src/main/py/src/ghidrattd/schema.xml||GHIDRA||||END|

View file

@ -1,4 +1,19 @@
::@title dbgeng-kernel :: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng kernel
::@desc <html><body width="300px"> ::@desc <html><body width="300px">
::@desc <h3>Kernel debugging using <tt>dbgeng</tt> (in a Python interpreter)</h3> ::@desc <h3>Kernel debugging using <tt>dbgeng</tt> (in a Python interpreter)</h3>
::@desc <p> ::@desc <p>
@ -6,13 +21,14 @@
::@desc For setup instructions, press <b>F1</b>. ::@desc For setup instructions, press <b>F1</b>.
::@desc </p> ::@desc </p>
::@desc </body></html> ::@desc </body></html>
::@menu-group local ::@menu-group dbgeng
::@icon icon.debugger ::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng_kernel ::@help dbgeng#win_kernel
::@depends Debugger-rmi-trace
::@enum Connection:str Remote Local EXDI ::@enum Connection:str Remote Local EXDI
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." ::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch :: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_ARGS:str="" "Arguments" "Connection-string arguments (a la .server)" ::@env OPT_KCONNECT_STRING:str="" "Arguments" "Connection-string arguments (a la .server)"
::@env OPT_TARGET_FLAGS:Connection="Remote" "Type" "Type/flags for connection (Remote/Local/EXDI)." ::@env OPT_TARGET_FLAGS:Connection="Remote" "Type" "Type/flags for connection (Remote/Local/EXDI)."
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available." ::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)." ::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."

View file

@ -1,4 +1,19 @@
::@title dbgeng-attach :: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng attach
::@desc <html><body width="300px"> ::@desc <html><body width="300px">
::@desc <h3>Attach with <tt>dbgeng</tt> (in a Python interpreter)</h3> ::@desc <h3>Attach with <tt>dbgeng</tt> (in a Python interpreter)</h3>
::@desc <p> ::@desc <p>
@ -6,9 +21,10 @@
::@desc For setup instructions, press <b>F1</b>. ::@desc For setup instructions, press <b>F1</b>.
::@desc </p> ::@desc </p>
::@desc </body></html> ::@desc </body></html>
::@menu-group local ::@menu-group dbgeng
::@icon icon.debugger ::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng_attach ::@help dbgeng#attach
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." ::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
::@env OPT_TARGET_PID:int=0 "Process id" "The target process id" ::@env OPT_TARGET_PID:int=0 "Process id" "The target process id"
::@env OPT_ATTACH_FLAGS:int=0 "Attach flags" "Attach flags" ::@env OPT_ATTACH_FLAGS:int=0 "Attach flags" "Attach flags"

View file

@ -1,4 +1,19 @@
::@title dbgeng-ext :: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng extra options
::@image-opt env:OPT_TARGET_IMG ::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px"> ::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>dbgeng</tt> (in a Python interpreter)</h3> ::@desc <h3>Launch with <tt>dbgeng</tt> (in a Python interpreter)</h3>
@ -7,12 +22,13 @@
::@desc For setup instructions, press <b>F1</b>. ::@desc For setup instructions, press <b>F1</b>.
::@desc </p> ::@desc </p>
::@desc </body></html> ::@desc </body></html>
::@menu-group local ::@menu-group dbgeng
::@icon icon.debugger ::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng_ext ::@help dbgeng#ext
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." ::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch :: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image" ::@env OPT_TARGET_IMG:file="" "Image" "The target binary executable image"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available." ::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)." ::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."
@ -21,6 +37,7 @@
::@env OPT_CREATE_FLAGS:int="1" "Create flags" "Creation flags" ::@env OPT_CREATE_FLAGS:int="1" "Create flags" "Creation flags"
::@env OPT_CREATE_ENGFLAGS:int="0" "Create flags (Engine)" "Engine-specific creation flags" ::@env OPT_CREATE_ENGFLAGS:int="0" "Create flags (Engine)" "Engine-specific creation flags"
::@env OPT_VERIFIER_FLAGS:int="0" "Verifier flags" "Verifier flags" ::@env OPT_VERIFIER_FLAGS:int="0" "Verifier flags" "Verifier flags"
::@env OPT_ENG_OPTIONS:int="0x20" "Engine options" "Options for AddEngineOptions (e.g. INITIAL_BREAK=0x20)"
@echo off @echo off

View file

@ -0,0 +1,37 @@
:: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng TTD
::@desc <html><body width="300px">
::@desc <h3>Open trace with <tt>dbgeng</tt> (in a Python interpreter)</h3>
::@desc <p>
::@desc This will open a WinDbg TTD trace of the target on the local machine using <tt>dbgeng.dll</tt>.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group dbgeng
::@icon icon.debugger
::@help dbgeng#ttd
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_TRACE:file="" "Trace (.run)" "The target trace image"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."
@echo off
set USE_TTD=true
"%OPT_PYTHON_EXE%" -i ..\support\local-dbgeng-trace.py

View file

@ -1,3 +1,18 @@
:: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng ::@title dbgeng
::@image-opt env:OPT_TARGET_IMG ::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px"> ::@desc <html><body width="300px">
@ -7,12 +22,13 @@
::@desc For setup instructions, press <b>F1</b>. ::@desc For setup instructions, press <b>F1</b>.
::@desc </p> ::@desc </p>
::@desc </body></html> ::@desc </body></html>
::@menu-group local ::@menu-group dbgeng
::@icon icon.debugger ::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng ::@help dbgeng#local
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." ::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch :: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image" ::@env OPT_TARGET_IMG:file="" "Image" "The target binary executable image"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available." ::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)." ::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."

View file

@ -1,21 +0,0 @@
::@title ttd
::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>ttd</tt> (in a Python interpreter)</h3>
::@desc <p>
::@desc This will launch the target on the local machine for time-travel debugging.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group local
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng_ttd
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_IMG:file!="" "Trace (.run)" "A trace associated with the target binary executable"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env OPT_DBGMODEL_PATH:dir="" "Path to dbgeng.dll & \\ttd" "Path containing dbgeng and associated DLLS (if not Windows Kits)."
@echo off
"%OPT_PYTHON_EXE%" -i ..\support\local-ttd.py

View file

@ -1,21 +1,32 @@
::@title dbgeng-remote :: ###
::@image-opt env:OPT_TARGET_IMG :: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng remote
::@desc <html><body width="300px"> ::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>dbgeng</tt> remotely (in a Python interpreter)</h3> ::@desc <h3>Connect to a remote debugger (via the .server interface)</h3>
::@desc <p> ::@desc <p>
::@desc This will launch the target on a remote machine using <tt>dbgeng.dll</tt>. ::@desc This will connect to a remote machine using the .server interface.
::@desc For setup instructions, press <b>F1</b>. ::@desc For setup instructions, press <b>F1</b>.
::@desc </p> ::@desc </p>
::@desc </body></html> ::@desc </body></html>
::@menu-group local ::@menu-group dbgeng
::@icon icon.debugger ::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#dbgeng_remote ::@help dbgeng#remote
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." ::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch ::@env OPT_CONNECT_STRING:str="" "Connection" "Connection-string arguments (a la .server)"
::@env OPT_TARGET_IMG:str!="" "Image" "The target binary executable image"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_CONNECT_STRING:str="" "Connection" "Connection-string arguments (a la dbgsrv args)"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)." ::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."
@echo off @echo off

View file

@ -0,0 +1,39 @@
:: ###
:: IP: GHIDRA
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: ##
::@title dbgeng svrcx
::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px">
::@desc <h3>Connect to a remote <tt>dbgeng</tt> connection server and launch the target (in a Python interpreter)</h3>
::@desc <p>
::@desc This will launch the target via a connection server on a remote machine.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group dbgeng
::@icon icon.debugger
::@help dbgeng#svrcx
::@depends Debugger-rmi-trace
::@env OPT_PYTHON_EXE:file!="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH."
:: Use env instead of args, because "all args except first" is terrible to implement in batch
::@env OPT_TARGET_IMG:str="" "Image" "The target binary executable image"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_CONNECT_STRING:str="" "Connection" "Connection-string arguments (a la dbgsrv args)"
::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available."
::@env WINDBG_DIR:dir="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)."
@echo off
"%OPT_PYTHON_EXE%" -i ..\support\svrcx-dbgeng.py

View file

@ -17,25 +17,17 @@
import os import os
import sys import sys
home = os.getenv('GHIDRA_HOME')
if os.path.isdir(f'{home}\\ghidra\\.git'): def append_paths():
sys.path.append( sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src') f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
sys.path.append( from gmodutils import ghidra_module_pypath
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src') sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
elif os.path.isdir(f'{home}\\.git'): sys.path.append(ghidra_module_pypath())
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main(): def main():
append_paths()
# Delay these imports until sys.path is patched # Delay these imports until sys.path is patched
from ghidradbg import commands as cmd from ghidradbg import commands as cmd
from ghidradbg import util from ghidradbg import util
@ -57,7 +49,7 @@ def main():
print(f"RegMapFile: {os.getenv('EXDI_SYSTEM_REGISTERS_MAP_XML_FILE')}") print(f"RegMapFile: {os.getenv('EXDI_SYSTEM_REGISTERS_MAP_XML_FILE')}")
util.set_convenience_variable('output-radix', 16) util.set_convenience_variable('output-radix', 16)
flags = 2 flags = 2
args = os.getenv('OPT_TARGET_ARGS') args = os.getenv('OPT_KCONNECT_STRING')
cmd.ghidra_trace_attach_kernel(args, flags, start_trace=False) cmd.ghidra_trace_attach_kernel(args, flags, start_trace=False)
# TODO: HACK # TODO: HACK
@ -70,9 +62,14 @@ def main():
cmd.ghidra_trace_start("System") cmd.ghidra_trace_start("System")
cmd.ghidra_trace_sync_enable() cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS, DbgEng.DEBUG_STATUS_BREAK) on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl() cmd.repl()
if __name__ == '__main__': if __name__ == '__main__':
try:
main() main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -18,25 +18,16 @@ import os
import sys import sys
home = os.getenv('GHIDRA_HOME') def append_paths():
if os.path.isdir(f'{home}\\ghidra\\.git'):
sys.path.append( sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src') f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
sys.path.append( from gmodutils import ghidra_module_pypath
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src') sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
elif os.path.isdir(f'{home}\\.git'): sys.path.append(ghidra_module_pypath())
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main(): def main():
append_paths()
# Delay these imports until sys.path is patched # Delay these imports until sys.path is patched
from ghidradbg import commands as cmd from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng from pybag.dbgeng import core as DbgEng
@ -61,9 +52,14 @@ def main():
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG')) cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG'))
cmd.ghidra_trace_sync_enable() cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS, DbgEng.DEBUG_STATUS_BREAK) on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl() cmd.repl()
if __name__ == '__main__': if __name__ == '__main__':
try:
main() main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -18,25 +18,16 @@ import os
import sys import sys
home = os.getenv('GHIDRA_HOME') def append_paths():
if os.path.isdir(f'{home}\\ghidra\\.git'):
sys.path.append( sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src') f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
sys.path.append( from gmodutils import ghidra_module_pypath
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src') sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
elif os.path.isdir(f'{home}\\.git'): sys.path.append(ghidra_module_pypath())
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main(): def main():
append_paths()
# Delay these imports until sys.path is patched # Delay these imports until sys.path is patched
from ghidradbg import commands as cmd from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng from pybag.dbgeng import core as DbgEng
@ -51,13 +42,20 @@ def main():
args = os.getenv('OPT_TARGET_ARGS') args = os.getenv('OPT_TARGET_ARGS')
if args: if args:
args = ' ' + args args = ' ' + args
target = os.getenv('OPT_TARGET_IMG')
if target is None or target == "":
print("dbgeng requires a target image - please try again.")
cmd.ghidra_trace_disconnect()
return
cmd.ghidra_trace_create_ext( cmd.ghidra_trace_create_ext(
os.getenv('OPT_TARGET_IMG') + args, target + args,
os.getenv('OPT_TARGET_DIR'), os.getenv('OPT_TARGET_DIR'),
os.getenv('OPT_TARGET_ENV'), os.getenv('OPT_TARGET_ENV'),
os.getenv('OPT_CREATE_FLAGS'), os.getenv('OPT_CREATE_FLAGS'),
os.getenv('OPT_CREATE_ENGFLAGS'), os.getenv('OPT_CREATE_ENGFLAGS'),
os.getenv('OPT_VERIFIER_FLAGS'), os.getenv('OPT_VERIFIER_FLAGS'),
os.getenv('OPT_ENG_OPTIONS'),
start_trace=False) start_trace=False)
# TODO: HACK # TODO: HACK
@ -66,12 +64,17 @@ def main():
except KeyboardInterrupt as ki: except KeyboardInterrupt as ki:
dbg.interrupt() dbg.interrupt()
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG')) cmd.ghidra_trace_start(target)
cmd.ghidra_trace_sync_enable() cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS, DbgEng.DEBUG_STATUS_BREAK) on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl() cmd.repl()
if __name__ == '__main__': if __name__ == '__main__':
try:
main() main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -0,0 +1,71 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
import os
import sys
def append_paths():
sys.path.append(
f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
from gmodutils import ghidra_module_pypath
sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
sys.path.append(ghidra_module_pypath())
def main():
append_paths()
# Delay these imports until sys.path is patched
from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng
from ghidradbg.hooks import on_state_changed
from ghidradbg.util import dbg
# So that the user can re-enter by typing repl()
global repl
repl = cmd.repl
cmd.ghidra_trace_connect(os.getenv('GHIDRA_TRACE_RMI_ADDR'))
target = os.getenv('OPT_TARGET_TRACE')
if target is None or target == "":
print("dbgeng requires a target trace - please try again.")
cmd.ghidra_trace_disconnect()
return
cmd.ghidra_trace_open(target, start_trace=False)
# TODO: HACK
# Also, the wait() must precede sync_enable() or else PROC_STATE will
# contain the wrong PID, and later events will get snuffed
try:
dbg.wait()
except KeyboardInterrupt as ki:
dbg.interrupt()
cmd.ghidra_trace_start(target)
cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl()
if __name__ == '__main__':
try:
main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -18,25 +18,16 @@ import os
import sys import sys
home = os.getenv('GHIDRA_HOME') def append_paths():
if os.path.isdir(f'{home}\\ghidra\\.git'):
sys.path.append( sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src') f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
sys.path.append( from gmodutils import ghidra_module_pypath
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src') sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
elif os.path.isdir(f'{home}\\.git'): sys.path.append(ghidra_module_pypath())
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main(): def main():
append_paths()
# Delay these imports until sys.path is patched # Delay these imports until sys.path is patched
from ghidradbg import commands as cmd from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng from pybag.dbgeng import core as DbgEng
@ -51,8 +42,13 @@ def main():
args = os.getenv('OPT_TARGET_ARGS') args = os.getenv('OPT_TARGET_ARGS')
if args: if args:
args = ' ' + args args = ' ' + args
cmd.ghidra_trace_create( target = os.getenv('OPT_TARGET_IMG')
os.getenv('OPT_TARGET_IMG') + args, start_trace=False) if target is None or target == "":
print("dbgeng requires a target image - please try again.")
cmd.ghidra_trace_disconnect()
return
cmd.ghidra_trace_create(target + args, start_trace=False)
# TODO: HACK # TODO: HACK
try: try:
@ -60,12 +56,17 @@ def main():
except KeyboardInterrupt as ki: except KeyboardInterrupt as ki:
dbg.interrupt() dbg.interrupt()
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG')) cmd.ghidra_trace_start(target)
cmd.ghidra_trace_sync_enable() cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS, DbgEng.DEBUG_STATUS_BREAK) on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl() cmd.repl()
if __name__ == '__main__': if __name__ == '__main__':
try:
main() main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -1,58 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
import os
import sys
home = os.getenv('GHIDRA_HOME')
if os.path.isdir(f'{home}\\ghidra\\.git'):
sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
elif os.path.isdir(f'{home}\\.git'):
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main():
# Delay these imports until sys.path is patched
from ghidrattd import commands as cmd
from ghidrattd import hooks
###from ghidrattd.util import dbg
cmd.ghidra_trace_connect(os.getenv('GHIDRA_TRACE_RMI_ADDR'))
args = os.getenv('OPT_TARGET_ARGS')
if args:
args = ' ' + args
cmd.ghidra_trace_create(
os.getenv('OPT_TARGET_IMG') + args, start_trace=True)
cmd.ghidra_trace_sync_enable()
hooks.on_stop()
cmd.repl()
if __name__ == '__main__':
main()

View file

@ -18,25 +18,16 @@ import os
import sys import sys
home = os.getenv('GHIDRA_HOME') def append_paths():
if os.path.isdir(f'{home}\\ghidra\\.git'):
sys.path.append( sys.path.append(
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src') f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
sys.path.append( from gmodutils import ghidra_module_pypath
f'{home}\\ghidra\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src') sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
elif os.path.isdir(f'{home}\\.git'): sys.path.append(ghidra_module_pypath())
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\build\\pypkg\\src')
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\build\\pypkg\\src')
else:
sys.path.append(
f'{home}\\Ghidra\\Debug\\Debugger-agent-dbgeng\\pypkg\\src')
sys.path.append(f'{home}\\Ghidra\\Debug\\Debugger-rmi-trace\\pypkg\\src')
def main(): def main():
append_paths()
# Delay these imports until sys.path is patched # Delay these imports until sys.path is patched
from ghidradbg import commands as cmd from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng from pybag.dbgeng import core as DbgEng
@ -48,26 +39,20 @@ def main():
repl = cmd.repl repl = cmd.repl
cmd.ghidra_trace_connect(os.getenv('GHIDRA_TRACE_RMI_ADDR')) cmd.ghidra_trace_connect(os.getenv('GHIDRA_TRACE_RMI_ADDR'))
args = os.getenv('OPT_TARGET_ARGS')
if args:
args = ' ' + args
cmd.ghidra_trace_connect_server(os.getenv('OPT_CONNECT_STRING'))
img = os.getenv('OPT_TARGET_IMG')
if img is not None and img != "":
cmd.ghidra_trace_create(img + args, start_trace=False)
# TODO: HACK os.environ['OPT_USE_DBGMODEL'] = "false"
try: cmd.ghidra_trace_start("Remote")
dbg.wait() cmd.ghidra_trace_sync_enable()
except KeyboardInterrupt as ki:
dbg.interrupt() dbg.interrupt()
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG')) on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
cmd.ghidra_trace_sync_enable() DbgEng.DEBUG_STATUS_BREAK)
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS, DbgEng.DEBUG_STATUS_BREAK)
cmd.repl() cmd.repl()
if __name__ == '__main__': if __name__ == '__main__':
try:
main() main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -0,0 +1,76 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
# TO LAUNCH: py -i standalone_listener.py "path_to_target.exe"
import os
import sys
def append_paths():
sys.path.append(
f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
from gmodutils import ghidra_module_pypath
sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
sys.path.append(ghidra_module_pypath())
def main():
append_paths()
# Delay these imports until sys.path is patched
from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng
from ghidradbg.hooks import on_state_changed
from ghidradbg.util import dbg
# So that the user can re-enter by typing repl()
global repl
repl = cmd.repl
cmd.ghidra_trace_listen()
args = os.getenv('OPT_TARGET_ARGS')
if args:
args = ' ' + args
else:
args = ''
target = sys.argv[1]
if target is None or target == "":
print("dbgeng requires a target image - please try again.")
cmd.ghidra_trace_disconnect()
return
cmd.ghidra_trace_create(target + args, start_trace=False)
# TODO: HACK
try:
dbg.wait()
except KeyboardInterrupt as ki:
dbg.interrupt()
cmd.ghidra_trace_start(target)
cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl()
if __name__ == '__main__':
try:
main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -0,0 +1,69 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
import os
import sys
def append_paths():
sys.path.append(
f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
from gmodutils import ghidra_module_pypath
sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
sys.path.append(ghidra_module_pypath())
def main():
append_paths()
# Delay these imports until sys.path is patched
from ghidradbg import commands as cmd
from pybag.dbgeng import core as DbgEng
from ghidradbg.hooks import on_state_changed
from ghidradbg.util import dbg
# So that the user can re-enter by typing repl()
global repl
repl = cmd.repl
cmd.ghidra_trace_connect(os.getenv('GHIDRA_TRACE_RMI_ADDR'))
args = os.getenv('OPT_TARGET_ARGS')
if args:
args = ' ' + args
cmd.ghidra_trace_connect_server(os.getenv('OPT_CONNECT_STRING'))
img = os.getenv('OPT_TARGET_IMG')
if img is not None and img != "":
cmd.ghidra_trace_create(img + args, start_trace=False)
# TODO: HACK
try:
dbg.wait()
except KeyboardInterrupt as ki:
dbg.interrupt()
cmd.ghidra_trace_start(os.getenv('OPT_TARGET_IMG'))
cmd.ghidra_trace_sync_enable()
on_state_changed(DbgEng.DEBUG_CES_EXECUTION_STATUS,
DbgEng.DEBUG_STATUS_BREAK)
cmd.repl()
if __name__ == '__main__':
try:
main()
except SystemExit as x:
if x.code != 0:
print(f"Exited with code {x.code}")

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- See Base's TOC_Source.xml for help -->
<tocroot>
<tocref id="TraceRmiLauncherServicePlugin">
<tocdef id="dbgeng" text="WinDbg (dbgeng.dll) Integration"
target="help/topics/dbgeng/dbgeng.html">
<tocdef id="dbgeng_local" text="Local"
target="help/topics/dbgeng/dbgeng.html#local" />
<tocdef id="dbgeng_ext" text="Extended Local"
target="help/topics/dbgeng/dbgeng.html#ext" />
<tocdef id="dbgeng_attach" text="Attach"
target="help/topics/dbgeng/dbgeng.html#attach" />
<tocdef id="dbgeng_remote" text="Remote"
target="help/topics/dbgeng/dbgeng.html#remote" />
<tocdef id="dbgeng_svrcx" text="Process Server"
target="help/topics/dbgeng/dbgeng.html#svrcx" />
<tocdef id="dbgeng_win_kenel" text="Windows Kernel"
target="help/topics/dbgeng/dbgeng.html#win_kernel" />
<tocdef id="dbgeng_ttd" text="TTD (Time-Travel Debugging)"
target="help/topics/dbgeng/dbgeng.html#ttd" />
</tocdef>
</tocref>
</tocroot>

View file

@ -0,0 +1,297 @@
<!DOCTYPE doctype PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<HEAD>
<META name="generator" content=
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">
<TITLE>Debugger Launchers: Windows Debugger (WinDbg, dbgeng.dll)</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
</HEAD>
<BODY lang="EN-US">
<H1>Debugger Launchers: Windows Debugger (WinDbg, dbgeng.dll)</H1>
<P>Integration with WinDbg is achieved by implementing a console debugger in Python 3 based on
<TT>dbgeng.dll</TT> (via pybag). This DLL represents the Microsoft Windows Debugger engine, and
so is best suited for debugging Windows user-space targets. This DLL also backs WinDbg and
several other debuggers on Windows. By default, the launcher will search for this DLL in an
installation of the Windows Debugging Kits version 10. If it does not find it there, it will
probably crash with a message in the Terminal.</P>
<P>The following launchers based on Microsoft's <TT>dbgeng.dll</TT> are included out of the
box:</P>
<H2><A name="local"></A>Local</H2>
<P>The plain "<TT>dbgeng</TT>" defaults to launching the current program as a user-mode process
on the local system. If there is no current program, this launcher cannot be used. Clearing the
<B>Image</B> option will cause this launcher to fail.</P>
<P>Please note on some system configurations, one of the debugger's dependencies
<TT>dbghelp.dll</TT> may get loaded from the system directory instead of from the WinDbg
installation, usually because a security product has pre-loaded it into the Python process. You
might work around this by copying the affected DLLs from your WinDbg installation into your
Python installation.</P>
<H3><A name="setup"></A>Setup</H3>
<P>Installing WinDbg is highly recommended. If you wish to forego installing WinDbg, you can
use the DLL provided with Windows, which is substantially less capable, by manually pointing
this connector to <TT>C:\Windows\system32</TT>. If you do this, some commands, e.g.
<TT>.server</TT>, will not be available.</P>
<P>If you have access to PyPI, setting up your Python 3 environment is done using Pip. Please
note the version specifier for Protobuf.</P>
<UL style="list-style-type: none">
<LI>
<PRE>
python3 -m pip install pybag protobuf==3.20.3
</PRE>
</LI>
</UL>
<P>If you are offline, or would like to use our provided packages, we still use Pip, but with a
more complicated invocation:</P>
<UL style="list-style-type: none">
<LI>
<PRE>
cd C:\path\to\ghidra_<EM>
version</EM>\Ghidra\Debug
python3 -m pip install --no-index -f Debugger-rmi-trace\pypkg\dist -f Debugger-agent-dbgeng\pypkg\dist pybag protobuf
</PRE>
</LI>
</UL>
<P>If you get an import error regarding <TT>distutils</TT>, it is due to a transitive
dependency on a buggy version of <TT>capstone</TT>. Work around it by installing
<TT>setuptools</TT>.</P>
<H3>Options</H3>
<UL>
<LI><B><TT>python</TT> command</B>: This is the command or path to the Python interpreter. It
must be version 3. Python 2 is not supported.</LI>
<LI><B>Image</B>: This is the path to the target binary image (EXE file). Ghidra will try to
fill this in based on information gathered when the current program was imported. If the file
exists and is executable on the local machine, it will be filled in automatically. Otherwise,
it is up to you to locate it. <B>NOTE:</B> If you have patched the current program database,
these changes are <EM>not</EM> applied to the target. You can either 1) apply the same
patches to the target once it is running, or 2) export a patched copy of your image and
direct this launcher to run it.</LI>
<LI><B>Arguments</B>: These are the command-line arguments to pass into the target process.
These are passed as is into WinDbg's "<TT>CreateProcess</TT>" function.</LI>
<LI><B>Use <TT>dbgmodel</TT></B>: If <TT>dbgmodel.dll</TT> is available on the system, this
launcher will use it to populate the trace's object model. Without that DLL, the launcher
will invent its own model, roughly approximating the same, using just the information
available from <TT>dbgeng.dll</TT>. Disabling this option will prevent the launcher from
using <TT>dbgmodel.dll</TT>, even when it is available.</LI>
<LI><B>Path to <TT>dbgeng.dll</TT> directory</B>: By default, the launcher allows the
underlying <TT>pybag</TT> package to locate the Windows Debugger DLLs. This is typically
found by examining the registry for a Windows Kits 10 installation. Otherwise, it may check
its typical installation directory. This will <EM>not</EM> search the Windows system
directory, but you can configure it manually here. This option allows you to override this
search. For example, if you have installed WinDbg Preview or later from the Microsoft Store
and wish to use its DLLs, you will need to fill in this option.</LI>
</UL>
<P>Once running, you are presented with a command-line interface in Ghidra's Terminal. This CLI
accepts your usual WinDbg (kd) commands. You can escape from this CLI and enter a Python 3 REPL
by entering "<TT>.exit</TT>". This is not an actual kd command, but our implementation
understands this to mean exit the kd REPL. From the Python 3 REPL, you can access the
underlying Python-based API <TT>pybag</TT>. This is an uncommon need, but may be useful for
diagnostics and/or workarounds. To re-enter the kd REPL, enter "<TT>repl()</TT>".
Alternatively, if you are trying to quit, but typed "<TT>.exit</TT>", just type
"<TT>quit()</TT>" to terminate the session.</P>
<H2><A name="ext"></A>Extended Local</H2>
<P>The "<TT>dbgeng-ext</TT>" launcher extends the base <TT>dbgeng</TT> launcher adding extra
options (a la <TT>IDebugClient</TT>'s <TT>CreateProcess2</TT>).</P>
<H3>Options</H3>
<UL>
<LI><B>Dir</B>: This is the starting directory for the process.</LI>
<LI><B>Env</B>: This is a composite string containg Environment Variable entries delineated
by '/0' separators. For example, you could redefine USERNAME and USERPROFILE with the entry
'USERNAME=SomeUser/0USERPROFILE=C:\Users\SomeUser'.</LI>
<LI><B>CreateFlags</B>: Flags used when creating the process, typically either
DEBUG_PROCESS(1) or DEBUG_ONLY_THIS_PROCESS(2) if you do not wish to follow spawned
processes. Other possible values are defined by processes.h's
CreateProcessCreationFlags.</LI>
<LI><B>CreateFlags (Engine)</B>: Engine-specific flags used when creating the process
(defined in dbgeng.h). Typically, these are set to 0.</LI>
<LI><B>VerifierFlags (Engine)</B>: Flags used by the Application Verifier. Typically unused,
but, if desired, CreateEngineFlags must include
DEBUG_ECREATE_PROCESS_USE_VERIFIER_FLAGS(2).</LI>
</UL>
<H2><A name="attach"></A>Attach</H2>
<P>This launcher allows the user to attach to a local running process. Options are the same as
those for the base dbgeng, except for ProcessId and AttachFlags</P>
<H3>Options</H3>
<UL>
<LI><B>ProcessId</B>: The pid of the process you wish to attach to.</LI>
<LI><B>AttachFlags</B>: Flags used when attaching to the target process, typically
DEBUG_ATTACH_PROCESS(0). Other possible values are defined in dbgeng.h and determine whether
the attach should be invasive or not and the status of the process after attaching.</LI>
</UL>
<H2><A name="remote"></A>Remote</H2>
<P>This launcher connects to a remote debugger that has opened a port for remote control.</P>
<H3>Options</H3>
<UL>
<LI>
<B>Connection</B>: This is the connection string specifying the transport options for
communicating with the remote debugger. A typical example might be
'tcp:port=12345,server=192.168.0.2' for a debugger that has issued the command
<PRE>
.server tcp:port=12345
</PRE>
</LI>
</UL>
<H2><A name="svrcx"></A>Process Server</H2>
<P>The "<TT>dbgeng-svrcx</TT>" launcher extends the base dbgeng launcher adding an option for
connecting through a remote process server.</P>
<H3>Options</H3>
<UL>
<LI>
<B>Connection</B>: This is the connection string specifying the transport options for
communicating with the remote server. A typical example might be
'tcp:port=12345,server=192.168.0.2' for a process server launched on the machine at
192.168.0.2 using:
<PRE>
dbgsrv -t tcp:port=12345
</PRE>
</LI>
</UL>
<H2><A name="win_kernel"></A>Windows Kernel</H2>
<P>This version of the dbgeng should be used for kernel-debugging of a remote machine. Options
are the same as the base dbgeng, except for the connection-string arguments. For remote
debugging, the target machine should be booted with the appropriate options, set using BCDEDIT
or the equivalent, such as:</P>
<UL style='list-style-type: none'>
<LI>
<PRE>
bcdedit /debug ON
bdcedit /dbgsettings NET HOSTIP:IP PORT:54321 KEY:1.1.1.1
</PRE>
</LI>
</UL>
<P>where IP= the address of the machine runing Ghidra.</P>
<H3>Options</H3>
<UL>
<LI><B>Arguments</B>: This is the connection string specifying the transport options for
communicating with the remote target. A typical example might be
'net:port=54321,key=1.1.1.1'.'</LI>
</UL>
<UL>
<LI><B>Type</B>: The type of kernel connection, either "Remote", "Local", or "EXDI".
"Remote", the most common type, indicates two-machine debugging over various possible
connection media, e.g. Ethernet, serial, USB, etc. "Local" is used for limited introspection
into the target on which the debugger is running. "EXDI" is arguably the most exotic type -
it essentially simulates the normal "Remote" connection using the gdb Remote Serial Protocol.
It can be used when connecting to gdbstubs in platforms, such as QEMU, VMWare, Trace32,
etc.</LI>
</UL>
<H3>EXDI</H3>
<P>Setup for EXDI connections is fairly complicated and difficult to get correct. The argument
string typically should be something like:</P>
<UL style='list-style-type: none'>
<LI>
<PRE>
exdi:CLSID={29f9906e-9dbe-4d4b-b0fb-6acf7fb6d014},Kd=Guess,DataBreaks=Exdi
</PRE>
</LI>
</UL>
<P>The CLSID here should match the CLSID in the <B>exdiConfigData.xml</B> file in the debugger
architectural directory. If windbg has been run using EXDI at some point, there will also be an
entry in the System Registry for this CLSID. The InprocServer32 subentry for this CLSID in the
Registry should point to a copy of ExdiGdbSrv.dll, typically the one in the same directory.
This DLL must reside somewhere that the debugger has permission to load from, i.e. not in the
WindowsApps directory tree. The <B>exdiConfigData</B> file should be configured for the target
you're using. We heavily recommend using <B>displayCommPackets==yes</B>, as many of the tasks
take considerable time, and this is the only indicator of progress.</P>
<P>The <B>Kd=Guess</B> parameter causes the underlying engine to scan memory for the kernel's
base address, which will probably not be provided by the gdbstub. (<B>Kd=NtBaseAddr</B> is also
a valid option, as is eliminating the parameter, but, currently, we have no idea how to point
the configuration at a correct value. Using this option will cause the load to spin
pointlessly.) If you can, we highly recommend breaking the target near the base address, as the
search proceeds down through memory starting at the current program counter. If the difference
between the PC and the base address is large, the loading process will punt before useful
values are detected. If anyone understand how to extend this search (or knows how to set the
base address to sidestep the scan), we would really love some guidance.</P>
<H2><A name="ttd"></A>TTD (Time-Travel Debugging)</H2>
<P>This is an extension to our launcher for the Windows Debugger to support TTD. WinDbg TTD
uses <CODE>event:ticks</CODE> to denote its times. This corresponds well to Ghidra's
<CODE>snapshot:steps</CODE> syntax, when we let snapshot be an event and ticks count the number
of instruction steps. Upon expanding the "Events" node in the Model tree, we create a snapshot
for every TTD event, including thread create/terminate, module load/unload, syscall, and other
asynchronous changes. Then, when Ghidra navigates to a schedule of the form
<CODE>snapshot:steps</CODE>, we command WinDbg to navigate to the corresponding
<CODE>event:ticks</CODE> instead of using Ghidra's emulator. Conversely, time navigation from
the WinDbg CLI will correspondingly navigate Ghidra. Thus, the two are synchronized in time. We
also add <EM>reverse</EM> variants of the <B>Go</B> and <B>Step</B> control commands.</P>
<H3>Options</H3>
<P>This launcher has basically the same options as the WinDbg launcher, except that arguments
are not included and the DLL path must contain <TT>TTDReplay.dll</TT> and the scripts that
implement TTD. These are most easily obtained by installing WinDbg Preview or later.</P>
<H3>Setup</H3>
<P>Depending on how you acquire WinDbg TTD, you may need to copy the installation to a
directory Ghidra is allowed to access. It's best not to try cherry-picking files. Just
copy/unpack the entire WinDbg installation. Point the launch dialog to the directory containing
<TT>dbgeng.dll</TT> as usual.</P>
<P><B>NOTE:</B> It's possible, especially if you have anti-virus software installed, that
<TT>dbghelp.dll</TT> is forcefully loaded into the Python process before our connector package
tries to load <TT>dbgeng.dll</TT>. This can cause <TT>dbghelp.dll</TT> to be loaded from
<TT>System32</TT>, but <TT>dbgeng.dll</TT> to be loaded from the WinDbg installation, often
leading to DLL compatibility problems. This usually manifests in module load and/or Python
import errors. The only real way to be sure is to use a system utility and inspect the DLLs
loaded by the <TT>python.exe</TT> process. You may be able to work around the issue by copying
<TT>dbghelp.dll</TT> (and any other affected WinDbg DLLs) from the WinDbg installation into
your Python installation, e.g., <TT>C:\Python313\dbghelp.dll</TT>.</P>
</BODY>
</HTML>

View file

@ -4,20 +4,20 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "ghidradbg" name = "ghidradbg"
version = "11.3" version = "11.5"
authors = [ authors = [
{ name="Ghidra Development Team" }, { name="Ghidra Development Team" },
] ]
description = "Ghidra's Plugin for dbgeng" description = "Ghidra's Plugin for dbgeng"
readme = "README.md" readme = "README.md"
requires-python = ">=3.7" requires-python = ">=3.9"
classifiers = [ classifiers = [
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
] ]
dependencies = [ dependencies = [
"ghidratrace==11.3", "ghidratrace==11.5",
"pybag>=2.2.12" "pybag>=2.2.12"
] ]
@ -26,7 +26,7 @@ dependencies = [
"Bug Tracker" = "https://github.com/NationalSecurityAgency/ghidra/issues" "Bug Tracker" = "https://github.com/NationalSecurityAgency/ghidra/issues"
[tool.setuptools.package-data] [tool.setuptools.package-data]
ghidradbg = ["*.tlb"] ghidradbg = ["*.tlb", "py.typed"]
[tool.setuptools] [tool.setuptools]
include-package-data = true include-package-data = true

View file

@ -14,6 +14,11 @@
# limitations under the License. # limitations under the License.
## ##
# NOTE: libraries must precede EVERYTHING, esp pybag and DbgMod try:
import pybag
except Exception as e:
from ghidratrace.setuputils import prompt_and_mitigate_dependencies
prompt_and_mitigate_dependencies("<SELF>")
# NOTE: libraries must precede EVERYTHING, esp pybag and DbgMod
from . import libraries, util, commands, methods, hooks from . import libraries, util, commands, methods, hooks

View file

@ -13,13 +13,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
from typing import Dict, List, Optional, Tuple
from ghidratrace.client import Address, RegVal from ghidratrace.client import Address, RegVal
from pybag import pydbg from pybag import pydbg # type: ignore
from . import util from . import util
language_map = { language_map: Dict[str, List[str]] = {
'AARCH64': ['AARCH64:LE:64:AppleSilicon'], 'AARCH64': ['AARCH64:LE:64:AppleSilicon'],
'ARM': ['ARM:LE:32:v8'], 'ARM': ['ARM:LE:32:v8'],
'Itanium': [], 'Itanium': [],
@ -31,25 +33,25 @@ language_map = {
'SH4': ['SuperH4:LE:32:default'], 'SH4': ['SuperH4:LE:32:default'],
} }
data64_compiler_map = { data64_compiler_map: Dict[Optional[str], str] = {
None: 'pointer64', None: 'pointer64',
} }
x86_compiler_map = { x86_compiler_map: Dict[Optional[str], str] = {
'windows': 'windows', 'windows': 'windows',
'Cygwin': 'windows', 'Cygwin': 'windows',
'default': 'windows', 'default': 'windows',
} }
default_compiler_map = { default_compiler_map: Dict[Optional[str], str] = {
'windows': 'default', 'windows': 'default',
} }
windows_compiler_map = { windows_compiler_map: Dict[Optional[str], str] = {
'windows': 'windows', 'windows': 'windows',
} }
compiler_map = { compiler_map : Dict[str, Dict[Optional[str], str]]= {
'DATA:BE:64:default': data64_compiler_map, 'DATA:BE:64:default': data64_compiler_map,
'DATA:LE:64:default': data64_compiler_map, 'DATA:LE:64:default': data64_compiler_map,
'x86:LE:32:default': x86_compiler_map, 'x86:LE:32:default': x86_compiler_map,
@ -62,11 +64,11 @@ compiler_map = {
} }
def get_arch(): def get_arch() -> str:
try: try:
type = util.dbg.get_actual_processor_type() type = util.dbg.get_actual_processor_type()
except Exception: except Exception as e:
print("Error getting actual processor type.") print(f"Error getting actual processor type: {e}")
return "Unknown" return "Unknown"
if type is None: if type is None:
return "x86_64" return "x86_64"
@ -129,14 +131,14 @@ def get_arch():
return "Unknown" return "Unknown"
def get_endian(): def get_endian() -> str:
parm = util.get_convenience_variable('endian') parm = util.get_convenience_variable('endian')
if parm != 'auto': if parm != 'auto':
return parm return parm
return 'little' return 'little'
def get_osabi(): def get_osabi() -> str:
parm = util.get_convenience_variable('osabi') parm = util.get_convenience_variable('osabi')
if not parm in ['auto', 'default']: if not parm in ['auto', 'default']:
return parm return parm
@ -150,7 +152,7 @@ def get_osabi():
return "windows" return "windows"
def compute_ghidra_language(): def compute_ghidra_language() -> str:
# First, check if the parameter is set # First, check if the parameter is set
lang = util.get_convenience_variable('ghidra-language') lang = util.get_convenience_variable('ghidra-language')
if lang != 'auto': if lang != 'auto':
@ -175,7 +177,7 @@ def compute_ghidra_language():
return 'DATA' + lebe + '64:default' return 'DATA' + lebe + '64:default'
def compute_ghidra_compiler(lang): def compute_ghidra_compiler(lang: str) -> str:
# First, check if the parameter is set # First, check if the parameter is set
comp = util.get_convenience_variable('ghidra-compiler') comp = util.get_convenience_variable('ghidra-compiler')
if comp != 'auto': if comp != 'auto':
@ -197,7 +199,7 @@ def compute_ghidra_compiler(lang):
return 'default' return 'default'
def compute_ghidra_lcsp(): def compute_ghidra_lcsp() -> Tuple[str, str]:
lang = compute_ghidra_language() lang = compute_ghidra_language()
comp = compute_ghidra_compiler(lang) comp = compute_ghidra_compiler(lang)
return lang, comp return lang, comp
@ -205,10 +207,10 @@ def compute_ghidra_lcsp():
class DefaultMemoryMapper(object): class DefaultMemoryMapper(object):
def __init__(self, defaultSpace): def __init__(self, defaultSpace: str) -> None:
self.defaultSpace = defaultSpace self.defaultSpace = defaultSpace
def map(self, proc: int, offset: int): def map(self, proc: int, offset: int) -> Tuple[str, Address]:
space = self.defaultSpace space = self.defaultSpace
return self.defaultSpace, Address(space, offset) return self.defaultSpace, Address(space, offset)
@ -220,10 +222,10 @@ class DefaultMemoryMapper(object):
DEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram') DEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram')
memory_mappers = {} memory_mappers: Dict[str, DefaultMemoryMapper] = {}
def compute_memory_mapper(lang): def compute_memory_mapper(lang: str) -> DefaultMemoryMapper:
if not lang in memory_mappers: if not lang in memory_mappers:
return DEFAULT_MEMORY_MAPPER return DEFAULT_MEMORY_MAPPER
return memory_mappers[lang] return memory_mappers[lang]
@ -231,16 +233,15 @@ def compute_memory_mapper(lang):
class DefaultRegisterMapper(object): class DefaultRegisterMapper(object):
def __init__(self, byte_order): def __init__(self, byte_order: str) -> None:
if not byte_order in ['big', 'little']: if not byte_order in ['big', 'little']:
raise ValueError("Invalid byte_order: {}".format(byte_order)) raise ValueError("Invalid byte_order: {}".format(byte_order))
self.byte_order = byte_order self.byte_order = byte_order
self.union_winners = {}
def map_name(self, proc, name): def map_name(self, proc: int, name: str):
return name return name
def map_value(self, proc, name, value): def map_value(self, proc: int, name: str, value: int):
try: try:
# TODO: this seems half-baked # TODO: this seems half-baked
av = value.to_bytes(8, "big") av = value.to_bytes(8, "big")
@ -249,10 +250,10 @@ class DefaultRegisterMapper(object):
.format(name, value, type(value))) .format(name, value, type(value)))
return RegVal(self.map_name(proc, name), av) return RegVal(self.map_name(proc, name), av)
def map_name_back(self, proc, name): def map_name_back(self, proc: int, name: str) -> str:
return name return name
def map_value_back(self, proc, name, value): def map_value_back(self, proc: int, name: str, value: bytes):
return RegVal(self.map_name_back(proc, name), value) return RegVal(self.map_name_back(proc, name), value)
@ -290,7 +291,7 @@ register_mappers = {
} }
def compute_register_mapper(lang): def compute_register_mapper(lang: str)-> DefaultRegisterMapper:
if not lang in register_mappers: if not lang in register_mappers:
if ':BE:' in lang: if ':BE:' in lang:
return DEFAULT_BE_REGISTER_MAPPER return DEFAULT_BE_REGISTER_MAPPER

View file

@ -18,7 +18,6 @@ from ctypes import *
from comtypes.gen import DbgMod from comtypes.gen import DbgMod
from comtypes.hresult import S_OK, S_FALSE from comtypes.hresult import S_OK, S_FALSE
from pybag.dbgeng import exception from pybag.dbgeng import exception
from pybag.dbgeng import win32
class DebugHost(object): class DebugHost(object):

View file

@ -26,6 +26,7 @@ from . import imodelobject as mo
class ModelIterator(object): class ModelIterator(object):
def __init__(self, iter): def __init__(self, iter):
self._iter = iter self._iter = iter
self._index = 0
iter.AddRef() iter.AddRef()
# ModelIterator # ModelIterator
@ -39,10 +40,17 @@ class ModelIterator(object):
byref(indexer), byref(metadata)) byref(indexer), byref(metadata))
except COMError as ce: except COMError as ce:
return None return None
if "ptr=0x0" in str(indexer):
next = (self._index, mo.ModelObject(object))
self._index += 1
return next
index = mo.ModelObject(indexer) index = mo.ModelObject(indexer)
ival = index.GetIntrinsicValue() ival = index.GetIntrinsicValue()
if ival is None: if ival is None:
return (0, mo.ModelObject(object)) next = (self._index, mo.ModelObject(object))
self._index += 1
return next
return (ival.value, mo.ModelObject(object)) return (ival.value, mo.ModelObject(object))
def Reset(self): def Reset(self):

View file

@ -0,0 +1,44 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from ctypes import *
from comtypes import COMError
from comtypes.gen import DbgMod
from comtypes.hresult import S_OK, S_FALSE
from pybag.dbgeng import exception
from . import imodelobject as mo
class ModelMethod(object):
def __init__(self, method):
self._method = method
method.AddRef()
# ModelMethod
def Call(self, object, argcount=0, arguments=None):
if argcount == 0:
arguments = POINTER(DbgMod.IModelObject)()
result = POINTER(DbgMod.IModelObject)()
metadata = POINTER(DbgMod.IKeyStore)()
try:
self._method.Call(byref(object), argcount, byref(arguments),
byref(result), byref(metadata))
except COMError as ce:
return None
return mo.ModelObject(result)

View file

@ -342,7 +342,6 @@ class ModelObject(object):
# print(f"{element} not found") # print(f"{element} not found")
return next return next
def GetValue(self): def GetValue(self):
value = self.GetIntrinsicValue() value = self.GetIntrinsicValue()
if value is None: if value is None:
@ -350,4 +349,3 @@ class ModelObject(object):
if value.vt == 0xd: if value.vt == 0xd:
return None return None
return value.value return value.value

View file

@ -35,7 +35,7 @@ class RawEnumerator(object):
self._keys = None self._keys = None
return cnt return cnt
# KeyEnumerator # RawEnumerator
def GetNext(self): def GetNext(self):
key = BSTR() key = BSTR()

View file

@ -13,12 +13,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
from ghidradbg import arch, commands, util
from ghidratrace import sch from ghidratrace import sch
from ghidratrace.client import Client, Address, AddressRange, TraceObject from ghidratrace.client import Client, Address, AddressRange, Trace, TraceObject
PAGE_SIZE = 4096 PAGE_SIZE = 4096
from ghidradbg import arch, commands, util
SESSION_PATH = 'Sessions[0]' SESSION_PATH = 'Sessions[0]'
PROCESSES_PATH = SESSION_PATH + '.ExdiProcesses' PROCESSES_PATH = SESSION_PATH + '.ExdiProcesses'
@ -42,73 +42,64 @@ SECTIONS_ADD_PATTERN = '.Sections'
SECTION_KEY_PATTERN = '[{secname}]' SECTION_KEY_PATTERN = '[{secname}]'
SECTION_ADD_PATTERN = SECTIONS_ADD_PATTERN + SECTION_KEY_PATTERN SECTION_ADD_PATTERN = SECTIONS_ADD_PATTERN + SECTION_KEY_PATTERN
@util.dbg.eng_thread @util.dbg.eng_thread
def ghidra_trace_put_processes_exdi(): def ghidra_trace_put_processes_exdi() -> None:
""" """Put the list of processes into the trace's processes list."""
Put the list of processes into the trace's processes list.
"""
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
commands.STATE.require_tx() trace, tx = commands.STATE.require_tx()
with commands.STATE.client.batch() as b: with trace.client.batch() as b:
put_processes_exdi(commands.STATE, radix) put_processes_exdi(trace, radix)
@util.dbg.eng_thread @util.dbg.eng_thread
def ghidra_trace_put_regions_exdi(): def ghidra_trace_put_regions_exdi() -> None:
""" """Read the memory map, if applicable, and write to the trace's Regions."""
Read the memory map, if applicable, and write to the trace's Regions
"""
commands.STATE.require_tx() trace, tx = commands.STATE.require_tx()
with commands.STATE.client.batch() as b: with trace.client.batch() as b:
put_regions_exdi(commands.STATE) put_regions_exdi(trace)
@util.dbg.eng_thread @util.dbg.eng_thread
def ghidra_trace_put_kmodules_exdi(): def ghidra_trace_put_kmodules_exdi() -> None:
""" """Gather object files, if applicable, and write to the trace's Modules."""
Gather object files, if applicable, and write to the trace's Modules
"""
commands.STATE.require_tx() trace, tx = commands.STATE.require_tx()
with commands.STATE.client.batch() as b: with trace.client.batch() as b:
put_kmodules_exdi(commands.STATE) put_kmodules_exdi(trace)
@util.dbg.eng_thread @util.dbg.eng_thread
def ghidra_trace_put_threads_exdi(pid): def ghidra_trace_put_threads_exdi(pid: int) -> None:
""" """Put the current process's threads into the Ghidra trace."""
Put the current process's threads into the Ghidra trace
"""
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
commands.STATE.require_tx() trace, tx = commands.STATE.require_tx()
with commands.STATE.client.batch() as b: with trace.client.batch() as b:
put_threads_exdi(commands.STATE, pid, radix) put_threads_exdi(trace, pid, radix)
@util.dbg.eng_thread @util.dbg.eng_thread
def ghidra_trace_put_all_exdi(): def ghidra_trace_put_all_exdi() -> None:
""" """Put everything currently selected into the Ghidra trace."""
Put everything currently selected into the Ghidra trace
"""
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
commands.STATE.require_tx() trace, tx = commands.STATE.require_tx()
with commands.STATE.client.batch() as b: with trace.client.batch() as b:
if util.dbg.use_generics == False: if util.dbg.use_generics == False:
put_processes_exdi(commands.STATE, radix) put_processes_exdi(trace, radix)
put_regions_exdi(commands.STATE) put_regions_exdi(trace)
put_kmodules_exdi(commands.STATE) put_kmodules_exdi(trace)
@util.dbg.eng_thread @util.dbg.eng_thread
def put_processes_exdi(state, radix): def put_processes_exdi(trace: Trace, radix: int) -> None:
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
keys = [] keys = []
result = util.dbg._base.cmd("!process 0 0") result = util.dbg._base.cmd("!process 0 0")
lines = result.split("\n") lines = list(x for x in result.splitlines() if "DeepFreeze" not in x)
count = int((len(lines)-2)/5) count = int((len(lines)-2)/5)
for i in range(0, count): for i in range(0, count):
l1 = lines[i*5+1].strip().split() # PROCESS l1 = lines[i*5+1].strip().split() # PROCESS
@ -118,7 +109,7 @@ def put_processes_exdi(state, radix):
id = int(l2[3], 16) id = int(l2[3], 16)
name = l4[1] name = l4[1]
ppath = PROCESS_PATTERN.format(pid=id) ppath = PROCESS_PATTERN.format(pid=id)
procobj = state.trace.create_object(ppath) procobj = trace.create_object(ppath)
keys.append(PROCESS_KEY_PATTERN.format(pid=id)) keys.append(PROCESS_KEY_PATTERN.format(pid=id))
pidstr = ('0x{:x}' if radix == pidstr = ('0x{:x}' if radix ==
16 else '0{:o}' if radix == 8 else '{}').format(id) 16 else '0{:o}' if radix == 8 else '{}').format(id)
@ -126,22 +117,22 @@ def put_processes_exdi(state, radix):
procobj.set_value('Name', name) procobj.set_value('Name', name)
procobj.set_value('_display', '[{}] {}'.format(pidstr, name)) procobj.set_value('_display', '[{}] {}'.format(pidstr, name))
(base, addr) = commands.map_address(int(l1[1], 16)) (base, addr) = commands.map_address(int(l1[1], 16))
procobj.set_value('EPROCESS', addr, schema="ADDRESS") procobj.set_value('EPROCESS', addr, schema=sch.ADDRESS)
(base, addr) = commands.map_address(int(l2[5], 16)) (base, addr) = commands.map_address(int(l2[5], 16))
procobj.set_value('PEB', addr, schema="ADDRESS") procobj.set_value('PEB', addr, schema=sch.ADDRESS)
(base, addr) = commands.map_address(int(l3[1], 16)) (base, addr) = commands.map_address(int(l3[1], 16))
procobj.set_value('DirBase', addr, schema="ADDRESS") procobj.set_value('DirBase', addr, schema=sch.ADDRESS)
(base, addr) = commands.map_address(int(l3[3], 16)) (base, addr) = commands.map_address(int(l3[3], 16))
procobj.set_value('ObjectTable', addr, schema="ADDRESS") procobj.set_value('ObjectTable', addr, schema=sch.ADDRESS)
# procobj.set_value('ObjectTable', l3[3]) # procobj.set_value('ObjectTable', l3[3])
tcobj = state.trace.create_object(ppath+".Threads") tcobj = trace.create_object(ppath+".Threads")
procobj.insert() procobj.insert()
tcobj.insert() tcobj.insert()
state.trace.proxy_object_path(PROCESSES_PATH).retain_values(keys) trace.proxy_object_path(PROCESSES_PATH).retain_values(keys)
@util.dbg.eng_thread @util.dbg.eng_thread
def put_regions_exdi(state): def put_regions_exdi(trace: Trace) -> None:
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
keys = [] keys = []
result = util.dbg._base.cmd("!address") result = util.dbg._base.cmd("!address")
@ -165,8 +156,8 @@ def put_regions_exdi(state):
rng = saddr.extend(int(length, 16)) rng = saddr.extend(int(length, 16))
rpath = REGION_PATTERN.format(start=start) rpath = REGION_PATTERN.format(start=start)
keys.append(REGION_KEY_PATTERN.format(start=start)) keys.append(REGION_KEY_PATTERN.format(start=start))
regobj = state.trace.create_object(rpath) regobj = trace.create_object(rpath)
regobj.set_value('Range', rng, schema="RANGE") regobj.set_value('Range', rng, schema=sch.RANGE)
regobj.set_value('Size', length) regobj.set_value('Size', length)
regobj.set_value('Type', type) regobj.set_value('Type', type)
regobj.set_value('_readable', True) regobj.set_value('_readable', True)
@ -175,11 +166,11 @@ def put_regions_exdi(state):
regobj.set_value('_display', '[{}] {}'.format( regobj.set_value('_display', '[{}] {}'.format(
start, type)) start, type))
regobj.insert() regobj.insert()
state.trace.proxy_object_path(MEMORY_PATH).retain_values(keys) trace.proxy_object_path(MEMORY_PATH).retain_values(keys)
@util.dbg.eng_thread @util.dbg.eng_thread
def put_kmodules_exdi(state): def put_kmodules_exdi(trace: Trace) -> None:
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
keys = [] keys = []
result = util.dbg._base.cmd("lm") result = util.dbg._base.cmd("lm")
@ -203,19 +194,20 @@ def put_kmodules_exdi(state):
rng = saddr.extend(sz) rng = saddr.extend(sz)
mpath = KMODULE_PATTERN.format(modpath=sname) mpath = KMODULE_PATTERN.format(modpath=sname)
keys.append(KMODULE_KEY_PATTERN.format(modpath=sname)) keys.append(KMODULE_KEY_PATTERN.format(modpath=sname))
modobj = commands.STATE.trace.create_object(mpath) modobj = trace.create_object(mpath)
modobj.set_value('Name', name) modobj.set_value('Name', name)
modobj.set_value('Base', saddr, schema="ADDRESS") modobj.set_value('Base', saddr, schema=sch.ADDRESS)
modobj.set_value('Range', rng, schema="RANGE") modobj.set_value('Range', rng, schema=sch.RANGE)
modobj.set_value('Size', hex(sz)) modobj.set_value('Size', hex(sz))
modobj.insert() modobj.insert()
state.trace.proxy_object_path(KMODULES_PATH).retain_values(keys) trace.proxy_object_path(KMODULES_PATH).retain_values(keys)
@util.dbg.eng_thread @util.dbg.eng_thread
def put_threads_exdi(state, pid, radix): def put_threads_exdi(trace: Trace, pid: int, radix: int) -> None:
radix = util.get_convenience_variable('output-radix') radix = util.get_convenience_variable('output-radix')
pidstr = ('0x{:x}' if radix == 16 else '0{:o}' if radix == 8 else '{}').format(pid) pidstr = ('0x{:x}' if radix == 16 else '0{:o}' if radix ==
8 else '{}').format(pid)
keys = [] keys = []
result = util.dbg._base.cmd("!process "+hex(pid)+" 4") result = util.dbg._base.cmd("!process "+hex(pid)+" 4")
lines = result.split("\n") lines = result.split("\n")
@ -229,9 +221,9 @@ def put_threads_exdi(state, pid, radix):
tidstr = ('0x{:x}' if radix == tidstr = ('0x{:x}' if radix ==
16 else '0{:o}' if radix == 8 else '{}').format(tid) 16 else '0{:o}' if radix == 8 else '{}').format(tid)
tpath = THREAD_PATTERN.format(pid=pid, tnum=tid) tpath = THREAD_PATTERN.format(pid=pid, tnum=tid)
tobj = commands.STATE.trace.create_object(tpath) tobj = trace.create_object(tpath)
keys.append(THREAD_KEY_PATTERN.format(tnum=tidstr)) keys.append(THREAD_KEY_PATTERN.format(tnum=tidstr))
tobj = state.trace.create_object(tpath) tobj = trace.create_object(tpath)
tobj.set_value('PID', pidstr) tobj.set_value('PID', pidstr)
tobj.set_value('TID', tidstr) tobj.set_value('TID', tidstr)
tobj.set_value('_display', '[{}]'.format(tidstr)) tobj.set_value('_display', '[{}]'.format(tidstr))
@ -240,5 +232,5 @@ def put_threads_exdi(state, pid, radix):
tobj.set_value('Win32Thread', fields[7]) tobj.set_value('Win32Thread', fields[7])
tobj.set_value('State', fields[8]) tobj.set_value('State', fields[8])
tobj.insert() tobj.insert()
commands.STATE.trace.proxy_object_path( trace.proxy_object_path(THREADS_PATTERN.format(
THREADS_PATTERN.format(pid=pidstr)).retain_values(keys) pid=pidstr)).retain_values(keys)

View file

@ -16,15 +16,17 @@
import re import re
from ghidratrace import sch from ghidratrace import sch
from ghidratrace.client import MethodRegistry, ParamDesc, Address, AddressRange from ghidratrace.client import (MethodRegistry, ParamDesc, Address,
AddressRange, TraceObject)
from ghidradbg import util, commands, methods from ghidradbg import util, commands, methods
from ghidradbg.methods import REGISTRY, SESSIONS_PATTERN, SESSION_PATTERN, extre from ghidradbg.methods import REGISTRY, SESSIONS_PATTERN, SESSION_PATTERN, extre
from . import exdi_commands from . import exdi_commands
XPROCESSES_PATTERN = extre(SESSION_PATTERN, '\.ExdiProcesses') XPROCESSES_PATTERN = extre(SESSION_PATTERN, '\\.ExdiProcesses')
XPROCESS_PATTERN = extre(XPROCESSES_PATTERN, '\[(?P<procnum>\\d*)\]') XPROCESS_PATTERN = extre(XPROCESSES_PATTERN, '\\[(?P<procnum>\\d*)\\]')
XTHREADS_PATTERN = extre(XPROCESS_PATTERN, '\.Threads') XTHREADS_PATTERN = extre(XPROCESS_PATTERN, '\\.Threads')
def find_pid_by_pattern(pattern, object, err_msg): def find_pid_by_pattern(pattern, object, err_msg):
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
@ -38,16 +40,23 @@ def find_pid_by_obj(object):
return find_pid_by_pattern(XTHREADS_PATTERN, object, "an ExdiThreadsContainer") return find_pid_by_pattern(XTHREADS_PATTERN, object, "an ExdiThreadsContainer")
class ExdiProcessContainer(TraceObject):
pass
class ExdiThreadContainer(TraceObject):
pass
@REGISTRY.method(action='refresh', display="Refresh Target Processes") @REGISTRY.method(action='refresh', display="Refresh Target Processes")
def refresh_exdi_processes(node: sch.Schema('ExdiProcessContainer')): def refresh_exdi_processes(node: ExdiProcessContainer) -> None:
"""Refresh the list of processes in the target kernel.""" """Refresh the list of processes in the target kernel."""
with commands.open_tracked_tx('Refresh Processes'): with commands.open_tracked_tx('Refresh Processes'):
exdi_commands.ghidra_trace_put_processes_exdi() exdi_commands.ghidra_trace_put_processes_exdi()
@REGISTRY.method(action='refresh', display="Refresh Process Threads") @REGISTRY.method(action='refresh', display="Refresh Process Threads")
def refresh_exdi_threads(node: sch.Schema('ExdiThreadContainer')): def refresh_exdi_threads(node: ExdiThreadContainer) -> None:
"""Refresh the list of threads in the process.""" """Refresh the list of threads in the process."""
pid = find_pid_by_obj(node) pid = find_pid_by_obj(node)
with commands.open_tracked_tx('Refresh Threads'): with commands.open_tracked_tx('Refresh Threads'):

View file

@ -13,18 +13,23 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
from bisect import bisect_left, bisect_right
from dataclasses import dataclass, field
import functools import functools
import sys import sys
import threading import threading
import time import time
import traceback import traceback
from typing import Any, Callable, Collection, Dict, Optional, TypeVar, cast
from comtypes.hresult import S_OK from comtypes.hresult import S_OK # type: ignore
from pybag import pydbg from pybag import pydbg # type: ignore
from pybag.dbgeng import core as DbgEng from pybag.dbgeng import core as DbgEng # type: ignore
from pybag.dbgeng import exception from pybag.dbgeng import exception # type: ignore
from pybag.dbgeng.callbacks import EventHandler from pybag.dbgeng.callbacks import EventHandler # type: ignore
from pybag.dbgeng.idebugbreakpoint import DebugBreakpoint from pybag.dbgeng.idebugbreakpoint import DebugBreakpoint # type: ignore
from ghidratrace.client import Schedule
from . import commands, util from . import commands, util
from .exdi import exdi_commands from .exdi import exdi_commands
@ -33,36 +38,33 @@ from .exdi import exdi_commands
ALL_EVENTS = 0xFFFF ALL_EVENTS = 0xFFFF
class HookState(object): @dataclass(frozen=False)
__slots__ = ('installed', 'mem_catchpoint') class HookState:
installed = False
def __init__(self): mem_catchpoint = None
self.installed = False
self.mem_catchpoint = None
class ProcessState(object): @dataclass(frozen=False)
__slots__ = ('first', 'regions', 'modules', 'threads', class ProcessState:
'breaks', 'watches', 'visited', 'waiting') first = True
def __init__(self):
self.first = True
# For things we can detect changes to between stops # For things we can detect changes to between stops
self.regions = False regions = False
self.modules = False modules = False
self.threads = False threads = False
self.breaks = False breaks = False
self.watches = False watches = False
# For frames and threads that have already been synced since last stop # For frames and threads that have already been synced since last stop
self.visited = set() visited: set[Any] = field(default_factory=set)
self.waiting = False waiting = False
def record(self, description=None): def record(self, description: Optional[str] = None,
time: Optional[Schedule] = None) -> None:
# print("RECORDING") # print("RECORDING")
first = self.first first = self.first
self.first = False self.first = False
trace = commands.STATE.require_trace()
if description is not None: if description is not None:
commands.STATE.trace.snapshot(description) trace.snapshot(description, time=time)
if first: if first:
if util.is_kernel(): if util.is_kernel():
commands.create_generic("Sessions") commands.create_generic("Sessions")
@ -71,6 +73,9 @@ class ProcessState(object):
commands.put_processes() commands.put_processes()
commands.put_environment() commands.put_environment()
commands.put_threads() commands.put_threads()
if util.is_trace():
commands.init_ttd()
# commands.put_events()
if self.threads: if self.threads:
commands.put_threads() commands.put_threads()
self.threads = False self.threads = False
@ -90,46 +95,48 @@ class ProcessState(object):
self.visited.add(hashable_frame) self.visited.add(hashable_frame)
if first or self.regions: if first or self.regions:
if util.is_exdi(): if util.is_exdi():
exdi_commands.put_regions_exdi(commands.STATE) exdi_commands.put_regions_exdi(trace)
commands.put_regions() commands.put_regions()
self.regions = False self.regions = False
if first or self.modules: if first or self.modules:
if util.is_exdi(): if util.is_exdi():
exdi_commands.put_kmodules_exdi(commands.STATE) exdi_commands.put_kmodules_exdi(trace)
commands.put_modules() commands.put_modules()
self.modules = False self.modules = False
if first or self.breaks: if first or self.breaks:
commands.put_breakpoints() commands.put_breakpoints()
commands.put_events()
commands.put_exceptions()
self.breaks = False self.breaks = False
def record_continued(self): def record_continued(self) -> None:
commands.put_processes(running=True) commands.put_processes(running=True)
commands.put_threads(running=True) commands.put_threads(running=True)
def record_exited(self, exit_code, description=None): def record_exited(self, exit_code: int, description: Optional[str] = None,
time: Optional[Schedule] = None) -> None:
# print("RECORD_EXITED") # print("RECORD_EXITED")
trace = commands.STATE.require_trace()
if description is not None: if description is not None:
commands.STATE.trace.snapshot(description) trace.snapshot(description, time=time)
proc = util.selected_process() proc = util.selected_process()
ipath = commands.PROCESS_PATTERN.format(procnum=proc) ipath = commands.PROCESS_PATTERN.format(procnum=proc)
procobj = commands.STATE.trace.proxy_object_path(ipath) procobj = trace.proxy_object_path(ipath)
procobj.set_value('Exit Code', exit_code) procobj.set_value('Exit Code', exit_code)
procobj.set_value('State', 'TERMINATED') procobj.set_value('State', 'TERMINATED')
class BrkState(object): @dataclass(frozen=False)
__slots__ = ('break_loc_counts',) class BrkState:
break_loc_counts: Dict[int, int] = field(default_factory=dict)
def __init__(self): def update_brkloc_count(self, b: DebugBreakpoint, count: int) -> None:
self.break_loc_counts = {}
def update_brkloc_count(self, b, count):
self.break_loc_counts[b.GetID()] = count self.break_loc_counts[b.GetID()] = count
def get_brkloc_count(self, b): def get_brkloc_count(self, b: DebugBreakpoint) -> int:
return self.break_loc_counts.get(b.GetID(), 0) return self.break_loc_counts.get(b.GetID(), 0)
def del_brkloc_count(self, b): def del_brkloc_count(self, b: DebugBreakpoint) -> int:
if b not in self.break_loc_counts: if b not in self.break_loc_counts:
return 0 # TODO: Print a warning? return 0 # TODO: Print a warning?
count = self.break_loc_counts[b.GetID()] count = self.break_loc_counts[b.GetID()]
@ -139,35 +146,37 @@ class BrkState(object):
HOOK_STATE = HookState() HOOK_STATE = HookState()
BRK_STATE = BrkState() BRK_STATE = BrkState()
PROC_STATE = {} PROC_STATE: Dict[int, ProcessState] = {}
def log_errors(func): C = TypeVar('C', bound=Callable)
'''
Wrap a function in a try-except that prints and reraises the
exception. def log_errors(func: C) -> C:
"""Wrap a function in a try-except that prints and reraises the exception.
This is needed because pybag and/or the COM wrappers do not print This is needed because pybag and/or the COM wrappers do not print
exceptions that occur during event callbacks. exceptions that occur during event callbacks.
''' """
@functools.wraps(func) @functools.wraps(func)
def _func(*args, **kwargs): def _func(*args, **kwargs) -> Any:
try: try:
return func(*args, **kwargs) return func(*args, **kwargs)
except: except:
traceback.print_exc() traceback.print_exc()
raise raise
return _func return cast(C, _func)
@log_errors @log_errors
def on_state_changed(*args): def on_state_changed(*args) -> int:
# print("ON_STATE_CHANGED") # print(f"---ON_STATE_CHANGED:{args}---")
# print(args)
if args[0] == DbgEng.DEBUG_CES_CURRENT_THREAD: if args[0] == DbgEng.DEBUG_CES_CURRENT_THREAD:
return on_thread_selected(args) on_thread_selected(args)
return S_OK
elif args[0] == DbgEng.DEBUG_CES_BREAKPOINTS: elif args[0] == DbgEng.DEBUG_CES_BREAKPOINTS:
return on_breakpoint_modified(args) on_breakpoint_modified(args)
return S_OK
elif args[0] == DbgEng.DEBUG_CES_RADIX: elif args[0] == DbgEng.DEBUG_CES_RADIX:
util.set_convenience_variable('output-radix', args[1]) util.set_convenience_variable('output-radix', args[1])
return S_OK return S_OK
@ -182,21 +191,24 @@ def on_state_changed(*args):
if proc in PROC_STATE: if proc in PROC_STATE:
# Process may have exited (so deleted) first. # Process may have exited (so deleted) first.
PROC_STATE[proc].waiting = False PROC_STATE[proc].waiting = False
trace = commands.STATE.trace trace = commands.STATE.require_trace()
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("State changed proc {}".format(proc)): with trace.open_tx("State changed proc {}".format(proc)):
commands.put_state(proc) commands.put_state(proc)
if args[1] == DbgEng.DEBUG_STATUS_BREAK: if args[1] == DbgEng.DEBUG_STATUS_BREAK:
return on_stop(args) on_stop(args)
return S_OK
elif args[1] == DbgEng.DEBUG_STATUS_NO_DEBUGGEE: elif args[1] == DbgEng.DEBUG_STATUS_NO_DEBUGGEE:
return on_exited(proc) on_exited(proc)
return S_OK
else: else:
return on_cont(args) on_cont(args)
return S_OK
return S_OK return S_OK
@log_errors @log_errors
def on_debuggee_changed(*args): def on_debuggee_changed(*args) -> int:
# print("ON_DEBUGGEE_CHANGED: args={}".format(args)) # print("ON_DEBUGGEE_CHANGED: args={}".format(args))
# sys.stdout.flush() # sys.stdout.flush()
trace = commands.STATE.trace trace = commands.STATE.trace
@ -210,20 +222,20 @@ def on_debuggee_changed(*args):
@log_errors @log_errors
def on_session_status_changed(*args): def on_session_status_changed(*args) -> None:
# print("ON_STATUS_CHANGED: args={}".format(args)) # print("ON_STATUS_CHANGED: args={}".format(args))
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
if args[0] == DbgEng.DEBUG_SESSION_ACTIVE or args[0] == DbgEng.DEBUG_SESSION_REBOOT: if args[0] == DbgEng.DEBUG_SESSION_ACTIVE or args[0] == DbgEng.DEBUG_SESSION_REBOOT:
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("New Session {}".format(util.selected_process())): with trace.open_tx("New Session {}".format(util.selected_process())):
commands.put_processes() commands.put_processes()
return DbgEng.DEBUG_STATUS_GO return DbgEng.DEBUG_STATUS_GO
@log_errors @log_errors
def on_symbol_state_changed(*args): def on_symbol_state_changed(*args) -> None:
# print("ON_SYMBOL_STATE_CHANGED") # print("ON_SYMBOL_STATE_CHANGED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -237,31 +249,31 @@ def on_symbol_state_changed(*args):
@log_errors @log_errors
def on_system_error(*args): def on_system_error(*args) -> None:
print("ON_SYSTEM_ERROR: args={}".format(args)) print("ON_SYSTEM_ERROR: args={}".format(args))
# print(hex(args[0])) # print(hex(args[0]))
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("System Error {}".format(util.selected_process())): with trace.open_tx("System Error {}".format(util.selected_process())):
commands.put_processes() commands.put_processes()
return DbgEng.DEBUG_STATUS_BREAK return DbgEng.DEBUG_STATUS_BREAK
@log_errors @log_errors
def on_new_process(*args): def on_new_process(*args) -> None:
# print("ON_NEW_PROCESS") # print("ON_NEW_PROCESS")
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())): with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes() commands.put_processes()
return DbgEng.DEBUG_STATUS_BREAK return DbgEng.DEBUG_STATUS_BREAK
def on_process_selected(): def on_process_selected() -> None:
# print("PROCESS_SELECTED") # print("PROCESS_SELECTED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -269,14 +281,14 @@ def on_process_selected():
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Process {} selected".format(proc)): with trace.open_tx("Process {} selected".format(proc)):
PROC_STATE[proc].record() PROC_STATE[proc].record()
commands.activate() commands.activate()
@log_errors @log_errors
def on_process_deleted(*args): def on_process_deleted(*args) -> None:
# print("ON_PROCESS_DELETED") # print("ON_PROCESS_DELETED")
exit_code = args[0] exit_code = args[0]
proc = util.selected_process() proc = util.selected_process()
@ -286,14 +298,14 @@ def on_process_deleted(*args):
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Process {} deleted".format(proc)): with trace.open_tx("Process {} deleted".format(proc)):
commands.put_processes() # TODO: Could just delete the one.... commands.put_processes() # TODO: Could just delete the one....
return DbgEng.DEBUG_STATUS_BREAK return DbgEng.DEBUG_STATUS_BREAK
@log_errors @log_errors
def on_threads_changed(*args): def on_threads_changed(*args) -> None:
# print("ON_THREADS_CHANGED") # print("ON_THREADS_CHANGED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -302,7 +314,7 @@ def on_threads_changed(*args):
return DbgEng.DEBUG_STATUS_GO return DbgEng.DEBUG_STATUS_GO
def on_thread_selected(*args): def on_thread_selected(*args) -> None:
# print("THREAD_SELECTED: args={}".format(args)) # print("THREAD_SELECTED: args={}".format(args))
# sys.stdout.flush() # sys.stdout.flush()
nthrd = args[0][1] nthrd = args[0][1]
@ -312,7 +324,7 @@ def on_thread_selected(*args):
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Thread {}.{} selected".format(nproc, nthrd)): with trace.open_tx("Thread {}.{} selected".format(nproc, nthrd)):
commands.put_state(nproc) commands.put_state(nproc)
state = PROC_STATE[nproc] state = PROC_STATE[nproc]
@ -323,7 +335,7 @@ def on_thread_selected(*args):
commands.activate() commands.activate()
def on_register_changed(regnum): def on_register_changed(regnum) -> None:
# print("REGISTER_CHANGED") # print("REGISTER_CHANGED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -331,13 +343,13 @@ def on_register_changed(regnum):
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
return return
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Register {} changed".format(regnum)): with trace.open_tx("Register {} changed".format(regnum)):
commands.putreg() commands.putreg()
commands.activate() commands.activate()
def on_memory_changed(space): def on_memory_changed(space) -> None:
if space != DbgEng.DEBUG_DATA_SPACE_VIRTUAL: if space != DbgEng.DEBUG_DATA_SPACE_VIRTUAL:
return return
proc = util.selected_process() proc = util.selected_process()
@ -349,12 +361,12 @@ def on_memory_changed(space):
# Not great, but invalidate the whole space # Not great, but invalidate the whole space
# UI will only re-fetch what it needs # UI will only re-fetch what it needs
# But, some observations will not be recovered # But, some observations will not be recovered
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Memory changed"): with trace.open_tx("Memory changed"):
commands.putmem_state(0, 2**64, 'unknown') commands.putmem_state(0, 2**64, 'unknown')
def on_cont(*args): def on_cont(*args) -> None:
# print("ON CONT") # print("ON CONT")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -363,32 +375,55 @@ def on_cont(*args):
if trace is None: if trace is None:
return return
state = PROC_STATE[proc] state = PROC_STATE[proc]
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Continued"): with trace.open_tx("Continued"):
state.record_continued() state.record_continued()
return DbgEng.DEBUG_STATUS_GO return DbgEng.DEBUG_STATUS_GO
def on_stop(*args): def on_stop(*args) -> None:
# print("ON STOP")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
# print("not in state")
return return
trace = commands.STATE.trace trace = commands.STATE.trace
if trace is None: if trace is None:
# print("no trace")
return return
state = PROC_STATE[proc] state = PROC_STATE[proc]
state.visited.clear() state.visited.clear()
with commands.STATE.client.batch(): time = update_position()
with trace.client.batch():
with trace.open_tx("Stopped"): with trace.open_tx("Stopped"):
state.record("Stopped") description = util.compute_description(time, "Stopped")
state.record(description, time)
commands.put_event_thread() commands.put_event_thread()
commands.activate() commands.activate()
def on_exited(proc): def update_position() -> Optional[Schedule]:
"""Update the position."""
posobj = util.get_object("State.DebuggerVariables.curthread.TTD.Position")
if posobj is None:
return None
pos = util.pos2split(posobj)
lpos = util.get_last_position()
if lpos is None:
return util.split2schedule(pos)
minpos, maxpos = (lpos, pos) if lpos < pos else (pos, lpos)
evts = list(util.ttd.evttypes.keys())
minidx = bisect_left(evts, minpos)
maxidx = bisect_right(evts, maxpos)
types = set(util.ttd.evttypes[p] for p in evts[minidx:maxidx])
if "modload" in types or "modunload" in types:
on_modules_changed()
if "threadcreated" in types or "threadterm" in types:
on_threads_changed()
util.set_last_position(pos)
return util.split2schedule(pos)
def on_exited(proc) -> None:
# print("ON EXITED") # print("ON EXITED")
if proc not in PROC_STATE: if proc not in PROC_STATE:
# print("not in state") # print("not in state")
@ -400,14 +435,14 @@ def on_exited(proc):
state.visited.clear() state.visited.clear()
exit_code = util.GetExitCode() exit_code = util.GetExitCode()
description = "Exited with code {}".format(exit_code) description = "Exited with code {}".format(exit_code)
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx(description): with trace.open_tx(description):
state.record_exited(exit_code, description) state.record_exited(exit_code, description)
commands.activate() commands.activate()
@log_errors @log_errors
def on_modules_changed(*args): def on_modules_changed(*args) -> None:
# print("ON_MODULES_CHANGED") # print("ON_MODULES_CHANGED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -416,7 +451,7 @@ def on_modules_changed(*args):
return DbgEng.DEBUG_STATUS_GO return DbgEng.DEBUG_STATUS_GO
def on_breakpoint_created(bp): def on_breakpoint_created(bp) -> None:
# print("ON_BREAKPOINT_CREATED") # print("ON_BREAKPOINT_CREATED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -426,15 +461,14 @@ def on_breakpoint_created(bp):
if trace is None: if trace is None:
return return
ibpath = commands.PROC_BREAKS_PATTERN.format(procnum=proc) ibpath = commands.PROC_BREAKS_PATTERN.format(procnum=proc)
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Breakpoint {} created".format(bp.GetId())): with trace.open_tx("Breakpoint {} created".format(bp.GetId())):
ibobj = trace.create_object(ibpath) ibobj = trace.create_object(ibpath)
# Do not use retain_values or it'll remove other locs
commands.put_single_breakpoint(bp, ibobj, proc, []) commands.put_single_breakpoint(bp, ibobj, proc, [])
ibobj.insert() ibobj.insert()
def on_breakpoint_modified(*args): def on_breakpoint_modified(*args) -> None:
# print("BREAKPOINT_MODIFIED") # print("BREAKPOINT_MODIFIED")
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
@ -454,7 +488,7 @@ def on_breakpoint_modified(*args):
return on_breakpoint_created(bp) return on_breakpoint_created(bp)
def on_breakpoint_deleted(bpid): def on_breakpoint_deleted(bpid) -> None:
proc = util.selected_process() proc = util.selected_process()
if proc not in PROC_STATE: if proc not in PROC_STATE:
return return
@ -463,25 +497,25 @@ def on_breakpoint_deleted(bpid):
if trace is None: if trace is None:
return return
bpath = commands.PROC_BREAK_PATTERN.format(procnum=proc, breaknum=bpid) bpath = commands.PROC_BREAK_PATTERN.format(procnum=proc, breaknum=bpid)
with commands.STATE.client.batch(): with trace.client.batch():
with trace.open_tx("Breakpoint {} deleted".format(bpid)): with trace.open_tx("Breakpoint {} deleted".format(bpid)):
trace.proxy_object_path(bpath).remove(tree=True) trace.proxy_object_path(bpath).remove(tree=True)
@log_errors @log_errors
def on_breakpoint_hit(*args): def on_breakpoint_hit(*args) -> None:
# print("ON_BREAKPOINT_HIT: args={}".format(args)) # print("ON_BREAKPOINT_HIT: args={}".format(args))
return DbgEng.DEBUG_STATUS_BREAK return DbgEng.DEBUG_STATUS_BREAK
@log_errors @log_errors
def on_exception(*args): def on_exception(*args) -> None:
# print("ON_EXCEPTION: args={}".format(args)) # print("ON_EXCEPTION: args={}".format(args))
return DbgEng.DEBUG_STATUS_BREAK return DbgEng.DEBUG_STATUS_NO_CHANGE
@util.dbg.eng_thread @util.dbg.eng_thread
def install_hooks(): def install_hooks() -> None:
# print("Installing hooks") # print("Installing hooks")
if HOOK_STATE.installed: if HOOK_STATE.installed:
return return
@ -489,6 +523,23 @@ def install_hooks():
events = util.dbg._base.events events = util.dbg._base.events
if util.is_remote():
events.engine_state(handler=on_state_changed_async)
events.debuggee_state(handler=on_debuggee_changed_async)
events.session_status(handler=on_session_status_changed_async)
events.symbol_state(handler=on_symbol_state_changed_async)
events.system_error(handler=on_system_error_async)
events.create_process(handler=on_new_process_async)
events.exit_process(handler=on_process_deleted_async)
events.create_thread(handler=on_threads_changed_async)
events.exit_thread(handler=on_threads_changed_async)
events.module_load(handler=on_modules_changed_async)
events.unload_module(handler=on_modules_changed_async)
events.breakpoint(handler=on_breakpoint_hit_async)
events.exception(handler=on_exception_async)
else:
events.engine_state(handler=on_state_changed) events.engine_state(handler=on_state_changed)
events.debuggee_state(handler=on_debuggee_changed) events.debuggee_state(handler=on_debuggee_changed)
events.session_status(handler=on_session_status_changed) events.session_status(handler=on_session_status_changed)
@ -507,7 +558,7 @@ def install_hooks():
@util.dbg.eng_thread @util.dbg.eng_thread
def remove_hooks(): def remove_hooks() -> None:
# print("Removing hooks") # print("Removing hooks")
if not HOOK_STATE.installed: if not HOOK_STATE.installed:
return return
@ -515,15 +566,70 @@ def remove_hooks():
util.dbg._base._reset_callbacks() util.dbg._base._reset_callbacks()
def enable_current_process(): def enable_current_process() -> None:
# print("Enable current process") # print("Enable current process")
proc = util.selected_process() proc = util.selected_process()
# print("proc: {}".format(proc)) # print("proc: {}".format(proc))
PROC_STATE[proc] = ProcessState() PROC_STATE[proc] = ProcessState()
def disable_current_process(): def disable_current_process() -> None:
proc = util.selected_process() proc = util.selected_process()
if proc in PROC_STATE: if proc in PROC_STATE:
# Silently ignore already disabled # Silently ignore already disabled
del PROC_STATE[proc] del PROC_STATE[proc]
@log_errors
def on_state_changed_async(*args) -> None:
util.dbg.run_async(on_state_changed, *args)
@log_errors
def on_debuggee_changed_async(*args) -> None:
util.dbg.run_async(on_debuggee_changed, *args)
@log_errors
def on_session_status_changed_async(*args) -> None:
util.dbg.run_async(on_session_status_changed, *args)
@log_errors
def on_symbol_state_changed_async(*args) -> None:
util.dbg.run_async(on_symbol_state_changed, *args)
@log_errors
def on_system_error_async(*args) -> None:
util.dbg.run_async(on_system_error, *args)
@log_errors
def on_new_process_async(*args) -> None:
util.dbg.run_async(on_new_process, *args)
@log_errors
def on_process_deleted_async(*args) -> None:
util.dbg.run_async(on_process_deleted, *args)
@log_errors
def on_threads_changed_async(*args) -> None:
util.dbg.run_async(on_threads_changed, *args)
@log_errors
def on_modules_changed_async(*args) -> None:
util.dbg.run_async(on_modules_changed, *args)
@log_errors
def on_breakpoint_hit_async(*args) -> None:
util.dbg.run_async(on_breakpoint_hit, *args)
@log_errors
def on_exception_async(*args) -> None:
util.dbg.run_async(on_exception, *args)

View file

@ -17,8 +17,8 @@ import ctypes
import os import os
import platform import platform
import comtypes import comtypes # type: ignore
import comtypes.client import comtypes.client # type: ignore
from ghidradbg import dbgmodel from ghidradbg import dbgmodel
@ -26,9 +26,9 @@ ctypes.windll.kernel32.SetErrorMode(0x0001 | 0x0002 | 0x8000)
try: try:
from comtypes.gen import DbgMod from comtypes.gen import DbgMod # type: ignore
except: except:
tlb = os.path.join(dbgmodel.module_locator(), 'tlb', 'dbgmodel.tlb') tlb = os.path.join(dbgmodel.module_locator(), 'tlb', 'dbgmodel.tlb')
print(f"Loading TLB: {tlb}") print(f"Loading TLB: {tlb}")
comtypes.client.GetModule(tlb) comtypes.client.GetModule(tlb)
from comtypes.gen import DbgMod from comtypes.gen import DbgMod # type: ignore

View file

@ -18,11 +18,13 @@ from contextlib import redirect_stdout
from io import StringIO from io import StringIO
import re import re
import sys import sys
from typing import Annotated, Any, Dict, Optional
from ghidratrace import sch from ghidratrace import sch
from ghidratrace.client import MethodRegistry, ParamDesc, Address, AddressRange from ghidratrace.client import (MethodRegistry, ParamDesc, Address,
from pybag import pydbg AddressRange, Schedule, TraceObject)
from pybag.dbgeng import core as DbgEng, exception from pybag import pydbg # type: ignore
from pybag.dbgeng import core as DbgEng, exception # type: ignore
from . import util, commands from . import util, commands
@ -31,32 +33,43 @@ REGISTRY = MethodRegistry(ThreadPoolExecutor(
max_workers=1, thread_name_prefix='MethodRegistry')) max_workers=1, thread_name_prefix='MethodRegistry'))
def extre(base, ext): def extre(base: re.Pattern, ext: str) -> re.Pattern:
return re.compile(base.pattern + ext) return re.compile(base.pattern + ext)
AVAILABLE_PATTERN = re.compile('Available\[(?P<pid>\\d*)\]') WATCHPOINT_PATTERN = re.compile('Watchpoints\\[(?P<watchnum>\\d*)\\]')
WATCHPOINT_PATTERN = re.compile('Watchpoints\[(?P<watchnum>\\d*)\]') BREAKPOINT_PATTERN = re.compile('Breakpoints\\[(?P<breaknum>\\d*)\\]')
BREAKPOINT_PATTERN = re.compile('Breakpoints\[(?P<breaknum>\\d*)\]') BREAK_LOC_PATTERN = extre(BREAKPOINT_PATTERN, '\\[(?P<locnum>\\d*)\\]')
BREAK_LOC_PATTERN = extre(BREAKPOINT_PATTERN, '\[(?P<locnum>\\d*)\]')
SESSIONS_PATTERN = re.compile('Sessions') SESSIONS_PATTERN = re.compile('Sessions')
SESSION_PATTERN = extre(SESSIONS_PATTERN, '\[(?P<snum>\\d*)\]') SESSION_PATTERN = extre(SESSIONS_PATTERN, '\\[(?P<snum>\\d*)\\]')
PROCESSES_PATTERN = extre(SESSION_PATTERN, '\.Processes') AVAILABLE_PATTERN = extre(SESSION_PATTERN, '\\.Available\\[(?P<pid>\\d*)\\]')
PROCESS_PATTERN = extre(PROCESSES_PATTERN, '\[(?P<procnum>\\d*)\]') PROCESSES_PATTERN = extre(SESSION_PATTERN, '\\.Processes')
PROC_BREAKS_PATTERN = extre(PROCESS_PATTERN, '\.Debug.Breakpoints') PROCESS_PATTERN = extre(PROCESSES_PATTERN, '\\[(?P<procnum>\\d*)\\]')
PROC_BREAKBPT_PATTERN = extre(PROC_BREAKS_PATTERN, '\[(?P<breaknum>\\d*)\]') PROC_DEBUG_PATTERN = extre(PROCESS_PATTERN, '.Debug')
ENV_PATTERN = extre(PROCESS_PATTERN, '\.Environment') PROC_BREAKS_PATTERN = extre(PROC_DEBUG_PATTERN, '\\.Breakpoints')
THREADS_PATTERN = extre(PROCESS_PATTERN, '\.Threads') PROC_BREAKBPT_PATTERN = extre(PROC_BREAKS_PATTERN, '\\[(?P<breaknum>\\d*)\\]')
THREAD_PATTERN = extre(THREADS_PATTERN, '\[(?P<tnum>\\d*)\]') ENV_PATTERN = extre(PROCESS_PATTERN, '\\.Environment')
STACK_PATTERN = extre(THREAD_PATTERN, '\.Stack.Frames') THREADS_PATTERN = extre(PROCESS_PATTERN, '\\.Threads')
FRAME_PATTERN = extre(STACK_PATTERN, '\[(?P<level>\\d*)\]') THREAD_PATTERN = extre(THREADS_PATTERN, '\\[(?P<tnum>\\d*)\\]')
REGS_PATTERN0 = extre(THREAD_PATTERN, '.Registers') STACK_PATTERN = extre(THREAD_PATTERN, '\\.Stack.Frames')
REGS_PATTERN = extre(FRAME_PATTERN, '.Registers') FRAME_PATTERN = extre(STACK_PATTERN, '\\[(?P<level>\\d*)\\]')
MEMORY_PATTERN = extre(PROCESS_PATTERN, '\.Memory') REGS_PATTERN0 = extre(THREAD_PATTERN, '\\.Registers')
MODULES_PATTERN = extre(PROCESS_PATTERN, '\.Modules') REGS_PATTERN = extre(FRAME_PATTERN, '\\.Registers')
MEMORY_PATTERN = extre(PROCESS_PATTERN, '\\.Memory')
MODULES_PATTERN = extre(PROCESS_PATTERN, '\\.Modules')
PROC_EVENTS_PATTERN = extre(PROC_DEBUG_PATTERN, '\\.Events')
PROC_EVENT_PATTERN = extre(PROC_EVENTS_PATTERN, '\\[(?P<eventnum>\\d*)\\]')
PROC_EVENT_CONT_PATTERN = extre(PROC_EVENT_PATTERN, '.Cont')
PROC_EVENT_EXEC_PATTERN = extre(PROC_EVENT_PATTERN, '.Exec')
PROC_EXCEPTIONS_PATTERN = extre(PROC_DEBUG_PATTERN, '\\.Exceptions')
PROC_EXCEPTION_PATTERN = extre(
PROC_EXCEPTIONS_PATTERN, '\\[(?P<excnum>\\d*)\\]')
PROC_EXCEPTION_CONT_PATTERN = extre(PROC_EXCEPTION_PATTERN, '.Cont')
PROC_EXCEPTION_EXEC_PATTERN = extre(PROC_EXCEPTION_PATTERN, '.Exec')
def find_availpid_by_pattern(pattern, object, err_msg): def find_availpid_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> int:
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
if mat is None: if mat is None:
raise TypeError(f"{object} is not {err_msg}") raise TypeError(f"{object} is not {err_msg}")
@ -64,17 +77,18 @@ def find_availpid_by_pattern(pattern, object, err_msg):
return pid return pid
def find_availpid_by_obj(object): def find_availpid_by_obj(object: TraceObject) -> int:
return find_availpid_by_pattern(AVAILABLE_PATTERN, object, "an Available") return find_availpid_by_pattern(AVAILABLE_PATTERN, object, "an Attachable")
def find_proc_by_num(id): def find_proc_by_num(id: int) -> int:
if id != util.selected_process(): if id != util.selected_process():
util.select_process(id) util.select_process(id)
return util.selected_process() return util.selected_process()
def find_proc_by_pattern(object, pattern, err_msg): def find_proc_by_pattern(object: TraceObject, pattern: re.Pattern,
err_msg: str) -> int:
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
if mat is None: if mat is None:
raise TypeError(f"{object} is not {err_msg}") raise TypeError(f"{object} is not {err_msg}")
@ -82,43 +96,39 @@ def find_proc_by_pattern(object, pattern, err_msg):
return find_proc_by_num(procnum) return find_proc_by_num(procnum)
def find_proc_by_obj(object): def find_proc_by_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, PROCESS_PATTERN, "an Process") return find_proc_by_pattern(object, PROCESS_PATTERN, "an Process")
def find_proc_by_procbreak_obj(object): def find_proc_by_procbreak_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, PROC_BREAKS_PATTERN, return find_proc_by_pattern(object, PROC_BREAKS_PATTERN,
"a BreakpointLocationContainer") "a BreakpointLocationContainer")
def find_proc_by_procwatch_obj(object): def find_proc_by_env_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, PROC_WATCHES_PATTERN,
"a WatchpointContainer")
def find_proc_by_env_obj(object):
return find_proc_by_pattern(object, ENV_PATTERN, "an Environment") return find_proc_by_pattern(object, ENV_PATTERN, "an Environment")
def find_proc_by_threads_obj(object): def find_proc_by_threads_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, THREADS_PATTERN, "a ThreadContainer") return find_proc_by_pattern(object, THREADS_PATTERN, "a ThreadContainer")
def find_proc_by_mem_obj(object): def find_proc_by_mem_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, MEMORY_PATTERN, "a Memory") return find_proc_by_pattern(object, MEMORY_PATTERN, "a Memory")
def find_proc_by_modules_obj(object): def find_proc_by_modules_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, MODULES_PATTERN, "a ModuleContainer") return find_proc_by_pattern(object, MODULES_PATTERN, "a ModuleContainer")
def find_thread_by_num(id): def find_thread_by_num(id: int) -> Optional[int]:
if id != util.selected_thread(): if id != util.selected_thread():
util.select_thread(id) util.select_thread(id)
return util.selected_thread() return util.selected_thread()
def find_thread_by_pattern(pattern, object, err_msg): def find_thread_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> Optional[int]:
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
if mat is None: if mat is None:
raise TypeError(f"{object} is not {err_msg}") raise TypeError(f"{object} is not {err_msg}")
@ -128,27 +138,29 @@ def find_thread_by_pattern(pattern, object, err_msg):
return find_thread_by_num(tnum) return find_thread_by_num(tnum)
def find_thread_by_obj(object): def find_thread_by_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(THREAD_PATTERN, object, "a Thread") return find_thread_by_pattern(THREAD_PATTERN, object, "a Thread")
def find_thread_by_stack_obj(object): def find_thread_by_stack_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(STACK_PATTERN, object, "a Stack") return find_thread_by_pattern(STACK_PATTERN, object, "a Stack")
def find_thread_by_regs_obj(object): def find_thread_by_regs_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(REGS_PATTERN0, object, "a RegisterValueContainer") return find_thread_by_pattern(REGS_PATTERN0, object,
"a RegisterValueContainer")
@util.dbg.eng_thread @util.dbg.eng_thread
def find_frame_by_level(level): def find_frame_by_level(level: int) -> DbgEng._DEBUG_STACK_FRAME:
for f in util.dbg._base.backtrace_list(): for f in util.dbg._base.backtrace_list():
if f.FrameNumber == level: if f.FrameNumber == level:
return f return f
# return dbg().backtrace_list()[level] # return dbg().backtrace_list()[level]
def find_frame_by_pattern(pattern, object, err_msg): def find_frame_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> DbgEng._DEBUG_STACK_FRAME:
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
if mat is None: if mat is None:
raise TypeError(f"{object} is not {err_msg}") raise TypeError(f"{object} is not {err_msg}")
@ -160,11 +172,11 @@ def find_frame_by_pattern(pattern, object, err_msg):
return find_frame_by_level(level) return find_frame_by_level(level)
def find_frame_by_obj(object): def find_frame_by_obj(object: TraceObject) -> DbgEng._DEBUG_STACK_FRAME:
return find_frame_by_pattern(FRAME_PATTERN, object, "a StackFrame") return find_frame_by_pattern(FRAME_PATTERN, object, "a StackFrame")
def find_bpt_by_number(breaknum): def find_bpt_by_number(breaknum: int) -> DbgEng.IDebugBreakpoint:
try: try:
bp = dbg()._control.GetBreakpointById(breaknum) bp = dbg()._control.GetBreakpointById(breaknum)
return bp return bp
@ -172,7 +184,8 @@ def find_bpt_by_number(breaknum):
raise KeyError(f"Breakpoints[{breaknum}] does not exist") raise KeyError(f"Breakpoints[{breaknum}] does not exist")
def find_bpt_by_pattern(pattern, object, err_msg): def find_bpt_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> DbgEng.IDebugBreakpoint:
mat = pattern.fullmatch(object.path) mat = pattern.fullmatch(object.path)
if mat is None: if mat is None:
raise TypeError(f"{object} is not {err_msg}") raise TypeError(f"{object} is not {err_msg}")
@ -180,14 +193,143 @@ def find_bpt_by_pattern(pattern, object, err_msg):
return find_bpt_by_number(breaknum) return find_bpt_by_number(breaknum)
def find_bpt_by_obj(object): def find_bpt_by_obj(object: TraceObject) -> DbgEng.IDebugBreakpoint:
return find_bpt_by_pattern(PROC_BREAKBPT_PATTERN, object, "a BreakpointSpec") return find_bpt_by_pattern(PROC_BREAKBPT_PATTERN, object, "a BreakpointSpec")
shared_globals = dict() def find_evt_by_number(eventnum: int) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
try:
return util.GetSpecificFilterParameters(eventnum, 1)
except exception.E_NOINTERFACE_Error:
raise KeyError(f"Events[{eventnum}] does not exist")
@REGISTRY.method def find_evt_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
eventnum = int(mat['eventnum'])
return (eventnum, find_evt_by_number(eventnum))
def find_evt_cont_by_obj(object: TraceObject) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
return find_evt_by_pattern(PROC_EVENT_CONT_PATTERN, object, "as Event")
def find_evt_exec_by_obj(object: TraceObject) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
return find_evt_by_pattern(PROC_EVENT_EXEC_PATTERN, object, "as Event")
def find_exc_by_number(excnum: int) -> DbgEng._DEBUG_EXCEPTION_FILTER_PARAMETERS:
try:
(n_events, n_spec_exc, n_arb_exc) = util.GetNumberEventFilters()
return util.GetExceptionFilterParameters(n_events + excnum, None, 1)
except exception.E_NOINTERFACE_Error:
raise KeyError(f"Events[{excnum}] does not exist")
def find_exc_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> DbgEng._DEBUG_EXCEPTION_FILTER_PARAMETERS:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
excnum = int(mat['excnum'])
return (excnum, find_exc_by_number(excnum))
def find_exc_cont_by_obj(object: TraceObject) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
return find_exc_by_pattern(PROC_EXCEPTION_CONT_PATTERN, object, "as Exception")
def find_exc_exec_by_obj(object: TraceObject) -> DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS:
return find_exc_by_pattern(PROC_EXCEPTION_EXEC_PATTERN, object, "as Exception")
shared_globals: Dict[str, Any] = dict()
class Session(TraceObject):
pass
class AvailableContainer(TraceObject):
pass
class BreakpointContainer(TraceObject):
pass
class ProcessContainer(TraceObject):
pass
class Environment(TraceObject):
pass
class ThreadContainer(TraceObject):
pass
class Stack(TraceObject):
pass
class RegisterValueContainer(TraceObject):
pass
class Memory(TraceObject):
pass
class ModuleContainer(TraceObject):
pass
class State(TraceObject):
pass
class Process(TraceObject):
pass
class Thread(TraceObject):
pass
class StackFrame(TraceObject):
pass
class Attachable(TraceObject):
pass
class BreakpointSpec(TraceObject):
pass
class EventContainer(TraceObject):
pass
class ExceptionContainer(TraceObject):
pass
class ContinueOption(TraceObject):
pass
class ExecutionOption(TraceObject):
pass
@REGISTRY.method()
# @util.dbg.eng_thread # @util.dbg.eng_thread
def execute(cmd: str, to_string: bool = False): def execute(cmd: str, to_string: bool = False):
"""Execute a Python3 command or script.""" """Execute a Python3 command or script."""
@ -206,59 +348,110 @@ def execute(cmd: str, to_string: bool=False):
@REGISTRY.method(action='evaluate', display='Evaluate') @REGISTRY.method(action='evaluate', display='Evaluate')
# @util.dbg.eng_thread # @util.dbg.eng_thread
def evaluate( def evaluate(
session: sch.Schema('Session'), session: Session,
expr: ParamDesc(str, display='Expr')): expr: Annotated[str, ParamDesc(display='Expr')]) -> str:
"""Evaluate a Python3 expression.""" """Evaluate a Python3 expression."""
return str(eval(expr, shared_globals)) return str(eval(expr, shared_globals))
@REGISTRY.method(action='refresh', display="Refresh", condition=util.dbg.use_generics) @REGISTRY.method(action='refresh', display="Refresh",
def refresh_generic(node: sch.OBJECT): condition=util.dbg.use_generics)
"""List processes on pydbg's host system.""" def refresh_generic(node: TraceObject) -> None:
"""List the children for a generic node."""
with commands.open_tracked_tx('Refresh Generic'): with commands.open_tracked_tx('Refresh Generic'):
commands.ghidra_trace_put_generic(node) commands.ghidra_trace_put_generic(node)
@REGISTRY.method(action='refresh', display='Refresh Available') @REGISTRY.method(action='refresh', display='Refresh Available')
def refresh_available(node: sch.Schema('AvailableContainer')): def refresh_available(node: AvailableContainer) -> None:
"""List processes on pydbg's host system.""" """List processes on pydbg's host system."""
with commands.open_tracked_tx('Refresh Available'): with commands.open_tracked_tx('Refresh Available'):
commands.ghidra_trace_put_available() commands.ghidra_trace_put_available()
@REGISTRY.method(action='refresh', display='Refresh Breakpoints') @REGISTRY.method(action='refresh', display='Refresh Breakpoints')
def refresh_breakpoints(node: sch.Schema('BreakpointContainer')): def refresh_breakpoints(node: BreakpointContainer) -> None:
""" """Refresh the list of breakpoints (including locations for the current
Refresh the list of breakpoints (including locations for the current process)."""
process).
"""
with commands.open_tracked_tx('Refresh Breakpoints'): with commands.open_tracked_tx('Refresh Breakpoints'):
commands.ghidra_trace_put_breakpoints() commands.ghidra_trace_put_breakpoints()
@REGISTRY.method(action='refresh', display='Refresh Events')
def refresh_events(node: EventContainer) -> None:
"""
Refresh the list of control events.
"""
with commands.open_tracked_tx('Refresh Events'):
commands.ghidra_trace_put_events()
@REGISTRY.method(action='refresh', display='Refresh Exceptions')
def refresh_exceptions(node: ExceptionContainer) -> None:
"""
Refresh the list of exceptions.
"""
with commands.open_tracked_tx('Refresh Exceptions'):
commands.ghidra_trace_put_exceptions()
@REGISTRY.method(action='toggle', display='Toggle Execution Option')
def toggle_exec(node: ExecutionOption, enabled: bool) -> None:
"""
Toggle the execution option
"""
if "Events" in str(node):
(n, events) = find_evt_exec_by_obj(node)
with commands.open_tracked_tx('Toggle Execution Option'):
commands.toggle_evt_exec_option(n, events)
commands.ghidra_trace_put_events()
elif "Exceptions" in str(node):
(n, events) = find_exc_exec_by_obj(node)
with commands.open_tracked_tx('Toggle Execution Option'):
commands.toggle_exc_exec_option(n, events)
commands.ghidra_trace_put_exceptions()
@REGISTRY.method(action='toggle', display='Toggle Continue Option')
def toggle_cont(node: ContinueOption, enabled: bool) -> None:
"""
Toggle the execution option
"""
if "Events" in str(node):
(n, events) = find_evt_cont_by_obj(node)
with commands.open_tracked_tx('Toggle Execution Option'):
commands.toggle_evt_cont_option(n, events)
commands.ghidra_trace_put_events()
elif "Exceptions" in str(node):
(n, events) = find_exc_cont_by_obj(node)
with commands.open_tracked_tx('Toggle Execution Option'):
commands.toggle_exc_cont_option(n, events)
commands.ghidra_trace_put_exceptions()
@REGISTRY.method(action='refresh', display='Refresh Processes') @REGISTRY.method(action='refresh', display='Refresh Processes')
def refresh_processes(node: sch.Schema('ProcessContainer')): def refresh_processes(node: ProcessContainer) -> None:
"""Refresh the list of processes.""" """Refresh the list of processes."""
with commands.open_tracked_tx('Refresh Processes'): with commands.open_tracked_tx('Refresh Processes'):
commands.ghidra_trace_put_processes() commands.ghidra_trace_put_processes()
@REGISTRY.method(action='refresh', display='Refresh Environment') @REGISTRY.method(action='refresh', display='Refresh Environment')
def refresh_environment(node: sch.Schema('Environment')): def refresh_environment(node: Environment) -> None:
"""Refresh the environment descriptors (arch, os, endian).""" """Refresh the environment descriptors (arch, os, endian)."""
with commands.open_tracked_tx('Refresh Environment'): with commands.open_tracked_tx('Refresh Environment'):
commands.ghidra_trace_put_environment() commands.ghidra_trace_put_environment()
@REGISTRY.method(action='refresh', display='Refresh Threads') @REGISTRY.method(action='refresh', display='Refresh Threads')
def refresh_threads(node: sch.Schema('ThreadContainer')): def refresh_threads(node: ThreadContainer) -> None:
"""Refresh the list of threads in the process.""" """Refresh the list of threads in the process."""
with commands.open_tracked_tx('Refresh Threads'): with commands.open_tracked_tx('Refresh Threads'):
commands.ghidra_trace_put_threads() commands.ghidra_trace_put_threads()
@REGISTRY.method(action='refresh', display='Refresh Stack') @REGISTRY.method(action='refresh', display='Refresh Stack')
def refresh_stack(node: sch.Schema('Stack')): def refresh_stack(node: Stack) -> None:
"""Refresh the backtrace for the thread.""" """Refresh the backtrace for the thread."""
tnum = find_thread_by_stack_obj(node) tnum = find_thread_by_stack_obj(node)
util.reset_frames() util.reset_frames()
@ -269,46 +462,69 @@ def refresh_stack(node: sch.Schema('Stack')):
@REGISTRY.method(action='refresh', display='Refresh Registers') @REGISTRY.method(action='refresh', display='Refresh Registers')
def refresh_registers(node: sch.Schema('RegisterValueContainer')): def refresh_registers(node: RegisterValueContainer) -> None:
"""Refresh the register values for the selected frame""" """Refresh the register values for the selected frame."""
tnum = find_thread_by_regs_obj(node) tnum = find_thread_by_regs_obj(node)
with commands.open_tracked_tx('Refresh Registers'): with commands.open_tracked_tx('Refresh Registers'):
commands.ghidra_trace_putreg() commands.ghidra_trace_putreg()
@REGISTRY.method(action='refresh', display='Refresh Memory') @REGISTRY.method(action='refresh', display='Refresh Memory')
def refresh_mappings(node: sch.Schema('Memory')): def refresh_mappings(node: Memory) -> None:
"""Refresh the list of memory regions for the process.""" """Refresh the list of memory regions for the process."""
with commands.open_tracked_tx('Refresh Memory Regions'): with commands.open_tracked_tx('Refresh Memory Regions'):
commands.ghidra_trace_put_regions() commands.ghidra_trace_put_regions()
@REGISTRY.method(action='refresh', display='Refresh Modules') @REGISTRY.method(action='refresh', display='Refresh Modules')
def refresh_modules(node: sch.Schema('ModuleContainer')): def refresh_modules(node: ModuleContainer) -> None:
""" """Refresh the modules and sections list for the process.
Refresh the modules and sections list for the process.
This will refresh the sections for all modules, not just the selected one. This will refresh the sections for all modules, not just the
selected one.
""" """
with commands.open_tracked_tx('Refresh Modules'): with commands.open_tracked_tx('Refresh Modules'):
commands.ghidra_trace_put_modules() commands.ghidra_trace_put_modules()
@REGISTRY.method(action='refresh', display='Refresh Events')
def refresh_trace_events(node: State) -> None:
"""
Refresh the events list for a trace.
"""
with commands.open_tracked_tx('Refresh Events'):
commands.ghidra_trace_put_trace_events()
@util.dbg.eng_thread
def do_maybe_activate_time(time: Optional[str]) -> None:
if time is not None:
sch: Schedule = Schedule.parse(time)
dbg().cmd(f"!tt " + util.schedule2ss(sch), quiet=False)
dbg().wait()
@REGISTRY.method(action='activate') @REGISTRY.method(action='activate')
def activate_process(process: sch.Schema('Process')): def activate_process(process: Process,
time: Optional[str] = None) -> None:
"""Switch to the process.""" """Switch to the process."""
do_maybe_activate_time(time)
find_proc_by_obj(process) find_proc_by_obj(process)
@REGISTRY.method(action='activate') @REGISTRY.method(action='activate')
def activate_thread(thread: sch.Schema('Thread')): def activate_thread(thread: Thread,
time: Optional[str] = None) -> None:
"""Switch to the thread.""" """Switch to the thread."""
do_maybe_activate_time(time)
find_thread_by_obj(thread) find_thread_by_obj(thread)
@REGISTRY.method(action='activate') @REGISTRY.method(action='activate')
def activate_frame(frame: sch.Schema('StackFrame')): def activate_frame(frame: StackFrame,
time: Optional[str] = None) -> None:
"""Select the frame.""" """Select the frame."""
do_maybe_activate_time(time)
f = find_frame_by_obj(frame) f = find_frame_by_obj(frame)
util.select_frame(f.FrameNumber) util.select_frame(f.FrameNumber)
with commands.open_tracked_tx('Refresh Stack'): with commands.open_tracked_tx('Refresh Stack'):
@ -319,7 +535,7 @@ def activate_frame(frame: sch.Schema('StackFrame')):
@REGISTRY.method(action='delete') @REGISTRY.method(action='delete')
@util.dbg.eng_thread @util.dbg.eng_thread
def remove_process(process: sch.Schema('Process')): def remove_process(process: Process) -> None:
"""Remove the process.""" """Remove the process."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().detach_proc() dbg().detach_proc()
@ -328,15 +544,15 @@ def remove_process(process: sch.Schema('Process')):
@REGISTRY.method(action='connect', display='Connect') @REGISTRY.method(action='connect', display='Connect')
@util.dbg.eng_thread @util.dbg.eng_thread
def target( def target(
session: sch.Schema('Session'), session: Session,
cmd: ParamDesc(str, display='Command')): cmd: Annotated[str, ParamDesc(display='Command')]) -> None:
"""Connect to a target machine or process.""" """Connect to a target machine or process."""
dbg().attach_kernel(cmd) dbg().attach_kernel(cmd)
@REGISTRY.method(action='attach', display='Attach') @REGISTRY.method(action='attach', display='Attach')
@util.dbg.eng_thread @util.dbg.eng_thread
def attach_obj(target: sch.Schema('Attachable')): def attach_obj(target: Attachable) -> None:
"""Attach the process to the given target.""" """Attach the process to the given target."""
pid = find_availpid_by_obj(target) pid = find_availpid_by_obj(target)
dbg().attach_proc(pid) dbg().attach_proc(pid)
@ -345,74 +561,90 @@ def attach_obj(target: sch.Schema('Attachable')):
@REGISTRY.method(action='attach', display='Attach by pid') @REGISTRY.method(action='attach', display='Attach by pid')
@util.dbg.eng_thread @util.dbg.eng_thread
def attach_pid( def attach_pid(
session: sch.Schema('Session'), session: Session,
pid: ParamDesc(str, display='PID')): pid: Annotated[int, ParamDesc(display='PID')]) -> None:
"""Attach the process to the given target.""" """Attach the process to the given target."""
dbg().attach_proc(int(pid)) dbg().attach_proc(pid)
@REGISTRY.method(action='attach', display='Attach by name') @REGISTRY.method(action='attach', display='Attach by name')
@util.dbg.eng_thread @util.dbg.eng_thread
def attach_name( def attach_name(
session: sch.Schema('Session'), session: Session,
name: ParamDesc(str, display='Name')): name: Annotated[str, ParamDesc(display='Name')]) -> None:
"""Attach the process to the given target.""" """Attach the process to the given target."""
dbg().attach_proc(name) dbg().attach_proc(name)
@REGISTRY.method(action='detach', display='Detach') @REGISTRY.method(action='detach', display='Detach')
@util.dbg.eng_thread @util.dbg.eng_thread
def detach(process: sch.Schema('Process')): def detach(process: Process) -> None:
"""Detach the process's target.""" """Detach the process's target."""
dbg().detach_proc() dbg().detach_proc()
@REGISTRY.method(action='launch', display='Launch') @REGISTRY.method(action='launch', display='Launch')
def launch_loader( def launch_loader(
session: sch.Schema('Session'), session: Session,
file: ParamDesc(str, display='File'), file: Annotated[str, ParamDesc(display='File')],
args: ParamDesc(str, display='Arguments')=''): args: Annotated[str, ParamDesc(display='Arguments')] = '',
""" timeout: Annotated[int, ParamDesc(display='Timeout')] = -1,
Start a native process with the given command line, stopping at the ntdll initial breakpoint. wait: Annotated[bool, ParamDesc(
""" display='Wait',
description='Perform the initial WaitForEvents')] = False) -> None:
"""Start a native process with the given command line, stopping at the
ntdll initial breakpoint."""
command = file command = file
if args != None: if args != None:
command += " " + args command += " " + args
commands.ghidra_trace_create(command=file, start_trace=False) commands.ghidra_trace_create(command=command, start_trace=False,
timeout=timeout, wait=wait)
@REGISTRY.method(action='launch', display='LaunchEx') @REGISTRY.method(action='launch', display='LaunchEx')
def launch( def launch(
session: sch.Schema('Session'), session: Session,
file: ParamDesc(str, display='File'), file: Annotated[str, ParamDesc(display='File')],
args: ParamDesc(str, display='Arguments')='', args: Annotated[str, ParamDesc(display='Arguments')] = '',
initial_break: ParamDesc(bool, display='Initial Break')=True, initial_break: Annotated[bool, ParamDesc(
timeout: ParamDesc(int, display='Timeout')=-1): display='Initial Break')] = True,
""" timeout: Annotated[int, ParamDesc(display='Timeout')] = -1,
Run a native process with the given command line. wait: Annotated[bool, ParamDesc(
""" display='Wait',
description='Perform the initial WaitForEvents')] = False) -> None:
"""Run a native process with the given command line."""
command = file command = file
if args != None: if args != None:
command += " " + args command += " " + args
commands.ghidra_trace_create( commands.ghidra_trace_create(command=command, start_trace=False,
command, initial_break=initial_break, timeout=timeout, start_trace=False) initial_break=initial_break,
timeout=timeout, wait=wait)
@REGISTRY.method @REGISTRY.method()
@util.dbg.eng_thread @util.dbg.eng_thread
def kill(process: sch.Schema('Process')): def kill(process: Process) -> None:
"""Kill execution of the process.""" """Kill execution of the process."""
commands.ghidra_trace_kill() commands.ghidra_trace_kill()
@REGISTRY.method(action='resume') @REGISTRY.method(action='resume', display="Go")
def go(process: sch.Schema('Process')): def go(process: Process) -> None:
"""Continue execution of the process.""" """Continue execution of the process."""
util.dbg.run_async(lambda: dbg().go()) util.dbg.run_async(lambda: dbg().go())
@REGISTRY.method @REGISTRY.method(action='step_ext', display='Go (backwards)',
def interrupt(process: sch.Schema('Process')): icon='icon.debugger.resume.back', condition=util.dbg.IS_TRACE)
@util.dbg.eng_thread
def go_back(process: Process) -> None:
"""Continue execution of the process backwards."""
dbg().cmd("g-")
dbg().wait()
@REGISTRY.method()
def interrupt(process: Process) -> None:
"""Interrupt the execution of the debugged program.""" """Interrupt the execution of the debugged program."""
# SetInterrupt is reentrant, so bypass the thread checks # SetInterrupt is reentrant, so bypass the thread checks
util.dbg._protected_base._control.SetInterrupt( util.dbg._protected_base._control.SetInterrupt(
@ -420,45 +652,80 @@ def interrupt(process: sch.Schema('Process')):
@REGISTRY.method(action='step_into') @REGISTRY.method(action='step_into')
def step_into(thread: sch.Schema('Thread'), n: ParamDesc(int, display='N')=1): def step_into(thread: Thread,
n: Annotated[int, ParamDesc(display='N')] = 1) -> None:
"""Step one instruction exactly.""" """Step one instruction exactly."""
find_thread_by_obj(thread) find_thread_by_obj(thread)
util.dbg.run_async(lambda: dbg().stepi(n)) util.dbg.run_async(lambda: dbg().stepi(n))
@REGISTRY.method(action='step_over') @REGISTRY.method(action='step_over')
def step_over(thread: sch.Schema('Thread'), n: ParamDesc(int, display='N')=1): def step_over(thread: Thread,
n: Annotated[int, ParamDesc(display='N')] = 1) -> None:
"""Step one instruction, but proceed through subroutine calls.""" """Step one instruction, but proceed through subroutine calls."""
find_thread_by_obj(thread) find_thread_by_obj(thread)
util.dbg.run_async(lambda: dbg().stepo(n)) util.dbg.run_async(lambda: dbg().stepo(n))
@REGISTRY.method(action='step_ext', display='Step Into (backwards)',
icon='icon.debugger.step.back.into',
condition=util.dbg.IS_TRACE)
@util.dbg.eng_thread
def step_back_into(thread: Thread,
n: Annotated[int, ParamDesc(display='N')] = 1) -> None:
"""Step one instruction backward exactly."""
dbg().cmd("t- " + str(n))
dbg().wait()
@REGISTRY.method(action='step_ext', display='Step Over (backwards)',
icon='icon.debugger.step.back.over',
condition=util.dbg.IS_TRACE)
@util.dbg.eng_thread
def step_back_over(thread: Thread,
n: Annotated[int, ParamDesc(display='N')] = 1) -> None:
"""Step one instruction backward, but proceed through subroutine calls."""
dbg().cmd("p- " + str(n))
dbg().wait()
@REGISTRY.method(action='step_out') @REGISTRY.method(action='step_out')
def step_out(thread: sch.Schema('Thread')): def step_out(thread: Thread) -> None:
"""Execute until the current stack frame returns.""" """Execute until the current stack frame returns."""
find_thread_by_obj(thread) find_thread_by_obj(thread)
util.dbg.run_async(lambda: dbg().stepout()) util.dbg.run_async(lambda: dbg().stepout())
@REGISTRY.method(action='step_to', display='Step To') @REGISTRY.method(action='step_to', display='Step To')
def step_to(thread: sch.Schema('Thread'), address: Address, max=None): def step_to(thread: Thread, address: Address,
max: Optional[int] = None) -> None:
"""Continue execution up to the given address.""" """Continue execution up to the given address."""
find_thread_by_obj(thread) find_thread_by_obj(thread)
# TODO: The address may need mapping. # TODO: The address may need mapping.
util.dbg.run_async(lambda: dbg().stepto(address.offset, max)) util.dbg.run_async(lambda: dbg().stepto(address.offset, max))
@REGISTRY.method(action='go_to_time', display='Go To (event)',
condition=util.dbg.IS_TRACE)
@util.dbg.eng_thread
def go_to_time(node: State,
evt: Annotated[str, ParamDesc(display='Event')]) -> None:
"""Reset the trace to a specific time."""
dbg().cmd("!tt " + evt)
dbg().wait()
@REGISTRY.method(action='break_sw_execute') @REGISTRY.method(action='break_sw_execute')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_address(process: sch.Schema('Process'), address: Address): def break_address(process: Process, address: Address) -> None:
"""Set a breakpoint.""" """Set a breakpoint."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().bp(expr=address.offset) dbg().bp(expr=address.offset)
@REGISTRY.method(action='break_sw_execute') @REGISTRY.method(action='break_ext', display='Set Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_expression(expression: str): def break_expression(expression: str) -> None:
"""Set a breakpoint.""" """Set a breakpoint."""
# TODO: Escape? # TODO: Escape?
dbg().bp(expr=expression) dbg().bp(expr=expression)
@ -466,68 +733,71 @@ def break_expression(expression: str):
@REGISTRY.method(action='break_hw_execute') @REGISTRY.method(action='break_hw_execute')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_hw_address(process: sch.Schema('Process'), address: Address): def break_hw_address(process: Process, address: Address) -> None:
"""Set a hardware-assisted breakpoint.""" """Set a hardware-assisted breakpoint."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().ba(expr=address.offset) dbg().ba(expr=address.offset)
@REGISTRY.method(action='break_hw_execute') @REGISTRY.method(action='break_ext', display='Set Hardware Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_hw_expression(expression: str): def break_hw_expression(expression: str) -> None:
"""Set a hardware-assisted breakpoint.""" """Set a hardware-assisted breakpoint."""
dbg().ba(expr=expression) dbg().ba(expr=expression)
@REGISTRY.method(action='break_read') @REGISTRY.method(action='break_read')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_read_range(process: sch.Schema('Process'), range: AddressRange): def break_read_range(process: Process, range: AddressRange) -> None:
"""Set a read watchpoint.""" """Set a read breakpoint."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().ba(expr=range.min, size=range.length(), access=DbgEng.DEBUG_BREAK_READ) dbg().ba(expr=range.min, size=range.length(),
access=DbgEng.DEBUG_BREAK_READ)
@REGISTRY.method(action='break_read') @REGISTRY.method(action='break_ext', display='Set Read Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_read_expression(expression: str): def break_read_expression(expression: str) -> None:
"""Set a read watchpoint.""" """Set a read breakpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_READ) dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_READ)
@REGISTRY.method(action='break_write') @REGISTRY.method(action='break_write')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_write_range(process: sch.Schema('Process'), range: AddressRange): def break_write_range(process: Process, range: AddressRange) -> None:
"""Set a watchpoint.""" """Set a write breakpoint."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().ba(expr=range.min, size=range.length(), access=DbgEng.DEBUG_BREAK_WRITE) dbg().ba(expr=range.min, size=range.length(),
access=DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='break_write') @REGISTRY.method(action='break_ext', display='Set Write Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_write_expression(expression: str): def break_write_expression(expression: str) -> None:
"""Set a watchpoint.""" """Set a write breakpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_WRITE) dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='break_access') @REGISTRY.method(action='break_access')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_access_range(process: sch.Schema('Process'), range: AddressRange): def break_access_range(process: Process, range: AddressRange) -> None:
"""Set an access watchpoint.""" """Set an access breakpoint."""
find_proc_by_obj(process) find_proc_by_obj(process)
dbg().ba(expr=range.min, size=range.length(), dbg().ba(expr=range.min, size=range.length(),
access=DbgEng.DEBUG_BREAK_READ | DbgEng.DEBUG_BREAK_WRITE) access=DbgEng.DEBUG_BREAK_READ | DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='break_access') @REGISTRY.method(action='break_ext', display='Set Access Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def break_access_expression(expression: str): def break_access_expression(expression: str) -> None:
"""Set an access watchpoint.""" """Set an access breakpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_READ | DbgEng.DEBUG_BREAK_WRITE) dbg().ba(expr=expression,
access=DbgEng.DEBUG_BREAK_READ | DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='toggle') @REGISTRY.method(action='toggle', display='Toggle Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def toggle_breakpoint(breakpoint: sch.Schema('BreakpointSpec'), enabled: bool): def toggle_breakpoint(breakpoint: BreakpointSpec, enabled: bool) -> None:
"""Toggle a breakpoint.""" """Toggle a breakpoint."""
bpt = find_bpt_by_obj(breakpoint) bpt = find_bpt_by_obj(breakpoint)
if enabled: if enabled:
@ -536,47 +806,59 @@ def toggle_breakpoint(breakpoint: sch.Schema('BreakpointSpec'), enabled: bool):
dbg().bd(bpt.GetId()) dbg().bd(bpt.GetId())
@REGISTRY.method(action='delete') @REGISTRY.method(action='delete', display='Delete Breakpoint')
@util.dbg.eng_thread @util.dbg.eng_thread
def delete_breakpoint(breakpoint: sch.Schema('BreakpointSpec')): def delete_breakpoint(breakpoint: BreakpointSpec) -> None:
"""Delete a breakpoint.""" """Delete a breakpoint."""
bpt = find_bpt_by_obj(breakpoint) bpt = find_bpt_by_obj(breakpoint)
dbg().cmd("bc {}".format(bpt.GetId())) dbg().cmd("bc {}".format(bpt.GetId()))
@REGISTRY.method @REGISTRY.method()
@util.dbg.eng_thread @util.dbg.eng_thread
def read_mem(process: sch.Schema('Process'), range: AddressRange): def read_mem(process: Process, range: AddressRange) -> None:
"""Read memory.""" """Read memory."""
# print("READ_MEM: process={}, range={}".format(process, range)) # print("READ_MEM: process={}, range={}".format(process, range))
nproc = find_proc_by_obj(process) nproc = find_proc_by_obj(process)
offset_start = process.trace.memory_mapper.map_back( offset_start = process.trace.extra.require_mm().map_back(
nproc, Address(range.space, range.min)) nproc, Address(range.space, range.min))
with commands.open_tracked_tx('Read Memory'): with commands.open_tracked_tx('Read Memory'):
result = commands.put_bytes( result = commands.put_bytes(
offset_start, offset_start + range.length() - 1, pages=True, display_result=False) offset_start, offset_start + range.length() - 1, pages=True,
display_result=False)
if result['count'] == 0: if result['count'] == 0:
commands.putmem_state( commands.putmem_state(
offset_start, offset_start + range.length() - 1, 'error') offset_start, offset_start + range.length() - 1, 'error')
@REGISTRY.method @REGISTRY.method()
@util.dbg.eng_thread @util.dbg.eng_thread
def write_mem(process: sch.Schema('Process'), address: Address, data: bytes): def write_mem(process: Process, address: Address, data: bytes) -> None:
"""Write memory.""" """Write memory."""
nproc = find_proc_by_obj(process) nproc = find_proc_by_obj(process)
offset = process.trace.memory_mapper.map_back(nproc, address) offset = process.trace.extra.required_mm().map_back(nproc, address)
dbg().write(offset, data) dbg().write(offset, data)
@REGISTRY.method @REGISTRY.method()
@util.dbg.eng_thread @util.dbg.eng_thread
def write_reg(frame: sch.Schema('StackFrame'), name: str, value: bytes): def write_reg(frame: StackFrame, name: str, value: bytes) -> None:
"""Write a register.""" """Write a register."""
util.select_frame() f = find_frame_by_obj(frame)
util.select_frame(f.FrameNumber)
nproc = pydbg.selected_process() nproc = pydbg.selected_process()
dbg().reg._set_register(name, value) dbg().reg._set_register(name, value)
@REGISTRY.method(display='Refresh Events (custom)', condition=util.dbg.IS_TRACE)
@util.dbg.eng_thread
def refresh_trace_events_custom(node: State,
cmd: Annotated[str, ParamDesc(display='Cmd')],
prefix: Annotated[str, ParamDesc(display='Prefix')] = "dx -r2 @$cursession.TTD") -> None:
"""Parse TTD objects generated from a LINQ command."""
with commands.open_tracked_tx('Put Events (custom)'):
commands.ghidra_trace_put_trace_events_custom(prefix, cmd)
def dbg(): def dbg():
return util.dbg._base return util.dbg._base

View file

@ -1,8 +1,9 @@
<context> <context>
<schema name="DbgRoot" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="DbgRoot" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="EventScope" />
<attribute name="Sessions" schema="SessionContainer" required="yes" fixed="yes" /> <attribute name="Sessions" schema="SessionContainer" required="yes" fixed="yes" />
<attribute name="Settings" schema="ANY" /> <attribute name="Settings" schema="ANY" />
<attribute name="State" schema="ANY" /> <attribute name="State" schema="State" />
<attribute-alias from="_state" to="State" /> <attribute-alias from="_state" to="State" />
<attribute name="Utility" schema="ANY" /> <attribute name="Utility" schema="ANY" />
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
@ -16,7 +17,6 @@
</schema> </schema>
<schema name="Session" elementResync="NEVER" attributeResync="NEVER"> <schema name="Session" elementResync="NEVER" attributeResync="NEVER">
<interface name="Activatable" /> <interface name="Activatable" />
<interface name="EventScope" />
<interface name="FocusScope" /> <interface name="FocusScope" />
<interface name="Aggregate" /> <interface name="Aggregate" />
<element schema="VOID" /> <element schema="VOID" />
@ -28,6 +28,11 @@
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY"/> <attribute schema="ANY"/>
</schema> </schema>
<schema name="State" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="VOID" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY"/>
</schema>
<schema name="Selectable" elementResync="NEVER" attributeResync="NEVER"> <schema name="Selectable" elementResync="NEVER" attributeResync="NEVER">
<element schema="OBJECT" /> <element schema="OBJECT" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
@ -37,6 +42,8 @@
<interface name="Aggregate" /> <interface name="Aggregate" />
<element schema="VOID" /> <element schema="VOID" />
<attribute name="Breakpoints" schema="BreakpointContainer" required="yes" /> <attribute name="Breakpoints" schema="BreakpointContainer" required="yes" />
<attribute name="Events" schema="EventContainer" required="yes" />
<attribute name="Exceptions" schema="ExceptionContainer" required="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="VOID" />
</schema> </schema>
@ -45,6 +52,42 @@
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" /> <attribute schema="ANY" />
</schema> </schema>
<schema name="EventContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="Event" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="Event" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="ANY" />
<attribute name="Cont" schema="ContinueOption" />
<attribute name="Exec" schema="ExecutionOption" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="ExceptionContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="Exception" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="Exception" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="ANY" />
<attribute name="Cont" schema="ContinueOption" />
<attribute name="Exec" schema="ExecutionOption" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="ContinueOption" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="Togglable" />
<element schema="VOID" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="ExecutionOption" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="Togglable" />
<element schema="VOID" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema>
<schema name="AvailableContainer" canonical="yes" elementResync="ALWAYS" attributeResync="NEVER"> <schema name="AvailableContainer" canonical="yes" elementResync="ALWAYS" attributeResync="NEVER">
<element schema="Attachable" /> <element schema="Attachable" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />

View file

@ -1,5 +1,6 @@
<context> <context>
<schema name="DbgRoot" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="DbgRoot" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="EventScope" />
<attribute name="Sessions" schema="SessionContainer" required="yes" fixed="yes" /> <attribute name="Sessions" schema="SessionContainer" required="yes" fixed="yes" />
<attribute name="Settings" schema="ANY" /> <attribute name="Settings" schema="ANY" />
<attribute name="State" schema="ANY" /> <attribute name="State" schema="ANY" />
@ -16,7 +17,6 @@
</schema> </schema>
<schema name="Session" elementResync="NEVER" attributeResync="NEVER"> <schema name="Session" elementResync="NEVER" attributeResync="NEVER">
<interface name="Activatable" /> <interface name="Activatable" />
<interface name="EventScope" />
<interface name="FocusScope" /> <interface name="FocusScope" />
<interface name="Aggregate" /> <interface name="Aggregate" />
<element schema="VOID" /> <element schema="VOID" />

View file

@ -13,10 +13,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
from comtypes.automation import VARIANT # type: ignore
from ghidratrace.client import Schedule
from .dbgmodel.imodelobject import ModelObject
from capstone import CsInsn # type: ignore
from _winapi import STILL_ACTIVE
from collections import namedtuple from collections import namedtuple
from concurrent.futures import Future from concurrent.futures import Future
import concurrent.futures import concurrent.futures
from ctypes import * from ctypes import POINTER, byref, c_ulong, c_ulonglong, create_string_buffer
import functools import functools
import io import io
import os import os
@ -25,20 +31,22 @@ import re
import sys import sys
import threading import threading
import traceback import traceback
from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union, cast
from comtypes import CoClass, GUID from comtypes import CoClass, GUID # type: ignore
import comtypes import comtypes # type: ignore
from comtypes.gen import DbgMod from comtypes.gen import DbgMod # type: ignore
from comtypes.hresult import S_OK from comtypes.hresult import S_OK, S_FALSE # type: ignore
from pybag import pydbg, userdbg, kerneldbg, crashdbg
from pybag.dbgeng import core as DbgEng
from pybag.dbgeng import exception
from pybag.dbgeng import util as DbgUtil
from pybag.dbgeng.callbacks import DbgEngCallbacks
from ghidradbg.dbgmodel.ihostdatamodelaccess import HostDataModelAccess from ghidradbg.dbgmodel.ihostdatamodelaccess import HostDataModelAccess
from _winapi import STILL_ACTIVE from ghidradbg.dbgmodel.imodelmethod import ModelMethod
from pybag import pydbg, userdbg, kerneldbg, crashdbg # type: ignore
from pybag.dbgeng import core as DbgEng # type: ignore
from pybag.dbgeng import exception # type: ignore
from pybag.dbgeng import util as DbgUtil # type: ignore
from pybag.dbgeng.callbacks import DbgEngCallbacks # type: ignore
from pybag.dbgeng.idebugclient import DebugClient # type: ignore
DESCRIPTION_PATTERN = '[{major:X}:{minor:X}] {type}'
DbgVersion = namedtuple('DbgVersion', ['full', 'name', 'dotted', 'arch']) DbgVersion = namedtuple('DbgVersion', ['full', 'name', 'dotted', 'arch'])
@ -80,6 +88,7 @@ class StdInputCallbacks(CoClass):
class _Worker(threading.Thread): class _Worker(threading.Thread):
def __init__(self, new_base, work_queue, dispatch): def __init__(self, new_base, work_queue, dispatch):
super().__init__(name='DbgWorker', daemon=True) super().__init__(name='DbgWorker', daemon=True)
self.new_base = new_base self.new_base = new_base
@ -108,6 +117,7 @@ class _Worker(threading.Thread):
# https://github.com/python/cpython/blob/main/Lib/concurrent/futures/thread.py # https://github.com/python/cpython/blob/main/Lib/concurrent/futures/thread.py
# accessed 9 Jan 2024 # accessed 9 Jan 2024
class _WorkItem(object): class _WorkItem(object):
def __init__(self, future, fn, args, kwargs): def __init__(self, future, fn, args, kwargs):
self.future = future self.future = future
self.fn = fn self.fn = fn
@ -129,30 +139,35 @@ class DebuggeeRunningException(BaseException):
pass pass
T = TypeVar('T')
class DbgExecutor(object): class DbgExecutor(object):
def __init__(self, ghidra_dbg):
def __init__(self, ghidra_dbg: 'GhidraDbg') -> None:
self._ghidra_dbg = ghidra_dbg self._ghidra_dbg = ghidra_dbg
self._work_queue = queue.SimpleQueue() self._work_queue: queue.SimpleQueue = queue.SimpleQueue()
self._thread = _Worker(ghidra_dbg._new_base, self._thread = _Worker(ghidra_dbg._new_base,
self._work_queue, ghidra_dbg._dispatch_events) self._work_queue, ghidra_dbg._dispatch_events)
self._thread.start() self._thread.start()
self._executing = False self._executing = False
def submit(self, fn, /, *args, **kwargs): def submit(self, fn: Callable[..., T], /, *args, **kwargs) -> Future[T]:
f = self._submit_no_exit(fn, *args, **kwargs) f = self._submit_no_exit(fn, *args, **kwargs)
self._ghidra_dbg.exit_dispatch() self._ghidra_dbg.exit_dispatch()
return f return f
def _submit_no_exit(self, fn, /, *args, **kwargs): def _submit_no_exit(self, fn: Callable[..., T], /,
f = Future() *args, **kwargs) -> Future[T]:
if self._executing: f: Future[T] = Future()
if self._executing and self._ghidra_dbg.IS_REMOTE == False:
f.set_exception(DebuggeeRunningException("Debuggee is Running")) f.set_exception(DebuggeeRunningException("Debuggee is Running"))
return f return f
w = _WorkItem(f, fn, args, kwargs) w = _WorkItem(f, fn, args, kwargs)
self._work_queue.put(w) self._work_queue.put(w)
return f return f
def _clear_queue(self): def _clear_queue(self) -> None:
while True: while True:
try: try:
work_item = self._work_queue.get_nowait() work_item = self._work_queue.get_nowait()
@ -161,11 +176,12 @@ class DbgExecutor(object):
work_item.future.set_exception( work_item.future.set_exception(
DebuggeeRunningException("Debuggee is Running")) DebuggeeRunningException("Debuggee is Running"))
def _state_execute(self): def _state_execute(self) -> None:
self._executing = True self._executing = True
if self._ghidra_dbg.IS_REMOTE == False:
self._clear_queue() self._clear_queue()
def _state_break(self): def _state_break(self) -> None:
self._executing = False self._executing = False
@ -196,8 +212,12 @@ class AllDbg(pydbg.DebuggerBase):
load_dump = crashdbg.CrashDbg.load_dump load_dump = crashdbg.CrashDbg.load_dump
C = TypeVar('C', bound=Callable[..., Any])
class GhidraDbg(object): class GhidraDbg(object):
def __init__(self):
def __init__(self) -> None:
self._queue = DbgExecutor(self) self._queue = DbgExecutor(self)
self._thread = self._queue._thread self._thread = self._queue._thread
# Wait for the executor to be operational before getting base # Wait for the executor to be operational before getting base
@ -239,18 +259,33 @@ class GhidraDbg(object):
setattr(self, name, self.eng_thread(getattr(base, name))) setattr(self, name, self.eng_thread(getattr(base, name)))
self.IS_KERNEL = False self.IS_KERNEL = False
self.IS_EXDI = False self.IS_EXDI = False
self.IS_REMOTE: bool = os.getenv('OPT_CONNECT_STRING') is not None
self.IS_TRACE: bool = os.getenv('USE_TTD') == "true"
def _new_base(self): def _new_base(self) -> None:
remote = os.getenv('OPT_CONNECT_STRING')
if remote is not None:
remote_client = DbgEng.DebugConnect(remote)
debug_client = self._generate_client(remote_client)
self._protected_base = AllDbg(client=debug_client)
else:
self._protected_base = AllDbg() self._protected_base = AllDbg()
def _generate_client(self, original: DebugClient) -> DebugClient:
cli = POINTER(DbgEng.IDebugClient)()
cliptr = POINTER(POINTER(DbgEng.IDebugClient))(cli)
hr = original.CreateClient(cliptr)
exception.check_err(hr)
return DebugClient(client=cli)
@property @property
def _base(self): def _base(self) -> AllDbg:
if threading.current_thread() is not self._thread: if threading.current_thread() is not self._thread:
raise WrongThreadException("Was {}. Want {}".format( raise WrongThreadException("Was {}. Want {}".format(
threading.current_thread(), self._thread)) threading.current_thread(), self._thread))
return self._protected_base return self._protected_base
def run(self, fn, *args, **kwargs): def run(self, fn: Callable[..., T], *args, **kwargs) -> T:
# TODO: Remove this check? # TODO: Remove this check?
if hasattr(self, '_thread') and threading.current_thread() is self._thread: if hasattr(self, '_thread') and threading.current_thread() is self._thread:
raise WrongThreadException() raise WrongThreadException()
@ -262,59 +297,60 @@ class GhidraDbg(object):
except concurrent.futures.TimeoutError: except concurrent.futures.TimeoutError:
pass pass
def run_async(self, fn, *args, **kwargs): def run_async(self, fn: Callable[..., T], *args, **kwargs) -> Future[T]:
return self._queue.submit(fn, *args, **kwargs) return self._queue.submit(fn, *args, **kwargs)
@staticmethod @staticmethod
def check_thread(func): def check_thread(func: C) -> C:
''' """For methods inside of GhidraDbg, ensure it runs on the dbgeng
For methods inside of GhidraDbg, ensure it runs on the dbgeng thread."""
thread
'''
@functools.wraps(func) @functools.wraps(func)
def _func(self, *args, **kwargs): def _func(self, *args, **kwargs) -> Any:
if threading.current_thread() is self._thread: if threading.current_thread() is self._thread:
return func(self, *args, **kwargs) return func(self, *args, **kwargs)
else: else:
return self.run(func, self, *args, **kwargs) return self.run(func, self, *args, **kwargs)
return _func
def eng_thread(self, func): return cast(C, _func)
'''
For methods and functions outside of GhidraDbg, ensure it def eng_thread(self, func: C) -> C:
runs on this GhidraDbg's dbgeng thread """For methods and functions outside of GhidraDbg, ensure it runs on
''' this GhidraDbg's dbgeng thread."""
@functools.wraps(func) @functools.wraps(func)
def _func(*args, **kwargs): def _func(*args, **kwargs) -> Any:
if threading.current_thread() is self._thread: if threading.current_thread() is self._thread:
return func(*args, **kwargs) return func(*args, **kwargs)
else: else:
return self.run(func, *args, **kwargs) return self.run(func, *args, **kwargs)
return _func
def _ces_exec_status(self, argument): return cast(C, _func)
def _ces_exec_status(self, argument: int):
if argument & 0xfffffff == DbgEng.DEBUG_STATUS_BREAK: if argument & 0xfffffff == DbgEng.DEBUG_STATUS_BREAK:
self._queue._state_break() self._queue._state_break()
else: else:
self._queue._state_execute() self._queue._state_execute()
@check_thread @check_thread
def _install_stdin(self): def _install_stdin(self) -> None:
self.input = StdInputCallbacks(self) self.input = StdInputCallbacks(self)
self._base._client.SetInputCallbacks(self.input) self._base._client.SetInputCallbacks(self.input)
# Manually decorated to preserve undecorated # Manually decorated to preserve undecorated
def _dispatch_events(self, timeout=DbgEng.WAIT_INFINITE): def _dispatch_events(self, timeout: int = DbgEng.WAIT_INFINITE) -> None:
# NB: pybag's impl doesn't heed standalone # NB: pybag's impl doesn't heed standalone
self._protected_base._client.DispatchCallbacks(timeout) self._protected_base._client.DispatchCallbacks(timeout)
dispatch_events = check_thread(_dispatch_events) dispatch_events = check_thread(_dispatch_events)
# no check_thread. Must allow reentry # no check_thread. Must allow reentry
def exit_dispatch(self): def exit_dispatch(self) -> None:
self._protected_base._client.ExitDispatch() self._protected_base._client.ExitDispatch()
@check_thread @check_thread
def cmd(self, cmdline, quiet=True): def cmd(self, cmdline: str, quiet: bool = True) -> str:
# NB: pybag's impl always captures. # NB: pybag's impl always captures.
# Here, we let it print without capture if quiet is False # Here, we let it print without capture if quiet is False
if quiet: if quiet:
@ -330,20 +366,20 @@ class GhidraDbg(object):
return self._base._control.Execute(cmdline) return self._base._control.Execute(cmdline)
@check_thread @check_thread
def return_input(self, input): def return_input(self, input: str) -> None:
# TODO: Contribute fix upstream (check_hr -> check_err) # TODO: Contribute fix upstream (check_hr -> check_err)
# return self._base._control.ReturnInput(input.encode()) # return self._base._control.ReturnInput(input.encode())
hr = self._base._control._ctrl.ReturnInput(input.encode()) hr = self._base._control._ctrl.ReturnInput(input.encode())
exception.check_err(hr) exception.check_err(hr)
def interrupt(self): def interrupt(self) -> None:
# Contribute upstream? # Contribute upstream?
# NOTE: This can be called from any thread # NOTE: This can be called from any thread
self._protected_base._control.SetInterrupt( self._protected_base._control.SetInterrupt(
DbgEng.DEBUG_INTERRUPT_ACTIVE) DbgEng.DEBUG_INTERRUPT_ACTIVE)
@check_thread @check_thread
def get_current_system_id(self): def get_current_system_id(self) -> int:
# TODO: upstream? # TODO: upstream?
sys_id = c_ulong() sys_id = c_ulong()
hr = self._base._systems._sys.GetCurrentSystemId(byref(sys_id)) hr = self._base._systems._sys.GetCurrentSystemId(byref(sys_id))
@ -351,7 +387,7 @@ class GhidraDbg(object):
return sys_id.value return sys_id.value
@check_thread @check_thread
def get_prompt_text(self): def get_prompt_text(self) -> str:
# TODO: upstream? # TODO: upstream?
size = c_ulong() size = c_ulong()
hr = self._base._control._ctrl.GetPromptText(None, 0, byref(size)) hr = self._base._control._ctrl.GetPromptText(None, 0, byref(size))
@ -360,12 +396,12 @@ class GhidraDbg(object):
return prompt_buf.value.decode() return prompt_buf.value.decode()
@check_thread @check_thread
def get_actual_processor_type(self): def get_actual_processor_type(self) -> int:
return self._base._control.GetActualProcessorType() return self._base._control.GetActualProcessorType()
@property @property
@check_thread @check_thread
def pid(self): def pid(self) -> Optional[int]:
try: try:
if is_kernel(): if is_kernel():
return 0 return 0
@ -375,20 +411,31 @@ class GhidraDbg(object):
return None return None
class TTDState(object):
def __init__(self) -> None:
self._first: Optional[Tuple[int, int]] = None
self._last: Optional[Tuple[int, int]] = None
self._lastpos: Optional[Tuple[int, int]] = None
self.evttypes: Dict[Tuple[int, int], str] = {}
self.MAX_STEP: int
dbg = GhidraDbg() dbg = GhidraDbg()
ttd = TTDState()
@dbg.eng_thread @dbg.eng_thread
def compute_pydbg_ver(): def compute_pydbg_ver() -> DbgVersion:
pat = re.compile( pat = re.compile(
'(?P<name>.*Debugger.*) Version (?P<dotted>[\\d\\.]*) (?P<arch>\\w*)') '(?P<name>.*Debugger.*) Version (?P<dotted>[\\d\\.]*) (?P<arch>\\w*)')
blurb = dbg.cmd('version') blurb = dbg.cmd('version')
matches = [pat.match(l) for l in blurb.splitlines() if pat.match(l)] matches_opt = [pat.match(l) for l in blurb.splitlines()]
matches = [m for m in matches_opt if m is not None]
if len(matches) == 0: if len(matches) == 0:
return DbgVersion('Unknown', 'Unknown', '0', 'Unknown') return DbgVersion('Unknown', 'Unknown', '0', 'Unknown')
m = matches[0] m = matches[0]
return DbgVersion(full=m.group(), **m.groupdict()) return DbgVersion(full=m.group(), **m.groupdict())
name, dotted_and_arch = full.split(' Version ')
DBG_VERSION = compute_pydbg_ver() DBG_VERSION = compute_pydbg_ver()
@ -399,26 +446,27 @@ def get_target():
@dbg.eng_thread @dbg.eng_thread
def disassemble1(addr): def disassemble1(addr: int) -> CsInsn:
return DbgUtil.disassemble_instruction(dbg._base.bitness(), addr, dbg.read(addr, 15)) data = dbg.read(addr, 15) # type:ignore
return DbgUtil.disassemble_instruction(dbg._base.bitness(), addr, data)
def get_inst(addr): def get_inst(addr: int) -> str:
return str(disassemble1(addr)) return str(disassemble1(addr))
def get_inst_sz(addr): def get_inst_sz(addr: int) -> int:
return int(disassemble1(addr).size) return int(disassemble1(addr).size)
@dbg.eng_thread @dbg.eng_thread
def get_breakpoints(): def get_breakpoints() -> Iterable[Tuple[str, str, str, str, str]]:
ids = [bpid for bpid in dbg._base.breakpoints] ids = [bpid for bpid in dbg._base.breakpoints]
offset_set = [] offset_set: List[str] = []
expr_set = [] expr_set: List[str] = []
prot_set = [] prot_set: List[str] = []
width_set = [] width_set: List[str] = []
stat_set = [] stat_set: List[str] = []
for bpid in ids: for bpid in ids:
try: try:
bp = dbg._base._control.GetBreakpointById(bpid) bp = dbg._base._control.GetBreakpointById(bpid)
@ -454,7 +502,7 @@ def get_breakpoints():
@dbg.eng_thread @dbg.eng_thread
def selected_process(): def selected_process() -> int:
try: try:
if is_exdi(): if is_exdi():
return 0 return 0
@ -462,7 +510,8 @@ def selected_process():
do = dbg._base._systems.GetCurrentProcessDataOffset() do = dbg._base._systems.GetCurrentProcessDataOffset()
id = c_ulong() id = c_ulong()
offset = c_ulonglong(do) offset = c_ulonglong(do)
nproc = dbg._base._systems._sys.GetProcessIdByDataOffset(offset, byref(id)) nproc = dbg._base._systems._sys.GetProcessIdByDataOffset(
offset, byref(id))
return id.value return id.value
if dbg.use_generics: if dbg.use_generics:
return dbg._base._systems.GetCurrentProcessSystemId() return dbg._base._systems.GetCurrentProcessSystemId()
@ -473,7 +522,7 @@ def selected_process():
@dbg.eng_thread @dbg.eng_thread
def selected_process_space(): def selected_process_space() -> int:
try: try:
if is_exdi(): if is_exdi():
return 0 return 0
@ -486,7 +535,7 @@ def selected_process_space():
@dbg.eng_thread @dbg.eng_thread
def selected_thread(): def selected_thread() -> Optional[int]:
try: try:
if is_kernel(): if is_kernel():
return 0 return 0
@ -498,7 +547,7 @@ def selected_thread():
@dbg.eng_thread @dbg.eng_thread
def selected_frame(): def selected_frame() -> Optional[int]:
try: try:
line = dbg.cmd('.frame').strip() line = dbg.cmd('.frame').strip()
if not line: if not line:
@ -511,40 +560,47 @@ def selected_frame():
return None return None
def require(t: Optional[T]) -> T:
if t is None:
raise ValueError("Unexpected None")
return t
@dbg.eng_thread @dbg.eng_thread
def select_process(id: int): def select_process(id: int) -> None:
if is_kernel(): if is_kernel():
# TODO: Ideally this should get the data offset from the id and then call # TODO: Ideally this should get the data offset from the id and then call
# SetImplicitProcessDataOffset # SetImplicitProcessDataOffset
return return
if dbg.use_generics: if dbg.use_generics:
id = get_proc_id(id) id = require(get_proc_id(id))
return dbg._base._systems.SetCurrentProcessId(id) return dbg._base._systems.SetCurrentProcessId(id)
@dbg.eng_thread @dbg.eng_thread
def select_thread(id: int): def select_thread(id: int) -> None:
if is_kernel(): if is_kernel():
# TODO: Ideally this should get the data offset from the id and then call # TODO: Ideally this should get the data offset from the id and then call
# SetImplicitThreadDataOffset # SetImplicitThreadDataOffset
return return
if dbg.use_generics: if dbg.use_generics:
id = get_thread_id(id) id = require(get_thread_id(id))
return dbg._base._systems.SetCurrentThreadId(id) return dbg._base._systems.SetCurrentThreadId(id)
@dbg.eng_thread @dbg.eng_thread
def select_frame(id: int): def select_frame(id: int) -> str:
return dbg.cmd('.frame /c {}'.format(id)) return dbg.cmd('.frame /c {}'.format(id))
@dbg.eng_thread @dbg.eng_thread
def reset_frames(): def reset_frames() -> str:
return dbg.cmd('.cxr') return dbg.cmd('.cxr')
@dbg.eng_thread @dbg.eng_thread
def parse_and_eval(expr, type=None): def parse_and_eval(expr: Union[str, int],
type: Optional[int] = None) -> Union[int, float, bytes]:
if isinstance(expr, int): if isinstance(expr, int):
return expr return expr
# TODO: This could be contributed upstream # TODO: This could be contributed upstream
@ -575,20 +631,22 @@ def parse_and_eval(expr, type=None):
return value.u.F82Bytes return value.u.F82Bytes
if type == DbgEng.DEBUG_VALUE_FLOAT128: if type == DbgEng.DEBUG_VALUE_FLOAT128:
return value.u.F128Bytes return value.u.F128Bytes
raise ValueError(
f"Could not evaluate '{expr}' or convert result '{value}'")
@dbg.eng_thread @dbg.eng_thread
def get_pc(): def get_pc() -> int:
return dbg._base.reg.get_pc() return dbg._base.reg.get_pc()
@dbg.eng_thread @dbg.eng_thread
def get_sp(): def get_sp() -> int:
return dbg._base.reg.get_sp() return dbg._base.reg.get_sp()
@dbg.eng_thread @dbg.eng_thread
def GetProcessIdsByIndex(count=0): def GetProcessIdsByIndex(count: int = 0) -> Tuple[List[int], List[int]]:
# TODO: This could be contributed upstream? # TODO: This could be contributed upstream?
if count == 0: if count == 0:
try: try:
@ -601,11 +659,11 @@ def GetProcessIdsByIndex(count=0):
hr = dbg._base._systems._sys.GetProcessIdsByIndex( hr = dbg._base._systems._sys.GetProcessIdsByIndex(
0, count, ids, sysids) 0, count, ids, sysids)
exception.check_err(hr) exception.check_err(hr)
return (tuple(ids), tuple(sysids)) return (list(ids), list(sysids))
@dbg.eng_thread @dbg.eng_thread
def GetCurrentProcessExecutableName(): def GetCurrentProcessExecutableName() -> str:
# TODO: upstream? # TODO: upstream?
_dbg = dbg._base _dbg = dbg._base
size = c_ulong() size = c_ulong()
@ -617,17 +675,15 @@ def GetCurrentProcessExecutableName():
size = exesize size = exesize
hr = _dbg._systems._sys.GetCurrentProcessExecutableName(buffer, size, None) hr = _dbg._systems._sys.GetCurrentProcessExecutableName(buffer, size, None)
exception.check_err(hr) exception.check_err(hr)
buffer = buffer[:size.value] return buffer.value.decode()
buffer = buffer.rstrip(b'\x00')
return buffer
@dbg.eng_thread @dbg.eng_thread
def GetCurrentProcessPeb(): def GetCurrentProcessPeb() -> int:
# TODO: upstream? # TODO: upstream?
_dbg = dbg._base _dbg = dbg._base
offset = c_ulonglong() offset = c_ulonglong()
if dbg.is_kernel(): if is_kernel():
hr = _dbg._systems._sys.GetCurrentProcessDataOffset(byref(offset)) hr = _dbg._systems._sys.GetCurrentProcessDataOffset(byref(offset))
else: else:
hr = _dbg._systems._sys.GetCurrentProcessPeb(byref(offset)) hr = _dbg._systems._sys.GetCurrentProcessPeb(byref(offset))
@ -636,7 +692,7 @@ def GetCurrentProcessPeb():
@dbg.eng_thread @dbg.eng_thread
def GetCurrentThreadTeb(): def GetCurrentThreadTeb() -> int:
# TODO: upstream? # TODO: upstream?
_dbg = dbg._base _dbg = dbg._base
offset = c_ulonglong() offset = c_ulonglong()
@ -649,18 +705,120 @@ def GetCurrentThreadTeb():
@dbg.eng_thread @dbg.eng_thread
def GetExitCode(): def GetExitCode() -> int:
# TODO: upstream? # TODO: upstream?
if is_kernel(): if is_kernel():
return STILL_ACTIVE return STILL_ACTIVE
exit_code = c_ulong() exit_code = c_ulong()
hr = dbg._base._client._cli.GetExitCode(byref(exit_code)) hr = dbg._base._client._cli.GetExitCode(byref(exit_code))
# DebugConnect targets return E_UNEXPECTED but the target is STILL_ACTIVE
if hr != S_OK and hr != S_FALSE:
return STILL_ACTIVE
return exit_code.value return exit_code.value
@dbg.eng_thread @dbg.eng_thread
def process_list(running=False): def GetNumberEventFilters() -> Tuple[int, int, int]:
"""Get the list of all processes""" n_events = c_ulong()
n_spec_exc = c_ulong()
n_arb_exc = c_ulong()
hr = dbg._base._control._ctrl.GetNumberEventFilters(
byref(n_events), byref(n_spec_exc), byref(n_arb_exc))
exception.check_err(hr)
return (n_events.value, n_spec_exc.value, n_arb_exc.value)
@dbg.eng_thread
def GetEventFilterText(index: int, sz: int) -> str:
if sz == 0:
return "Unknown"
len = c_ulong()
val = create_string_buffer(sz)
hr = dbg._base._control._ctrl.GetEventFilterText(
index, val, sz, byref(len))
# exception.check_err(hr)
if hr != 0:
return "Unknown"
return val.value[:len.value].decode()
@dbg.eng_thread
def GetEventFilterCommand(index: int, sz: int) -> Union[str, None]:
if sz == 0:
return None
len = c_ulong()
val = create_string_buffer(sz)
hr = dbg._base._control._ctrl.GetEventFilterCommand(
index, val, sz, byref(len))
exception.check_err(hr)
return val.value[:len.value].decode()
@dbg.eng_thread
def GetExceptionFilterSecondCommand(index: int, sz: int) -> Union[str, None]:
if sz == 0:
return None
len = c_ulong()
val = create_string_buffer(sz)
hr = dbg._base._control._ctrl.GetExceptionFilterSecondCommand(
index, val, sz, byref(len))
exception.check_err(hr)
return val.value[:len.value].decode()
@dbg.eng_thread
def GetSpecificFilterArgument(index: int, sz: int) -> Union[str, None]:
if sz == 0:
return None
len = c_ulong()
val = create_string_buffer(sz)
hr = dbg._base._control._ctrl.GetSpecificFilterArgument(
index, val, sz, byref(len))
exception.check_err(hr)
return val.value[:len.value].decode()
execution_options = ['enabled', 'disabled', 'output', 'ignore']
continue_options = ['handled', 'not handled', 'unknown']
@dbg.eng_thread
def GetSpecificFilterParameters(start: int, count: int) -> List[DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS]:
# For reference, this is how you pass an array of structures!
params = (DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS * count)()
hr = dbg._base._control._ctrl.GetSpecificFilterParameters(
start, count, params)
exception.check_err(hr)
return params
@dbg.eng_thread
def SetSpecificFilterParameters(start: int, count: int, parray: List[DbgEng._DEBUG_SPECIFIC_FILTER_PARAMETERS]) -> None:
hr = dbg._base._control._ctrl.SetSpecificFilterParameters(
start, count, parray)
exception.check_err(hr)
@dbg.eng_thread
def GetExceptionFilterParameters(start: int, codes, count: int) -> List[DbgEng._DEBUG_EXCEPTION_FILTER_PARAMETERS]:
# For reference, this is how you pass an array of structures!
params = (DbgEng._DEBUG_EXCEPTION_FILTER_PARAMETERS * count)()
hr = dbg._base._control._ctrl.GetExceptionFilterParameters(
count, codes, start, params)
exception.check_err(hr)
return params
@dbg.eng_thread
def SetExceptionFilterParameters(count: int, parray: List[DbgEng._DEBUG_EXCEPTION_FILTER_PARAMETERS]) -> None:
hr = dbg._base._control._ctrl.SetExceptionFilterParameters(count, parray)
exception.check_err(hr)
@dbg.eng_thread
def process_list(running: bool = False) -> Union[
Iterable[Tuple[int, str, int]], Iterable[Tuple[int]]]:
"""Get the list of all processes."""
_dbg = dbg._base _dbg = dbg._base
ids, sysids = GetProcessIdsByIndex() ids, sysids = GetProcessIdsByIndex()
pebs = [] pebs = []
@ -680,12 +838,16 @@ def process_list(running=False):
return zip(sysids) return zip(sysids)
finally: finally:
if not running and curid is not None: if not running and curid is not None:
try:
_dbg._systems.SetCurrentProcessId(curid) _dbg._systems.SetCurrentProcessId(curid)
except Exception as e:
print(f"Couldn't restore current process: {e}")
@dbg.eng_thread @dbg.eng_thread
def thread_list(running=False): def thread_list(running: bool = False) -> Union[
"""Get the list of all threads""" Iterable[Tuple[int, int, str]], Iterable[Tuple[int]]]:
"""Get the list of all threads."""
_dbg = dbg._base _dbg = dbg._base
try: try:
ids, sysids = _dbg._systems.GetThreadIdsByIndex() ids, sysids = _dbg._systems.GetThreadIdsByIndex()
@ -713,8 +875,8 @@ def thread_list(running=False):
@dbg.eng_thread @dbg.eng_thread
def get_proc_id(pid): def get_proc_id(pid: int) -> Optional[int]:
"""Get the list of all processes""" """Get the id for the given system process id."""
# TODO: Implement GetProcessIdBySystemId and replace this logic # TODO: Implement GetProcessIdBySystemId and replace this logic
_dbg = dbg._base _dbg = dbg._base
map = {} map = {}
@ -728,24 +890,18 @@ def get_proc_id(pid):
return None return None
def full_mem(): def full_mem() -> List[DbgEng._MEMORY_BASIC_INFORMATION64]:
sizeptr = 64; #int(gdb.parse_and_eval('sizeof(void*)')) * 8 info = DbgEng._MEMORY_BASIC_INFORMATION64()
infoLow = DbgEng._MEMORY_BASIC_INFORMATION64() info.BaseAddress = 0
infoLow.BaseAddress = 0 info.RegionSize = (1 << 64) - 1
infoLow.RegionSize = (1 << (sizeptr-1)) info.Protect = 0xFFF
infoLow.Protect = 0xFFF info.Name = "full memory"
infoLow.Name = "UMEM" return [info]
infoHigh = DbgEng._MEMORY_BASIC_INFORMATION64()
infoHigh.BaseAddress = 1 << (sizeptr-1)
infoHigh.RegionSize = (1 << (sizeptr-1))
infoHigh.Protect = 0xFFF
infoHigh.Name = "KMEM"
return [ infoLow, infoHigh ]
@dbg.eng_thread @dbg.eng_thread
def get_thread_id(tid): def get_thread_id(tid: int) -> Optional[int]:
"""Get the list of all threads""" """Get the id for the given system thread id."""
# TODO: Implement GetThreadIdBySystemId and replace this logic # TODO: Implement GetThreadIdBySystemId and replace this logic
_dbg = dbg._base _dbg = dbg._base
map = {} map = {}
@ -759,7 +915,17 @@ def get_thread_id(tid):
return None return None
def split_path(pathString): @dbg.eng_thread
def open_trace_or_dump(filename: Union[str, bytes]) -> None:
"""Open a trace or dump file."""
_cli = dbg._base._client._cli
if isinstance(filename, str):
filename = filename.encode()
hr = _cli.OpenDumpFile(filename)
exception.check_err(hr)
def split_path(pathString: str) -> List[str]:
list = [] list = []
segs = pathString.split(".") segs = pathString.split(".")
for s in segs: for s in segs:
@ -774,18 +940,23 @@ def split_path(pathString):
return list return list
def IHostDataModelAccess(): def IHostDataModelAccess() -> HostDataModelAccess:
return HostDataModelAccess( return HostDataModelAccess(dbg._base._client._cli.QueryInterface(
dbg._base._client._cli.QueryInterface(interface=DbgMod.IHostDataModelAccess)) interface=DbgMod.IHostDataModelAccess))
def IModelMethod(method_ptr) -> ModelMethod:
return ModelMethod(method_ptr.GetIntrinsicValue().value.QueryInterface(
interface=DbgMod.IModelMethod))
@dbg.eng_thread @dbg.eng_thread
def get_object(relpath): def get_object(relpath: str) -> Optional[ModelObject]:
"""Get the list of all threads""" """Get the model object at the given path."""
_cli = dbg._base._client._cli _cli = dbg._base._client._cli
access = HostDataModelAccess(_cli.QueryInterface( access = HostDataModelAccess(_cli.QueryInterface(
interface=DbgMod.IHostDataModelAccess)) interface=DbgMod.IHostDataModelAccess))
(mgr, host) = access.GetDataModel() mgr, host = access.GetDataModel()
root = mgr.GetRootNamespace() root = mgr.GetRootNamespace()
pathstr = "Debugger" pathstr = "Debugger"
if relpath != '': if relpath != '':
@ -796,24 +967,41 @@ def get_object(relpath):
@dbg.eng_thread @dbg.eng_thread
def get_attributes(obj): def get_method(context_path: str, method_name: str) -> Optional[ModelMethod]:
"""Get the list of attributes""" """Get method for the given object (path) and name."""
obj = get_object(context_path)
if obj is None:
return None
keys = obj.EnumerateKeys()
k, v = keys.GetNext()
while k is not None:
if k.value == method_name:
break
(k, v) = keys.GetNext()
if k is None:
return None
return IModelMethod(v)
@dbg.eng_thread
def get_attributes(obj: ModelObject) -> Dict[str, ModelObject]:
"""Get the list of attributes."""
if obj is None: if obj is None:
return None return None
return obj.GetAttributes() return obj.GetAttributes()
@dbg.eng_thread @dbg.eng_thread
def get_elements(obj): def get_elements(obj: ModelObject) -> List[Tuple[int, ModelObject]]:
"""Get the list of all threads""" """Get the list of elements."""
if obj is None: if obj is None:
return None return None
return obj.GetElements() return obj.GetElements()
@dbg.eng_thread @dbg.eng_thread
def get_kind(obj): def get_kind(obj) -> Optional[int]:
"""Get the list of all threads""" """Get the kind."""
if obj is None: if obj is None:
return None return None
kind = obj.GetKind() kind = obj.GetKind()
@ -822,65 +1010,66 @@ def get_kind(obj):
return obj.GetKind().value return obj.GetKind().value
@dbg.eng_thread # DOESN'T WORK YET
def get_type(obj): # @dbg.eng_thread
"""Get the list of all threads""" # def get_type(obj: ModelObject):
if obj is None: # """Get the type."""
return None # if obj is None:
return obj.GetTypeKind() # return None
# return obj.GetTypeKind()
@dbg.eng_thread @dbg.eng_thread
def get_value(obj): def get_value(obj: ModelObject) -> Any:
"""Get the list of all threads""" """Get the value."""
if obj is None: if obj is None:
return None return None
return obj.GetValue() return obj.GetValue()
@dbg.eng_thread @dbg.eng_thread
def get_intrinsic_value(obj): def get_intrinsic_value(obj: ModelObject) -> VARIANT:
"""Get the list of all threads""" """Get the intrinsic value."""
if obj is None: if obj is None:
return None return None
return obj.GetIntrinsicValue() return obj.GetIntrinsicValue()
@dbg.eng_thread @dbg.eng_thread
def get_target_info(obj): def get_target_info(obj: ModelObject) -> ModelObject:
"""Get the list of all threads""" """Get the target info."""
if obj is None: if obj is None:
return None return None
return obj.GetTargetInfo() return obj.GetTargetInfo()
@dbg.eng_thread @dbg.eng_thread
def get_type_info(obj): def get_type_info(obj: ModelObject) -> ModelObject:
"""Get the list of all threads""" """Get the type info."""
if obj is None: if obj is None:
return None return None
return obj.GetTypeInfo() return obj.GetTypeInfo()
@dbg.eng_thread @dbg.eng_thread
def get_name(obj): def get_name(obj: ModelObject) -> str:
"""Get the list of all threads""" """Get the name."""
if obj is None: if obj is None:
return None return None
return obj.GetName().value return obj.GetName().value
@dbg.eng_thread @dbg.eng_thread
def to_display_string(obj): def to_display_string(obj: ModelObject) -> str:
"""Get the list of all threads""" """Get the display string."""
if obj is None: if obj is None:
return None return None
return obj.ToDisplayString() return obj.ToDisplayString()
@dbg.eng_thread @dbg.eng_thread
def get_location(obj): def get_location(obj: ModelObject) -> Optional[str]:
"""Get the list of all threads""" """Get the location."""
if obj is None: if obj is None:
return None return None
try: try:
@ -892,10 +1081,10 @@ def get_location(obj):
return None return None
conv_map = {} conv_map: Dict[str, str] = {}
def get_convenience_variable(id): def get_convenience_variable(id: str) -> Any:
if id not in conv_map: if id not in conv_map:
return "auto" return "auto"
val = conv_map[id] val = conv_map[id]
@ -904,19 +1093,89 @@ def get_convenience_variable(id):
return val return val
def set_convenience_variable(id, value): def get_last_position() -> Optional[Tuple[int, int]]:
return ttd._lastpos
def set_last_position(pos: Tuple[int, int]) -> None:
ttd._lastpos = pos
def get_event_type(pos: Tuple[int, int]) -> Optional[str]:
if ttd.evttypes.__contains__(pos):
return ttd.evttypes[pos]
return None
def split2schedule(pos: Tuple[int, int]) -> Schedule:
major, minor = pos
return mm2schedule(major, minor)
def schedule2split(time: Schedule) -> Tuple[int, int]:
return time.snap, time.steps
def mm2schedule(major: int, minor: int) -> Schedule:
index = int(major)
if index < 0 or hasattr(ttd, 'MAX_STEP') and index >= ttd.MAX_STEP:
return Schedule(require(ttd._last)[0])
if index >= 1 << 63:
return Schedule((1 << 63) - 1)
return Schedule(index, minor)
def pos2split(pos: ModelObject) -> Tuple[int, int]:
pmap = get_attributes(pos)
major = get_value(pmap["Sequence"])
minor = get_value(pmap["Steps"])
return (major, minor)
def schedule2ss(time: Schedule) -> str:
return f'{time.snap:x}:{time.steps:x}'
def compute_description(time: Optional[Schedule], fallback: str) -> str:
if time is None:
return fallback
evt_type = get_event_type(schedule2split(time))
evt_str = evt_type or fallback
return DESCRIPTION_PATTERN.format(major=time.snap, minor=time.steps,
type=evt_str)
def set_convenience_variable(id: str, value: Any) -> None:
conv_map[id] = value conv_map[id] = value
def set_kernel(value): def set_kernel(value: bool) -> None:
dbg.IS_KERNEL = value dbg.IS_KERNEL = value
def is_kernel(): def is_kernel() -> bool:
return dbg.IS_KERNEL return dbg.IS_KERNEL
def set_exdi(value):
def set_exdi(value: bool) -> None:
dbg.IS_EXDI = value dbg.IS_EXDI = value
def is_exdi():
def is_exdi() -> bool:
return dbg.IS_EXDI return dbg.IS_EXDI
def set_remote(value: bool) -> None:
dbg.IS_REMOTE = value
def is_remote() -> bool:
return dbg.IS_REMOTE
def set_trace(value: bool) -> None:
dbg.IS_TRACE = value
def is_trace() -> bool:
return dbg.IS_TRACE

View file

@ -1,212 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from ghidratrace.client import Address, RegVal
from pybag import pydbg
from . import util
language_map = {
'ARM': ['AARCH64:BE:64:v8A', 'AARCH64:LE:64:AppleSilicon', 'AARCH64:LE:64:v8A', 'ARM:BE:64:v8', 'ARM:LE:64:v8'],
'Itanium': [],
'x86': ['x86:LE:32:default'],
'x86_64': ['x86:LE:64:default'],
'EFI': ['x86:LE:64:default'],
}
data64_compiler_map = {
None: 'pointer64',
}
x86_compiler_map = {
'windows': 'windows',
'Cygwin': 'windows',
}
arm_compiler_map = {
'windows': 'windows',
}
compiler_map = {
'DATA:BE:64:default': data64_compiler_map,
'DATA:LE:64:default': data64_compiler_map,
'x86:LE:32:default': x86_compiler_map,
'x86:LE:64:default': x86_compiler_map,
'AARCH64:BE:64:v8A': arm_compiler_map,
'AARCH64:LE:64:AppleSilicon': arm_compiler_map,
'AARCH64:LE:64:v8A': arm_compiler_map,
'ARM:BE:64:v8': arm_compiler_map,
'ARM:LE:64:v8': arm_compiler_map,
}
def get_arch():
return "x86_64"
def get_endian():
return 'little'
def get_osabi():
return "windows"
def compute_ghidra_language():
# First, check if the parameter is set
lang = util.get_convenience_variable('ghidra-language')
if lang != 'auto':
return lang
# Get the list of possible languages for the arch. We'll need to sift
# through them by endian and probably prefer default/simpler variants. The
# heuristic for "simpler" will be 'default' then shortest variant id.
arch = get_arch()
endian = get_endian()
lebe = ':BE:' if endian == 'big' else ':LE:'
if not arch in language_map:
return 'DATA' + lebe + '64:default'
langs = language_map[arch]
matched_endian = sorted(
(l for l in langs if lebe in l),
key=lambda l: 0 if l.endswith(':default') else len(l)
)
if len(matched_endian) > 0:
return matched_endian[0]
# NOTE: I'm disinclined to fall back to a language match with wrong endian.
return 'DATA' + lebe + '64:default'
def compute_ghidra_compiler(lang):
# First, check if the parameter is set
comp = util.get_convenience_variable('ghidra-compiler')
if comp != 'auto':
return comp
# Check if the selected lang has specific compiler recommendations
if not lang in compiler_map:
return 'default'
comp_map = compiler_map[lang]
osabi = get_osabi()
if osabi in comp_map:
return comp_map[osabi]
if None in comp_map:
return comp_map[None]
return 'default'
def compute_ghidra_lcsp():
lang = compute_ghidra_language()
comp = compute_ghidra_compiler(lang)
return lang, comp
class DefaultMemoryMapper(object):
def __init__(self, defaultSpace):
self.defaultSpace = defaultSpace
def map(self, proc: int, offset: int):
space = self.defaultSpace
return self.defaultSpace, Address(space, offset)
def map_back(self, proc: int, address: Address) -> int:
if address.space == self.defaultSpace:
return address.offset
raise ValueError(f"Address {address} is not in process {proc.GetProcessID()}")
DEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram')
memory_mappers = {}
def compute_memory_mapper(lang):
if not lang in memory_mappers:
return DEFAULT_MEMORY_MAPPER
return memory_mappers[lang]
class DefaultRegisterMapper(object):
def __init__(self, byte_order):
if not byte_order in ['big', 'little']:
raise ValueError("Invalid byte_order: {}".format(byte_order))
self.byte_order = byte_order
self.union_winners = {}
def map_name(self, proc, name):
return name
def map_value(self, proc, name, value):
try:
### TODO: this seems half-baked
av = value.to_bytes(8, "big")
except Exception:
raise ValueError("Cannot convert {}'s value: '{}', type: '{}'"
.format(name, value, type(value)))
return RegVal(self.map_name(proc, name), av)
def map_name_back(self, proc, name):
return name
def map_value_back(self, proc, name, value):
return RegVal(self.map_name_back(proc, name), value)
class Intel_x86_64_RegisterMapper(DefaultRegisterMapper):
def __init__(self):
super().__init__('little')
def map_name(self, proc, name):
if name is None:
return 'UNKNOWN'
if name == 'efl':
return 'rflags'
if name.startswith('zmm'):
# Ghidra only goes up to ymm, right now
return 'ymm' + name[3:]
return super().map_name(proc, name)
def map_value(self, proc, name, value):
rv = super().map_value(proc, name, value)
if rv.name.startswith('ymm') and len(rv.value) > 32:
return RegVal(rv.name, rv.value[-32:])
return rv
def map_name_back(self, proc, name):
if name == 'rflags':
return 'eflags'
DEFAULT_BE_REGISTER_MAPPER = DefaultRegisterMapper('big')
DEFAULT_LE_REGISTER_MAPPER = DefaultRegisterMapper('little')
register_mappers = {
'x86:LE:64:default': Intel_x86_64_RegisterMapper()
}
def compute_register_mapper(lang):
if not lang in register_mappers:
if ':BE:' in lang:
return DEFAULT_BE_REGISTER_MAPPER
if ':LE:' in lang:
return DEFAULT_LE_REGISTER_MAPPER
return register_mappers[lang]

View file

@ -1,441 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
import sys
import time
import threading
from pybag import pydbg
from pybag.dbgeng.callbacks import EventHandler
from pybag.dbgeng import core as DbgEng
from pybag.dbgeng import exception
from pybag.dbgeng.idebugbreakpoint import DebugBreakpoint
from . import commands, util
ALL_EVENTS = 0xFFFF
class HookState(object):
__slots__ = ('installed', 'mem_catchpoint')
def __init__(self):
self.installed = False
self.mem_catchpoint = None
class ProcessState(object):
__slots__ = ('first', 'regions', 'modules', 'threads', 'breaks', 'watches', 'visited', 'waiting')
def __init__(self):
self.first = True
# For things we can detect changes to between stops
self.regions = False
self.modules = False
self.threads = False
self.breaks = False
self.watches = False
# For frames and threads that have already been synced since last stop
self.visited = set()
self.waiting = True
def record(self, description=None, snap=None):
first = self.first
self.first = False
if description is not None:
commands.STATE.trace.snapshot(description, snap=snap)
if first:
commands.put_processes()
commands.put_environment()
if self.threads:
commands.put_threads()
self.threads = False
thread = util.selected_thread()
if thread is not None:
if first or thread not in self.visited:
commands.putreg()
commands.putmem("$pc", "1", display_result=False)
commands.putmem("$sp", "1", display_result=False)
#commands.put_frames()
self.visited.add(thread)
#frame = util.selected_frame()
#hashable_frame = (thread, frame)
#if first or hashable_frame not in self.visited:
# self.visited.add(hashable_frame)
if first or self.regions:
commands.put_regions()
self.regions = False
if first or self.modules:
commands.put_modules()
self.modules = False
if first or self.breaks:
commands.put_breakpoints()
self.breaks = False
def record_continued(self):
commands.put_processes(running=True)
commands.put_threads(running=True)
def record_exited(self, exit_code, description=None, snap=None):
if description is not None:
commands.STATE.trace.snapshot(description, snap)
proc = util.selected_process()
ipath = commands.PROCESS_PATTERN.format(procnum=proc)
commands.STATE.trace.proxy_object_path(
ipath).set_value('Exit Code', exit_code)
class BrkState(object):
__slots__ = ('break_loc_counts',)
def __init__(self):
self.break_loc_counts = {}
def update_brkloc_count(self, b, count):
self.break_loc_counts[b.GetID()] = count
def get_brkloc_count(self, b):
return self.break_loc_counts.get(b.GetID(), 0)
def del_brkloc_count(self, b):
if b not in self.break_loc_counts:
return 0 # TODO: Print a warning?
count = self.break_loc_counts[b.GetID()]
del self.break_loc_counts[b.GetID()]
return count
HOOK_STATE = HookState()
BRK_STATE = BrkState()
PROC_STATE = {}
def on_state_changed(*args):
#print("ON_STATE_CHANGED")
if args[0] == DbgEng.DEBUG_CES_CURRENT_THREAD:
return on_thread_selected(args)
elif args[0] == DbgEng.DEBUG_CES_BREAKPOINTS:
return on_breakpoint_modified(args)
elif args[0] == DbgEng.DEBUG_CES_RADIX:
util.set_convenience_variable('output-radix', args[1])
return DbgEng.DEBUG_STATUS_GO
elif args[0] == DbgEng.DEBUG_CES_EXECUTION_STATUS:
proc = util.selected_process()
if args[1] & DbgEng.DEBUG_STATUS_INSIDE_WAIT:
PROC_STATE[proc].waiting = True
return DbgEng.DEBUG_STATUS_GO
PROC_STATE[proc].waiting = False
commands.put_state(proc)
if args[1] == DbgEng.DEBUG_STATUS_BREAK:
return on_stop(args)
else:
return on_cont(args)
return DbgEng.DEBUG_STATUS_GO
def on_debuggee_changed(*args):
#print("ON_DEBUGGEE_CHANGED")
trace = commands.STATE.trace
if trace is None:
return
if args[1] == DbgEng.DEBUG_CDS_REGISTERS:
on_register_changed(args[0][1])
#if args[1] == DbgEng.DEBUG_CDS_DATA:
# on_memory_changed(args[0][1])
return DbgEng.DEBUG_STATUS_GO
def on_session_status_changed(*args):
#print("ON_STATUS_CHANGED")
trace = commands.STATE.trace
if trace is None:
return
if args[0] == DbgEng.DEBUG_SESSION_ACTIVE or args[0] == DbgEng.DEBUG_SSESION_REBOOT:
with commands.STATE.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes()
return DbgEng.DEBUG_STATUS_GO
def on_symbol_state_changed(*args):
#print("ON_SYMBOL_STATE_CHANGED")
trace = commands.STATE.trace
if trace is None:
return
if args[0] == 1 or args[0] == 2:
PROC_STATE[proc].modules = True
return DbgEng.DEBUG_STATUS_GO
def on_system_error(*args):
print("ON_SYSTEM_ERROR")
print(hex(args[0]))
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes()
return DbgEng.DEBUG_STATUS_BREAK
def on_new_process(*args):
#print("ON_NEW_PROCESS")
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes()
return DbgEng.DEBUG_STATUS_BREAK
def on_process_selected():
#print("PROCESS_SELECTED")
proc = util.selected_process()
if proc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("Process {} selected".format(proc)):
PROC_STATE[proc].record()
commands.activate()
def on_process_deleted(*args):
#print("ON_PROCESS_DELETED")
proc = args[0]
on_exited(proc)
if proc in PROC_STATE:
del PROC_STATE[proc]
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("Process {} deleted".format(proc)):
commands.put_processes() # TODO: Could just delete the one....
return DbgEng.DEBUG_STATUS_BREAK
def on_threads_changed(*args):
#print("ON_THREADS_CHANGED")
proc = util.selected_process()
if proc not in PROC_STATE:
return DbgEng.DEBUG_STATUS_GO
PROC_STATE[proc].threads = True
return DbgEng.DEBUG_STATUS_GO
def on_thread_selected(*args):
#print("THREAD_SELECTED")
nthrd = args[0][1]
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("Thread {}.{} selected".format(nproc, nthrd)):
commands.put_state(nproc)
state = PROC_STATE[nproc]
if state.waiting:
state.record_continued()
else:
state.record()
commands.activate()
def on_register_changed(regnum):
#print("REGISTER_CHANGED")
proc = util.selected_process()
if proc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("Register {} changed".format(regnum)):
commands.putreg()
commands.activate()
def on_cont(*args):
proc = util.selected_process()
if proc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
state = PROC_STATE[proc]
with commands.STATE.client.batch():
with trace.open_tx("Continued"):
state.record_continued()
return DbgEng.DEBUG_STATUS_GO
def on_stop(*args):
proc = util.selected_process()
if proc not in PROC_STATE:
print("not in state")
return
trace = commands.STATE.trace
if trace is None:
print("no trace")
return
state = PROC_STATE[proc]
state.visited.clear()
pos = dbg().get_position()
rng = range(pos.major, util.lastpos.major)
if pos.major > util.lastpos.major:
rng = range(util.lastpos.major, pos.major)
for i in rng:
if util.evttypes.__contains__(i):
type = util.evttypes[i]
if type == "modload" or type == "modunload":
on_modules_changed()
if type == "threadcreated" or type == "threadterm":
on_threads_changed()
util.lastpos = pos
with commands.STATE.client.batch():
with trace.open_tx("Stopped"):
state.record("Stopped", util.pos2snap(pos))
commands.put_state(proc)
commands.put_event_thread()
commands.activate()
def on_exited(proc):
if proc not in PROC_STATE:
print("not in state")
return
trace = commands.STATE.trace
if trace is None:
return
state = PROC_STATE[proc]
state.visited.clear()
exit_code = util.GetExitCode()
description = "Exited with code {}".format(exit_code)
with commands.STATE.client.batch():
with trace.open_tx(description):
state.record_exited(exit_code, description)
commands.activate()
def on_modules_changed(*args):
#print("ON_MODULES_CHANGED")
proc = util.selected_process()
if proc not in PROC_STATE:
return DbgEng.DEBUG_STATUS_GO
PROC_STATE[proc].modules = True
return DbgEng.DEBUG_STATUS_GO
def on_breakpoint_created(bp):
proc = util.selected_process()
if proc not in PROC_STATE:
return
PROC_STATE[proc].breaks = True
trace = commands.STATE.trace
if trace is None:
return
ibpath = commands.PROC_BREAKS_PATTERN.format(procnum=proc)
with commands.STATE.client.batch():
with trace.open_tx("Breakpoint {} created".format(bp.id)):
ibobj = trace.create_object(ibpath)
# Do not use retain_values or it'll remove other locs
commands.put_single_breakpoint(bp, ibobj, proc, [])
ibobj.insert()
def on_breakpoint_modified(*args):
#print("BREAKPOINT_MODIFIED")
proc = util.selected_process()
if proc not in PROC_STATE:
return
PROC_STATE[proc].breaks = True
trace = commands.STATE.trace
if trace is None:
return
ibpath = commands.PROC_BREAKS_PATTERN.format(procnum=proc)
ibobj = trace.create_object(ibpath)
bpid = args[0][1]
try:
bp = dbg()._control.GetBreakpointById(bpid)
except exception.E_NOINTERFACE_Error:
dbg().breakpoints._remove_stale(bpid)
return on_breakpoint_deleted(bpid)
return on_breakpoint_created(bp)
def on_breakpoint_deleted(bpt):
proc = util.selected_process()
if proc not in PROC_STATE:
return
PROC_STATE[proc].breaks = True
trace = commands.STATE.trace
if trace is None:
return
bpath = commands.PROC_BREAK_PATTERN.format(procnum=proc, breaknum=bpt.id)
with commands.STATE.client.batch():
with trace.open_tx("Breakpoint {} deleted".format(bpt.id)):
trace.proxy_object_path(bpath).remove(tree=True)
def on_breakpoint_hit(*args):
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes()
return DbgEng.DEBUG_STATUS_GO
def on_exception(*args):
trace = commands.STATE.trace
if trace is None:
return
with commands.STATE.client.batch():
with trace.open_tx("New Process {}".format(util.selected_process())):
commands.put_processes()
return DbgEng.DEBUG_STATUS_GO
def install_hooks():
if HOOK_STATE.installed:
return
HOOK_STATE.installed = True
def remove_hooks():
if not HOOK_STATE.installed:
return
HOOK_STATE.installed = False
def enable_current_process():
proc = util.selected_process()
PROC_STATE[proc] = ProcessState()
def disable_current_process():
proc = util.selected_process()
if proc in PROC_STATE:
# Silently ignore already disabled
del PROC_STATE[proc]
def dbg():
return util.get_debugger()

View file

@ -1,78 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
import ctypes
import os
import platform
import comtypes
import comtypes.client
ctypes.windll.kernel32.SetErrorMode(0x0001 | 0x0002 | 0x8000)
if platform.architecture()[0] == '64bit':
dbgdirs = [os.getenv('OPT_DBGMODEL_PATH'),
r'C:\Program Files\Windows Kits\10\Debuggers\x64',
r'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64']
else:
dbgdirs = [os.getenv('OPT_DBGMODEL_PATH'),
r'C:\Program Files\Windows Kits\10\Debuggers\x86',
r'C:\Program Files (x86)\Windows Kits\10\Debuggers\x86']
dbgdir = None
for _dir in dbgdirs:
if _dir is not None and os.path.exists(_dir):
dbgdir = _dir
break
if not dbgdir:
raise RuntimeError("Windbg install directory not found!")
print(f"Loading dbgeng and friends from {dbgdir}")
# preload these to get correct DLLs loaded
try:
ctypes.windll.LoadLibrary(os.path.join(dbgdir, 'dbghelp.dll'))
except Exception as exc:
print(fr"LoadLibrary failed: {dbgdir}\dbghelp.dll {exc}")
pass
try:
ctypes.windll.LoadLibrary(os.path.join(dbgdir, 'dbgeng.dll'))
except Exception as exc:
print(fr"LoadLibrary failed: {dbgdir}\dbgeng.dll {exc}")
pass
try:
ctypes.windll.LoadLibrary(os.path.join(dbgdir, 'DbgModel.dll'))
except Exception as exc:
print(fr"LoadLibrary failed: {dbgdir}\dbgmodel.dll {exc}")
pass
try:
ctypes.windll.LoadLibrary(os.path.join(dbgdir, 'ttd/TTDReplay.dll'))
except Exception as exc:
print(fr"LoadLibrary failed: {dbgdir}\ttd\TTDReplay.dll {exc}")
pass
try:
ctypes.windll.LoadLibrary(os.path.join(dbgdir, 'ttd/TTDReplayCPU.dll'))
except Exception as exc:
print(fr"LoadLibrary failed: {dbgdir}\ttd\TTDReplayCPU.dll {exc}")
pass
try:
from comtypes.gen import DbgMod
except:
tlb = os.path.join(dbgmodel.module_locator(), 'tlb', 'dbgmodel.tlb')
print(f"Loading TLB: {tlb}")
comtypes.client.GetModule(tlb)
from comtypes.gen import DbgMod

View file

@ -1,538 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from concurrent.futures import Future, ThreadPoolExecutor
import re
import sys
from ghidratrace import sch
from ghidratrace.client import MethodRegistry, ParamDesc, Address, AddressRange
from pyttd import pyTTD
#from pybag import pydbg
#from pybag.dbgeng import core as DbgEng
from . import util, commands, hooks
from contextlib import redirect_stdout
from io import StringIO
REGISTRY = MethodRegistry(ThreadPoolExecutor(max_workers=1))
def extre(base, ext):
return re.compile(base.pattern + ext)
AVAILABLE_PATTERN = re.compile('Available\[(?P<pid>\\d*)\]')
WATCHPOINT_PATTERN = re.compile('Watchpoints\[(?P<watchnum>\\d*)\]')
BREAKPOINT_PATTERN = re.compile('Breakpoints\[(?P<breaknum>\\d*)\]')
BREAK_LOC_PATTERN = extre(BREAKPOINT_PATTERN, '\[(?P<locnum>\\d*)\]')
PROCESS_PATTERN = re.compile('Processes\[(?P<procnum>\\d*)\]')
PROC_BREAKS_PATTERN = extre(PROCESS_PATTERN, '\.Breakpoints')
PROC_BREAKBPT_PATTERN = extre(PROC_BREAKS_PATTERN, '\[(?P<breaknum>\\d*)\]')
ENV_PATTERN = extre(PROCESS_PATTERN, '\.Environment')
THREADS_PATTERN = extre(PROCESS_PATTERN, '\.Threads')
THREAD_PATTERN = extre(THREADS_PATTERN, '\[(?P<tnum>\\d*)\]')
STACK_PATTERN = extre(THREAD_PATTERN, '\.Stack')
FRAME_PATTERN = extre(STACK_PATTERN, '\[(?P<level>\\d*)\]')
REGS_PATTERN0 = extre(THREAD_PATTERN, '.Registers')
REGS_PATTERN = extre(FRAME_PATTERN, '.Registers')
MEMORY_PATTERN = extre(PROCESS_PATTERN, '\.Memory')
MODULES_PATTERN = extre(PROCESS_PATTERN, '\.Modules')
def find_availpid_by_pattern(pattern, object, err_msg):
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pid = int(mat['pid'])
return pid
def find_availpid_by_obj(object):
return find_availpid_by_pattern(AVAILABLE_PATTERN, object, "an Available")
def find_proc_by_num(id):
if id != util.selected_process():
util.select_process(id)
return util.selected_process()
def find_proc_by_pattern(object, pattern, err_msg):
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
procnum = int(mat['procnum'])
return find_proc_by_num(procnum)
def find_proc_by_obj(object):
return find_proc_by_pattern(object, PROCESS_PATTERN, "an Process")
def find_proc_by_procbreak_obj(object):
return find_proc_by_pattern(object, PROC_BREAKS_PATTERN,
"a BreakpointLocationContainer")
def find_proc_by_procwatch_obj(object):
return find_proc_by_pattern(object, PROC_WATCHES_PATTERN,
"a WatchpointContainer")
def find_proc_by_env_obj(object):
return find_proc_by_pattern(object, ENV_PATTERN, "an Environment")
def find_proc_by_threads_obj(object):
return find_proc_by_pattern(object, THREADS_PATTERN, "a ThreadContainer")
def find_proc_by_mem_obj(object):
return find_proc_by_pattern(object, MEMORY_PATTERN, "a Memory")
def find_proc_by_modules_obj(object):
return find_proc_by_pattern(object, MODULES_PATTERN, "a ModuleContainer")
def find_thread_by_num(id):
if id != util.selected_thread():
util.select_thread(id)
return util.selected_thread()
def find_thread_by_pattern(pattern, object, err_msg):
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pnum = int(mat['procnum'])
tnum = int(mat['tnum'])
find_proc_by_num(pnum)
return find_thread_by_num(tnum)
def find_thread_by_obj(object):
return find_thread_by_pattern(THREAD_PATTERN, object, "a Thread")
def find_thread_by_stack_obj(object):
return find_thread_by_pattern(STACK_PATTERN, object, "a Stack")
def find_thread_by_regs_obj(object):
return find_thread_by_pattern(REGS_PATTERN0, object, "a RegisterValueContainer")
def find_frame_by_level(level):
return dbg().backtrace_list()[level]
def find_frame_by_pattern(pattern, object, err_msg):
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pnum = int(mat['procnum'])
tnum = int(mat['tnum'])
level = int(mat['level'])
find_proc_by_num(pnum)
find_thread_by_num(tnum)
return find_frame_by_level(level)
def find_frame_by_obj(object):
return find_frame_by_pattern(FRAME_PATTERN, object, "a StackFrame")
def find_bpt_by_number(breaknum):
try:
bp = util.breakpoints[breaknum]
return bp
except exception.E_NOINTERFACE_Error:
raise KeyError(f"Breakpoints[{breaknum}] does not exist")
def find_bpt_by_pattern(pattern, object, err_msg):
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
breaknum = int(mat['breaknum'])
return find_bpt_by_number(breaknum)
def find_bpt_by_obj(object):
return find_bpt_by_pattern(PROC_BREAKBPT_PATTERN, object, "a BreakpointSpec")
shared_globals = dict()
@REGISTRY.method
def execute(cmd: str, to_string: bool=False):
"""Execute a CLI command."""
# print("***{}***".format(cmd))
# sys.stderr.flush()
# sys.stdout.flush()
if to_string:
data = StringIO()
with redirect_stdout(data):
exec("{}".format(cmd), shared_globals)
return data.getvalue()
else:
exec("{}".format(cmd), shared_globals)
@REGISTRY.method(action='evaluate', display='Evaluate')
def evaluate(
session: sch.Schema('Session'),
expr: ParamDesc(str, display='Expr')):
"""Execute a CLI command."""
return str(eval("{}".format(expr), shared_globals))
@REGISTRY.method(action='refresh')
def refresh_available(node: sch.Schema('AvailableContainer')):
"""List processes on pydbg's host system."""
with commands.open_tracked_tx('Refresh Available'):
commands.ghidra_trace_put_available()
@REGISTRY.method(action='refresh')
def refresh_breakpoints(node: sch.Schema('BreakpointContainer')):
"""
Refresh the list of breakpoints (including locations for the current
process).
"""
with commands.open_tracked_tx('Refresh Breakpoints'):
commands.ghidra_trace_put_breakpoints()
@REGISTRY.method(action='refresh')
def refresh_processes(node: sch.Schema('ProcessContainer')):
"""Refresh the list of processes."""
with commands.open_tracked_tx('Refresh Processes'):
commands.ghidra_trace_put_threads()
def refresh_environment(node: sch.Schema('Environment')):
"""Refresh the environment descriptors (arch, os, endian)."""
with commands.open_tracked_tx('Refresh Environment'):
commands.ghidra_trace_put_environment()
@REGISTRY.method(action='refresh')
def refresh_threads(node: sch.Schema('ThreadContainer')):
"""Refresh the list of threads in the process."""
with commands.open_tracked_tx('Refresh Threads'):
commands.ghidra_trace_put_threads()
@REGISTRY.method(action='refresh')
def refresh_stack(node: sch.Schema('Stack')):
"""Refresh the backtrace for the thread."""
tnum = find_thread_by_stack_obj(node)
with commands.open_tracked_tx('Refresh Stack'):
commands.ghidra_trace_put_frames()
@REGISTRY.method(action='refresh')
def refresh_registers(node: sch.Schema('RegisterValueContainer')):
"""Refresh the register values for the frame."""
tnum = find_thread_by_regs_obj(node)
with commands.open_tracked_tx('Refresh Registers'):
commands.ghidra_trace_putreg()
@REGISTRY.method(action='refresh')
def refresh_mappings(node: sch.Schema('Memory')):
"""Refresh the list of memory regions for the process."""
with commands.open_tracked_tx('Refresh Memory Regions'):
commands.ghidra_trace_put_regions()
@REGISTRY.method(action='refresh')
def refresh_modules(node: sch.Schema('ModuleContainer')):
"""
Refresh the modules and sections list for the process.
This will refresh the sections for all modules, not just the selected one.
"""
with commands.open_tracked_tx('Refresh Modules'):
commands.ghidra_trace_put_modules()
@REGISTRY.method(action='activate')
def activate_process(process: sch.Schema('Process')):
"""Switch to the process."""
find_proc_by_obj(process)
@REGISTRY.method(action='activate')
def activate_thread(thread: sch.Schema('Thread')):
"""Switch to the thread."""
find_thread_by_obj(thread)
@REGISTRY.method(action='activate')
def activate_frame(frame: sch.Schema('StackFrame')):
"""Select the frame."""
find_frame_by_obj(frame)
@REGISTRY.method(action='delete')
def remove_process(process: sch.Schema('Process')):
"""Remove the process."""
find_proc_by_obj(process)
dbg().detach()
@REGISTRY.method(action='connect', display='Connect')
@util.dbg.eng_thread
def target(
session: sch.Schema('Session'),
cmd: ParamDesc(str, display='Command')):
"""Connect to a target machine or process."""
dbg().attach_kernel(cmd)
@REGISTRY.method(action='attach', display='Attach')
@util.dbg.eng_thread
def attach_obj(target: sch.Schema('Attachable')):
"""Attach the process to the given target."""
pid = find_availpid_by_obj(target)
dbg().attach(pid)
@REGISTRY.method(action='attach', display='Attach by pid')
@util.dbg.eng_thread
def attach_pid(
session: sch.Schema('Session'),
pid: ParamDesc(str, display='PID')):
"""Attach the process to the given target."""
dbg().attach_proc(int(pid))
@REGISTRY.method(action='attach', display='Attach by name')
@util.dbg.eng_thread
def attach_name(
session: sch.Schema('Session'),
name: ParamDesc(str, display='Name')):
"""Attach the process to the given target."""
dbg().attach_proc(name)
@REGISTRY.method(action='detach', display='Detach')
@util.dbg.eng_thread
def detach(process: sch.Schema('Process')):
"""Detach the process's target."""
dbg().detach()
@REGISTRY.method(action='launch', display='Launch')
def launch_loader(
session: sch.Schema('Session'),
file: ParamDesc(str, display='File'),
args: ParamDesc(str, display='Arguments')=''):
"""
Start a native process with the given command line, stopping at the ntdll initial breakpoint.
"""
command = file
if args != None:
command += " "+args
commands.ghidra_trace_create(command=file, start_trace=False)
@REGISTRY.method(action='launch', display='LaunchEx')
def launch(
session: sch.Schema('Session'),
file: ParamDesc(str, display='File'),
args: ParamDesc(str, display='Arguments')='',
initial_break: ParamDesc(bool, display='Initial Break')=True,
timeout: ParamDesc(int, display='Timeout')=-1):
"""
Run a native process with the given command line.
"""
command = file
if args != None:
command += " "+args
commands.ghidra_trace_create(
command, initial_break=initial_break, timeout=timeout, start_trace=False)
@REGISTRY.method
def kill(process: sch.Schema('Process')):
"""Kill execution of the process."""
dbg().terminate()
@REGISTRY.method(name='continue', action='resume')
def _continue(process: sch.Schema('Process')):
"""Continue execution of the process."""
dbg().replay_forward(pyTTD.MAX_STEP, util.last)
hooks.on_stop()
@REGISTRY.method
def interrupt(process: sch.Schema('Process')):
"""Interrupt the execution of the debugged program."""
print("'interrupt' is unsupported for TTD")
@REGISTRY.method(action='step_into')
def step_into(thread: sch.Schema('Thread'), n: ParamDesc(int, display='N')=1):
"""Step one instruction exactly."""
# find_thread_by_obj(thread)
dbg().replay_forward(n, util.last)
hooks.on_stop()
@REGISTRY.method(action='step_over')
def step_over(thread: sch.Schema('Thread'), n: ParamDesc(int, display='N')=1):
"""Step one instruction, but proceed through subroutine calls."""
# find_thread_by_obj(thread)
dbg().replay_backward(n, util.first)
hooks.on_stop()
@REGISTRY.method(action='step_out')
def step_out(thread: sch.Schema('Thread')):
"""Execute until the current stack frame returns."""
dbg().replay_backward(pyTTD.MAX_STEP, util.first)
hooks.on_stop()
@REGISTRY.method(action='step_to', display='Step To')
def step_to(thread: sch.Schema('Thread'), address: Address, max=None):
"""Continue execution up to the given address."""
find_thread_by_obj(thread)
return dbg().stepto(address.offset, max)
def gen_bpt(offset: int, size: int, flags: int):
bp = pyTTD.MemoryWatchpointData(addr=offset, size=size, flags=flags)
dbg().add_memory_watchpoint(bp)
bpt = util.Watchpoint(offset, size, flags, len(util.breakpoints), bp)
util.breakpoints.append(bpt)
hooks.on_breakpoint_created(bpt)
@REGISTRY.method(action='break_sw_execute')
def break_address(process: sch.Schema('Process'), address: Address):
"""Set a breakpoint."""
gen_bpt(offset=address.offset, size=4, flags=pyTTD.BP_FLAGS.EXEC)
@REGISTRY.method(action='break_sw_execute')
def break_expression(expression: str):
"""Set a breakpoint."""
# TODO: Escape?
dbg().bp(expr=expression)
@REGISTRY.method(action='break_hw_execute')
def break_hw_address(process: sch.Schema('Process'), address: Address):
"""Set a hardware-assisted breakpoint."""
gen_bpt(offset=address.offset, size=4, flags=pyTTD.BP_FLAGS.EXEC)
@REGISTRY.method(action='break_hw_execute')
def break_hw_expression(expression: str):
"""Set a hardware-assisted breakpoint."""
dbg().ba(expr=expression)
@REGISTRY.method(action='break_read')
def break_read_range(process: sch.Schema('Process'), range: AddressRange):
"""Set a read watchpoint."""
gen_bpt(offset=range.min, size=range.length(), flags=pyTTD.BP_FLAGS.READ)
@REGISTRY.method(action='break_read')
def break_read_expression(expression: str):
"""Set a read watchpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_READ)
@REGISTRY.method(action='break_write')
def break_write_range(process: sch.Schema('Process'), range: AddressRange):
"""Set a watchpoint."""
gen_bpt(offset=range.min, size=range.length(), flags=pyTTD.BP_FLAGS.WRITE)
@REGISTRY.method(action='break_write')
def break_write_expression(expression: str):
"""Set a watchpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='break_access')
def break_access_range(process: sch.Schema('Process'), range: AddressRange):
"""Set an access watchpoint."""
find_proc_by_obj(process)
break_read_range(process, range)
break_write_range(process, range)
@REGISTRY.method(action='break_access')
def break_access_expression(expression: str):
"""Set an access watchpoint."""
dbg().ba(expr=expression, access=DbgEng.DEBUG_BREAK_READ | DbgEng.DEBUG_BREAK_WRITE)
@REGISTRY.method(action='toggle')
def toggle_breakpoint(breakpoint: sch.Schema('BreakpointSpec'), enabled: bool):
"""Toggle a breakpoint."""
bpt = find_bpt_by_obj(breakpoint)
if enabled:
dbg().be(bpt.GetId())
else:
dbg().bd(bpt.GetId())
@REGISTRY.method(action='delete')
def delete_breakpoint(breakpoint: sch.Schema('BreakpointSpec')):
"""Delete a breakpoint."""
bpt = find_bpt_by_obj(breakpoint)
dbg().remove_memory_watchpoint(bpt.bp)
util.breakpoints.remove(bpt)
hooks.on_breakpoint_deleted(bpt)
@REGISTRY.method
def read_mem(process: sch.Schema('Process'), range: AddressRange):
"""Read memory."""
nproc = find_proc_by_obj(process)
offset_start = process.trace.memory_mapper.map_back(
nproc, Address(range.space, range.min))
with commands.open_tracked_tx('Read Memory'):
dbg().read_mem(range.min, range.length())
@REGISTRY.method
def write_mem(process: sch.Schema('Process'), address: Address, data: bytes):
"""Write memory."""
print("'write_mem' is unsupported for TTD")
@REGISTRY.method
def write_reg(frame: sch.Schema('StackFrame'), name: str, value: bytes):
"""Write a register."""
print("'write_reg' is unsupported for TTD")
def dbg():
return util.get_debugger()

View file

@ -1,204 +0,0 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from collections import namedtuple
import os
import re
import sys
from ctypes import *
from pyttd import pyTTD
#from pybag import pydbg
#from pybag.dbgeng import core as DbgEng
#from pybag.dbgeng import exception
#from pybag.dbgeng import util as DbgUtil
base = False
eng = False
first = False
last = False
breakpoints = []
events = {}
evttypes = {}
starts = {}
stops = {}
lastpos = False
DbgVersion = namedtuple('DbgVersion', ['full', 'major', 'minor'])
class Watchpoint(object):
def __init__(self, addr, size, flags, id, bp):
self.addr = addr
self.size = size
self.flags = flags
self.id = id
self.bp = bp
self.expr = None
def _compute_pydbg_ver():
blurb = "" #get_debugger()._control.GetActualProcessorType()
full = ""
major = 0
minor = 0
return DbgVersion(full, int(major), int(minor))
DBG_VERSION = _compute_pydbg_ver()
def get_debugger():
return base
def get_target():
return 0 # get_debugger()._systems.GetCurrentSystemId()
def get_inst(addr):
dbg = get_debugger()
ins = DbgUtil.disassemble_instruction(
dbg.bitness(), addr, dbg.read_mem(addr, 15))
return str(ins)
def get_inst_sz(addr):
dbg = get_debugger()
ins = DbgUtil.disassemble_instruction(
dbg.bitness(), addr, dbg.read_mem(addr, 15))
return str(ins.size)
def get_breakpoints():
return None
def selected_process():
try:
return 0
# return current_process
except Exception:
return None
def selected_thread():
try:
dbg = get_debugger()
current = dbg.get_thread_info()
return current.threadid
except Exception:
return None
def selected_frame():
return 0 # selected_thread().GetSelectedFrame()
def select_process(id: int):
return None
def select_thread(id: int):
return None
def select_frame(id: int):
# TODO: this needs to be fixed
return None
def parse_and_eval(expr):
dbg = get_debugger()
if expr == "$pc":
return dbg.get_program_counter()
if expr == "$sp":
return dbg.get_context_x86_64().rsp
return int(expr)
def get_eval(expr, type=None):
ctrl = get_debugger()._control._ctrl
ctrl.SetExpressionSyntax(1)
value = DbgEng._DEBUG_VALUE()
index = c_ulong()
if type == None:
type = DbgEng.DEBUG_VALUE_INT64
hr = ctrl.Evaluate(Expression="{}".format(expr).encode(
), DesiredType=type, Value=byref(value), RemainderIndex=byref(index))
exception.check_err(hr)
if type == DbgEng.DEBUG_VALUE_INT8:
return value.u.I8
if type == DbgEng.DEBUG_VALUE_INT16:
return value.u.I16
if type == DbgEng.DEBUG_VALUE_INT32:
return value.u.I32
if type == DbgEng.DEBUG_VALUE_INT64:
return value.u.I64.I64
if type == DbgEng.DEBUG_VALUE_FLOAT32:
return value.u.F32
if type == DbgEng.DEBUG_VALUE_FLOAT64:
return value.u.F64
if type == DbgEng.DEBUG_VALUE_FLOAT80:
return value.u.F80Bytes
if type == DbgEng.DEBUG_VALUE_FLOAT82:
return value.u.F82Bytes
if type == DbgEng.DEBUG_VALUE_FLOAT128:
return value.u.F128Bytes
def process_list(running=False):
"""process_list() -> list of all processes"""
sysids = [0]
return sysids
def thread_list():
"""thread_list() -> list of all threads"""
dbg = get_debugger()
return dbg.get_thread_list()
def module_list():
"""thread_list() -> list of all threads"""
dbg = get_debugger()
return dbg.get_module_list()
conv_map = {}
def get_convenience_variable(id):
#val = get_target().GetEnvironment().Get(id)
if id not in conv_map:
return "auto"
val = conv_map[id]
if val is None:
return "auto"
return val
def set_convenience_variable(id, value):
#env = get_target().GetEnvironment()
# return env.Set(id, value, True)
conv_map[id] = value
def pos2snap(pos: int):
index = int(pos.major)
if index < 0 or index >= pyTTD.MAX_STEP:
return int(last.major)*1000
return index*1000+int(pos.minor)

View file

@ -0,0 +1 @@
# Debugger-agent-drgn

View file

@ -0,0 +1,28 @@
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Not technically a Java project, but required to be a Help project
apply from: "${rootProject.projectDir}/gradle/javaProject.gradle"
apply from: "${rootProject.projectDir}/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-drgn'
dependencies {
// Only for Help :/
api project(':Debugger-rmi-trace')
}

View file

@ -0,0 +1,13 @@
##VERSION: 2.0
##MODULE IP: Apache License 2.0
##MODULE IP: Apache License 2.0 with LLVM Exceptions
Module.manifest||GHIDRA||||END|
README.md||GHIDRA||||END|
build.gradle||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/drgn/drgn.html||GHIDRA||||END|
src/main/py/LICENSE||GHIDRA||||END|
src/main/py/MANIFEST.in||GHIDRA||||END|
src/main/py/README.md||GHIDRA||||END|
src/main/py/pyproject.toml||GHIDRA||||END|
src/main/py/src/ghidradrgn/schema.xml||GHIDRA||||END|

View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title drgn core
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>drgn-core</tt></h3>
#@desc <p>
#@desc This will attach to an existing core dump using <tt>drgn</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group drgn
#@icon icon.debugger
#@help drgn#core
#@depends Debugger-rmi-trace
#@env OPT_TARGET_IMG:file!="" "Core dump" "The target core dump"
export OPT_TARGET_KIND="coredump"
drgn -c "$OPT_TARGET_IMG" ../support/local-drgn.py

View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title drgn kernel
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>drgn-kernel</tt></h3>
#@desc <p>
#@desc This will attach to the local machine's kernel using <tt>drgn</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group drgn
#@icon icon.debugger
#@help drgn#linux_kernel
#@depends Debugger-rmi-trace
export OPT_TARGET_KIND="kernel"
sudo -E drgn ../support/local-drgn.py

View file

@ -0,0 +1,35 @@
#!/usr/bin/env bash
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title drgn
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>drgn</tt></h3>
#@desc <p>
#@desc This will attach to a target running on the local machine using <tt>drgn</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group drgn
#@icon icon.debugger
#@help drgn#attach
#@depends Debugger-rmi-trace
#@env OPT_TARGET_PID:int=44068 "PID" "The target's process id"
export OPT_TARGET_KIND="user"
# sudo -E drgn -p "$OPT_TARGET_PID" ../support/local-drgn.py
# or 'echo 0 > /proc/sys/kernel/yama/ptrace_scope'
drgn -p "$OPT_TARGET_PID" ../support/local-drgn.py

View file

@ -0,0 +1,48 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
# From drgn:
# EASY-INSTALL-ENTRY-SCRIPT: 'drgn==0.0.24','console_scripts','drgn'
import os
import re
import sys
import drgn.cli
def append_paths():
sys.path.append(
f"{os.getenv('MODULE_Debugger_rmi_trace_HOME')}/data/support")
from gmodutils import ghidra_module_pypath
sys.path.append(ghidra_module_pypath("Debugger-rmi-trace"))
sys.path.append(ghidra_module_pypath())
def main():
append_paths()
from ghidradrgn import commands as cmd
cmd.ghidra_trace_connect(address=os.getenv('GHIDRA_TRACE_RMI_ADDR'))
cmd.ghidra_trace_create(start_trace=True)
cmd.ghidra_trace_txstart()
cmd.ghidra_trace_put_all()
cmd.ghidra_trace_txcommit()
cmd.ghidra_trace_activate()
drgn.cli.run_interactive(cmd.prog)
if __name__ == '__main__':
main()

View file

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- See Base's TOC_Source.xml for help -->
<tocroot>
<tocref id="TraceRmiLauncherServicePlugin">
<tocdef id="drgn" text="drgn Integration"
target="help/topics/drgn/drgn.html">
<tocdef id="drgn_attach" text="Attach"
target="help/topics/drgn/drgn.html#attach" />
<tocdef id="drgn_core" text="Core Dump"
target="help/topics/drgn/drgn.html#attach" />
<tocdef id="linux_kernel" text="Linux Kernel"
target="help/topics/drgn/drgn.html#attach" />
</tocdef>
</tocref>
</tocroot>

View file

@ -0,0 +1,78 @@
<!DOCTYPE doctype PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<HEAD>
<META name="generator" content=
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">
<TITLE>Debugger Launchers: drgn</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
</HEAD>
<BODY lang="EN-US">
<H1><A name="plugin"></A>Debugger Launchers: drgn</H1>
<P>The following launchers uses Meta's <B>drgn</B> engine to explore various targets:</P>
<H2><A name="attach"></A>Attach</H2>
<P>The "<TT>drgn</TT>" launcher attaches to a running process via the Linux "/proc/pid"
interface.</P>
<H3>Setup</H3>
<P>You must have Meta's <B>drgn</B> installed on the local system. The default behavior assumes
you do NOT need root access to attach to a running process, i.e. it assumes you have run the
command:</P>
<UL style="list-style-type: none">
<LI>
<PRE>
echo 0 &gt; /proc/sys/kernel/yama/ptrace_scope
</PRE>
</LI>
</UL>
<P>using root privileges at some point. Alternately, you can prepend "sudo -E" to the drgn
invocation line in "local-drgn.sh"". Note: <B>drgn</B> does not currently support stack
unwinding or register access for user-mode access to running processes.</P>
<H3>Options</H3>
<UL>
<LI><B>PID</B>: The running process's id</LI>
</UL>
<H2><A name="core"></A>Core Dump</H2>
<P>This launcher loads a Linux core dump.</P>
<H3>Setup</H3>
<P>You must have Meta's <B>drgn</B> installed on the local system. No other setup is required.
Note: Core dumps may or may not include memory, so the Dynamic Listing may or may not be
populated.</P>
<H3>Options</H3>
<UL>
<LI><B>Core dump</B>: The core-dump file</LI>
</UL>
<H2><A name="linux_kernel"></A>Linux Kernel</H2>
<P>This launcher attaches to a Linux kernel via the "/proc/kcore" interface.</P>
<H3>Setup</H3>
<P>You must have Meta's <B>drgn</B> installed on the local system. No other setup is required.
Note: requires root access - you will be prompted for a password in the Terminal.</P>
<H3>Options</H3>
<UL>
<LI><B>None</B></LI>
</UL>
</BODY>
</HTML>

View file

@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1 @@
include src/ghidradrgn/schema.xml

View file

@ -0,0 +1,3 @@
# Ghidra Trace RMI for drgn
Package for connecting drgn to Ghidra via Trace RMI.

View file

@ -0,0 +1,25 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "ghidradrgn"
version = "11.5"
authors = [
{ name="Ghidra Development Team" },
]
description = "Ghidra's Plugin for drgn"
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
dependencies = [
"ghidratrace==11.5",
]
[project.urls]
"Homepage" = "https://github.com/NationalSecurityAgency/ghidra"
"Bug Tracker" = "https://github.com/NationalSecurityAgency/ghidra/issues"

View file

@ -13,7 +13,4 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
from . import util, commands
# NOTE: libraries must precede EVERYTHING, esp pybag and DbgMod
from . import libraries, util, commands, methods, hooks

View file

@ -0,0 +1,211 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from typing import Dict, List, Literal, Optional, Tuple
from ghidratrace.client import Address, RegVal
import drgn
from . import util
# NOTE: This map is derived from the ldefs using a script
language_map: Dict[str, List[str]] = {
'AARCH64': ['AARCH64:BE:64:v8A', 'AARCH64:LE:64:AppleSilicon', 'AARCH64:LE:64:v8A'],
'ARM': ['ARM:BE:32:v8', 'ARM:BE:32:v8T', 'ARM:LE:32:v8', 'ARM:LE:32:v8T'],
'PPC64': ['PowerPC:BE:64:4xx', 'PowerPC:LE:64:4xx'],
'S390': [],
'S390X': [],
'I386': ['x86:LE:32:default'],
'X86_64': ['x86:LE:64:default'],
'UNKNOWN': ['DATA:LE:64:default', 'DATA:LE:64:default'],
}
data64_compiler_map: Dict[Optional[str], str] = {
None: 'pointer64',
}
default_compiler_map: Dict[Optional[str], str] = {
'Language.C': 'default',
}
x86_compiler_map: Dict[Optional[str], str] = {
'Language.C': 'gcc',
}
compiler_map: Dict[str, Dict[Optional[str], str]] = {
'DATA:BE:64:': data64_compiler_map,
'DATA:LE:64:': data64_compiler_map,
'x86:LE:32:': x86_compiler_map,
'x86:LE:64:': x86_compiler_map,
'AARCH64:LE:64:': default_compiler_map,
'ARM:BE:32:': default_compiler_map,
'ARM:LE:32:': default_compiler_map,
'PowerPC:BE:64:': default_compiler_map,
'PowerPC:LE:64:': default_compiler_map,
}
def get_arch() -> str:
platform = drgn.host_platform
return platform.arch.name
def get_endian() -> Literal['little', 'big']:
parm = util.get_convenience_variable('endian')
if parm != 'auto':
return parm
platform = drgn.host_platform
order = platform.flags.IS_LITTLE_ENDIAN
if order.value > 0:
return 'little'
else:
return 'big'
def get_size() -> str:
parm = util.get_convenience_variable('size')
if parm != 'auto':
return parm
platform = drgn.host_platform
order = platform.flags.IS_64_BIT
if order.value > 0:
return '64'
else:
return '32'
def get_osabi() -> str:
return "Language.C"
def compute_ghidra_language() -> str:
# First, check if the parameter is set
lang = util.get_convenience_variable('ghidra-language')
if lang != 'auto':
return lang
# Get the list of possible languages for the arch. We'll need to sift
# through them by endian and probably prefer default/simpler variants. The
# heuristic for "simpler" will be 'default' then shortest variant id.
arch = get_arch()
endian = get_endian()
sz = get_size()
lebe = ':BE:' if endian == 'big' else ':LE:'
if not arch in language_map:
return 'DATA' + lebe + sz + ':default'
langs = language_map[arch]
matched_endian = sorted(
(l for l in langs if lebe in l),
key=lambda l: 0 if l.endswith(':default') else len(l)
)
if len(matched_endian) > 0:
return matched_endian[0]
# NOTE: I'm disinclined to fall back to a language match with wrong endian.
return 'DATA' + lebe + sz + ':default'
def compute_ghidra_compiler(lang: str) -> str:
# First, check if the parameter is set
comp = util.get_convenience_variable('ghidra-compiler')
if comp != 'auto':
return comp
# Check if the selected lang has specific compiler recommendations
matched_lang = sorted(
(l for l in compiler_map if l in lang),
# key=lambda l: compiler_map[l]
)
if len(matched_lang) == 0:
print(f"{lang} not found in compiler map - using default compiler")
return 'default'
comp_map = compiler_map[matched_lang[0]]
if comp_map == data64_compiler_map:
print(f"Using the DATA64 compiler map")
osabi = get_osabi()
if osabi in comp_map:
return comp_map[osabi]
if lang.startswith("X86:"):
print(f"{osabi} not found in compiler map - using gcc")
return 'gcc'
if None in comp_map:
return comp_map[None]
print(f"{osabi} not found in compiler map - using default compiler")
return 'default'
def compute_ghidra_lcsp() -> Tuple[str, str]:
lang = compute_ghidra_language()
comp = compute_ghidra_compiler(lang)
return lang, comp
class DefaultMemoryMapper(object):
def __init__(self, defaultSpace: str) -> None:
self.defaultSpace = defaultSpace
def map(self, proc: int, offset: int) -> Tuple[str, Address]:
space = self.defaultSpace
return self.defaultSpace, Address(space, offset)
def map_back(self, proc: int, address: Address) -> int:
if address.space == self.defaultSpace:
return address.offset
raise ValueError(
f"Address {address} is not in process {proc}")
DEFAULT_MEMORY_MAPPER = DefaultMemoryMapper('ram')
memory_mappers: Dict[str, DefaultMemoryMapper] = {}
def compute_memory_mapper(lang: str) -> DefaultMemoryMapper:
if not lang in memory_mappers:
return DEFAULT_MEMORY_MAPPER
return memory_mappers[lang]
class DefaultRegisterMapper(object):
def __init__(self, byte_order: str) -> None:
if not byte_order in ['big', 'little']:
raise ValueError("Invalid byte_order: {}".format(byte_order))
self.byte_order = byte_order
def map_name(self, proc: int, name: str) -> str:
return name
def map_value(self, proc: int, name: str, value: bytes):
return RegVal(self.map_name(proc, name), value)
def map_name_back(self, proc: int, name: str):
return name
def map_value_back(self, proc: int, name: str, value: bytes):
return RegVal(self.map_name_back(proc, name), value)
DEFAULT_BE_REGISTER_MAPPER = DefaultRegisterMapper('big')
DEFAULT_LE_REGISTER_MAPPER = DefaultRegisterMapper('little')
def compute_register_mapper(lang: str) -> DefaultRegisterMapper:
if ':BE:' in lang:
return DEFAULT_BE_REGISTER_MAPPER
else:
return DEFAULT_LE_REGISTER_MAPPER

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,221 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from dataclasses import dataclass, field
import threading
import time
import drgn
from typing import Any, Callable, Collection, Dict, Optional, TypeVar, cast
from . import commands, util
ALL_EVENTS = 0xFFFF
@dataclass(frozen=False)
class HookState(object):
installed = False
@dataclass(frozen=False)
class ProcessState(object):
first = True
# For things we can detect changes to between stops
regions = False
modules = False
threads = False
breaks = False
watches = False
# For frames and threads that have already been synced since last stop
visited: set[Any] = field(default_factory=set)
def record(self, description: Optional[str] = None) -> None:
first = self.first
self.first = False
trace = commands.STATE.require_trace()
if description is not None:
trace.snapshot(description)
if first:
commands.put_processes()
commands.put_environment()
if self.threads:
commands.put_threads()
self.threads = False
nthrd = util.selected_thread()
if nthrd is not None:
if first or nthrd not in self.visited:
commands.put_frames()
self.visited.add(nthrd)
level = util.selected_frame()
hashable_frame = (nthrd, level)
if first or hashable_frame not in self.visited:
commands.putreg()
try:
commands.putmem(commands.get_pc(), 1, True, True)
except BaseException as e:
print(f"Couldn't record page with PC: {e}")
try:
commands.putmem(commands.get_sp(), 1, True, True)
except BaseException as e:
print(f"Couldn't record page with SP: {e}")
self.visited.add(hashable_frame)
if first or self.regions or self.modules:
# Sections, memory syscalls, or stack allocations
commands.put_regions()
self.regions = False
if first or self.modules:
commands.put_modules()
self.modules = False
def record_continued(self) -> None:
commands.put_processes()
commands.put_threads()
def record_exited(self, exit_code: int) -> None:
trace = commands.STATE.require_trace()
nproc = util.selected_process()
ipath = commands.PROCESS_PATTERN.format(procnum=nproc)
procobj = trace.proxy_object_path(ipath)
procobj.set_value('Exit Code', exit_code)
procobj.set_value('State', 'TERMINATED')
HOOK_STATE = HookState()
PROC_STATE: Dict[int, ProcessState] = {}
def on_new_process(id: int) -> None:
trace = commands.STATE.trace
if trace is None:
return
with trace.client.batch():
with trace.open_tx("New Process {}".format(id)):
commands.put_processes() # TODO: Could put just the one....
def on_process_selected() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
with trace.client.batch():
with trace.open_tx("Process {} selected".format(nproc)):
PROC_STATE[nproc].record()
commands.activate()
def on_new_thread() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
PROC_STATE[nproc].threads = True
def on_thread_selected() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
nthrd = util.selected_thread()
with trace.client.batch():
with trace.open_tx("Thread {}.{} selected".format(nproc, nthrd)):
PROC_STATE[nproc].record()
commands.put_threads()
commands.activate()
def on_frame_selected() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
nthrd = util.selected_thread()
level = util.selected_frame()
with trace.client.batch():
with trace.open_tx("Frame {}.{}.{} selected".format(nproc, nthrd, level)):
PROC_STATE[nproc].record()
commands.put_threads()
commands.put_frames()
commands.activate()
def on_cont() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
trace = commands.STATE.trace
if trace is None:
return
state = PROC_STATE[nproc]
with trace.client.batch():
with trace.open_tx("Continued"):
state.record_continued()
def on_stop() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
PROC_STATE[nproc] = ProcessState()
trace = commands.STATE.trace
if trace is None:
print("no trace")
return
state = PROC_STATE[nproc]
state.visited.clear()
with trace.client.batch():
with trace.open_tx("Stopped"):
state.record("Stopped")
commands.put_threads()
commands.put_frames()
commands.activate()
def modules_changed() -> None:
nproc = util.selected_process()
if nproc not in PROC_STATE:
return
PROC_STATE[nproc].modules = True
def install_hooks() -> None:
if HOOK_STATE.installed:
return
HOOK_STATE.installed = True
def remove_hooks() -> None:
if not HOOK_STATE.installed:
return
HOOK_STATE.installed = False
def enable_current_process() -> None:
nproc = util.selected_process()
PROC_STATE[nproc] = ProcessState()
def disable_current_process() -> None:
nproc = util.selected_process()
if nproc in PROC_STATE:
del PROC_STATE[nproc]

View file

@ -0,0 +1,432 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from concurrent.futures import Future, ThreadPoolExecutor
from contextlib import redirect_stdout
from io import StringIO
import re
import sys
import time
from typing import Annotated, Any, Dict, Optional, Tuple
import drgn
import drgn.cli
from drgn import StackFrame
try:
from drgn import Module # type: ignore
except Exception as e:
class Module:
pass # not supported on older versions
from ghidratrace import sch
from ghidratrace.client import (
MethodRegistry, ParamDesc, Address, AddressRange, TraceObject)
from . import util, commands, hooks
REGISTRY = MethodRegistry(ThreadPoolExecutor(
max_workers=1, thread_name_prefix='MethodRegistry'))
def extre(base, ext) -> re.Pattern:
return re.compile(base.pattern + ext)
PROCESSES_PATTERN = re.compile('Processes')
PROCESS_PATTERN = extre(PROCESSES_PATTERN, '\\[(?P<procnum>\\d*)\\]')
ENV_PATTERN = extre(PROCESS_PATTERN, '\\.Environment')
THREADS_PATTERN = extre(PROCESS_PATTERN, '\\.Threads')
THREAD_PATTERN = extre(THREADS_PATTERN, '\\[(?P<tnum>\\d*)\\]')
STACK_PATTERN = extre(THREAD_PATTERN, '\\.Stack')
FRAME_PATTERN = extre(STACK_PATTERN, '\\[(?P<level>\\d*)\\]')
REGS_PATTERN = extre(FRAME_PATTERN, '.Registers')
LOCALS_PATTERN = extre(FRAME_PATTERN, '.Locals')
MEMORY_PATTERN = extre(PROCESS_PATTERN, '\\.Memory')
MODULES_PATTERN = extre(PROCESS_PATTERN, '\\.Modules')
MODULE_PATTERN = extre(MODULES_PATTERN, '\\[(?P<modbase>.*)\\]')
class Environment(TraceObject):
pass
class LocalsContainer(TraceObject):
pass
class Memory(TraceObject):
pass
class ModuleContainer(TraceObject):
pass
class Process(TraceObject):
pass
class ProcessContainer(TraceObject):
pass
class Stack(TraceObject):
pass
class RegisterValueContainer(TraceObject):
pass
class SymbolContainer(TraceObject):
pass
class Thread(TraceObject):
pass
class ThreadContainer(TraceObject):
pass
def find_proc_by_num(id: int) -> int:
if id != util.selected_process():
util.select_process(id)
return util.selected_process()
def find_proc_by_pattern(object: TraceObject, pattern: re.Pattern,
err_msg: str) -> int:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
procnum = int(mat['procnum'])
return find_proc_by_num(procnum)
def find_proc_by_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, PROCESS_PATTERN, "an Process")
def find_proc_by_env_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, ENV_PATTERN, "an Environment")
def find_proc_by_threads_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, THREADS_PATTERN, "a ThreadContainer")
def find_proc_by_mem_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, MEMORY_PATTERN, "a Memory")
def find_proc_by_modules_obj(object: TraceObject) -> int:
return find_proc_by_pattern(object, MODULES_PATTERN, "a ModuleContainer")
def find_thread_by_num(id: int) -> Optional[int]:
if id != util.selected_thread():
util.select_thread(id)
return util.selected_thread()
def find_thread_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> Optional[int]:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pnum = int(mat['procnum'])
tnum = int(mat['tnum'])
find_proc_by_num(pnum)
return find_thread_by_num(tnum)
def find_thread_by_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(THREAD_PATTERN, object, "a Thread")
def find_thread_by_stack_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(STACK_PATTERN, object, "a Stack")
def find_thread_by_regs_obj(object: TraceObject) -> Optional[int]:
return find_thread_by_pattern(REGS_PATTERN, object, "a RegisterValueContainer")
def find_frame_by_level(level: int) -> Optional[Tuple[int, StackFrame]]:
tnum = util.selected_thread()
thread = commands.prog.thread(tnum)
try:
frames = thread.stack_trace()
except Exception as e:
print(e)
return None
for i, f in enumerate(frames):
if i == level:
if i != util.selected_frame():
util.select_frame(i)
return i, f
return None
def find_frame_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> Optional[Tuple[int, StackFrame]]:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pnum = int(mat['procnum'])
tnum = int(mat['tnum'])
level = int(mat['level'])
find_proc_by_num(pnum)
find_thread_by_num(tnum)
return find_frame_by_level(level)
def find_frame_by_obj(object: TraceObject) -> Optional[Tuple[int, StackFrame]]:
return find_frame_by_pattern(FRAME_PATTERN, object, "a StackFrame")
def find_frame_by_regs_obj(object: TraceObject) -> Optional[Tuple[int, StackFrame]]:
return find_frame_by_pattern(REGS_PATTERN, object, "a RegisterValueContainer")
def find_frame_by_locals_obj(object: TraceObject) -> Optional[Tuple[int, StackFrame]]:
return find_frame_by_pattern(LOCALS_PATTERN, object, "a LocalsContainer")
def find_module_by_base(modbase: TraceObject) -> Module:
for m in commands.prog.modules(): # type: ignore
if modbase == str(hex(m.address_range[0])):
return m
def find_module_by_pattern(pattern: re.Pattern, object: TraceObject,
err_msg: str) -> int:
mat = pattern.fullmatch(object.path)
if mat is None:
raise TypeError(f"{object} is not {err_msg}")
pnum = int(mat['procnum'])
modbase = mat['modbase']
find_proc_by_num(pnum)
return find_module_by_base(modbase)
def find_module_by_obj(object: TraceObject) -> int:
return find_module_by_pattern(MODULE_PATTERN, object, "a Module")
shared_globals: Dict[str, Any] = dict()
@REGISTRY.method()
def execute(cmd: str, to_string: bool = False) -> Optional[str]:
"""Execute a Python3 command or script."""
if to_string:
data = StringIO()
with redirect_stdout(data):
exec(cmd, shared_globals)
return data.getvalue()
else:
exec(cmd, shared_globals)
return None
@REGISTRY.method(action='refresh', display='Refresh Processes')
def refresh_processes(node: ProcessContainer) -> None:
"""Refresh the list of processes."""
with commands.open_tracked_tx('Refresh Processes'):
commands.ghidra_trace_put_processes()
@REGISTRY.method(action='refresh', display='Refresh Environment')
def refresh_environment(node: Environment) -> None:
"""Refresh the environment descriptors (arch, os, endian)."""
with commands.open_tracked_tx('Refresh Environment'):
commands.ghidra_trace_put_environment()
@REGISTRY.method(action='refresh', display='Refresh Threads')
def refresh_threads(node: ThreadContainer) -> None:
"""Refresh the list of threads in the process."""
with commands.open_tracked_tx('Refresh Threads'):
commands.ghidra_trace_put_threads()
# @REGISTRY.method(action='refresh', display='Refresh Symbols')
# def refresh_symbols(node: SymbolContainer) -> None:
# """Refresh the list of symbols in the process."""
# with commands.open_tracked_tx('Refresh Symbols'):
# commands.ghidra_trace_put_symbols()
@REGISTRY.method(action='show_symbol', display='Retrieve Symbols')
def retrieve_symbols(
conainer: SymbolContainer,
pattern: Annotated[str, ParamDesc(display='Pattern')]) -> None:
"""Load the symbol set matching the pattern."""
with commands.open_tracked_tx('Retrieve Symbols'):
commands.put_symbols(pattern)
@REGISTRY.method(action='refresh', display='Refresh Stack')
def refresh_stack(node: Stack) -> None:
"""Refresh the backtrace for the thread."""
tnum = find_thread_by_stack_obj(node)
with commands.open_tracked_tx('Refresh Stack'):
commands.ghidra_trace_put_frames()
@REGISTRY.method(action='refresh', display='Refresh Registers')
def refresh_registers(node: RegisterValueContainer) -> None:
"""Refresh the register values for the selected frame."""
level = find_frame_by_regs_obj(node)
with commands.open_tracked_tx('Refresh Registers'):
commands.ghidra_trace_putreg()
@REGISTRY.method(action='refresh', display='Refresh Locals')
def refresh_locals(node: LocalsContainer) -> None:
"""Refresh the local values for the selected frame."""
level = find_frame_by_locals_obj(node)
with commands.open_tracked_tx('Refresh Registers'):
commands.ghidra_trace_put_locals()
@REGISTRY.method(action='refresh', display='Refresh Memory',
condition=hasattr(drgn, 'RelocatableModule'))
def refresh_mappings(node: Memory) -> None:
"""Refresh the list of memory regions for the process."""
with commands.open_tracked_tx('Refresh Memory Regions'):
commands.ghidra_trace_put_regions()
@REGISTRY.method(action='refresh', display='Refresh Modules',
condition=hasattr(drgn, 'RelocatableModule'))
def refresh_modules(node: ModuleContainer) -> None:
"""Refresh the modules list for the process."""
with commands.open_tracked_tx('Refresh Modules'):
commands.ghidra_trace_put_modules()
@REGISTRY.method(action='activate')
def activate_process(process: Process) -> None:
"""Switch to the process."""
find_proc_by_obj(process)
@REGISTRY.method(action='activate')
def activate_thread(thread: Thread) -> None:
"""Switch to the thread."""
find_thread_by_obj(thread)
@REGISTRY.method(action='activate')
def activate_frame(frame: TraceObject) -> None:
"""Select the frame."""
res = find_frame_by_obj(frame)
if res is None:
return
i, f = res
util.select_frame(i)
with commands.open_tracked_tx('Refresh Stack'):
commands.ghidra_trace_put_frames()
with commands.open_tracked_tx('Refresh Registers'):
commands.ghidra_trace_putreg()
@REGISTRY.method()
def read_mem(process: Process, range: AddressRange) -> None:
"""Read memory."""
# print("READ_MEM: process={}, range={}".format(process, range))
nproc = find_proc_by_obj(process)
offset_start = process.trace.extra.require_mm().map_back(
nproc, Address(range.space, range.min))
with commands.open_tracked_tx('Read Memory'):
result = commands.put_bytes(
offset_start, offset_start + range.length() - 1, pages=True, display_result=False)
if result['count'] == 0:
commands.putmem_state(
offset_start, offset_start+range.length() - 1, 'error')
@REGISTRY.method(action='attach', display='Attach by pid')
def attach_pid(processes: ProcessContainer,
pid: Annotated[str, ParamDesc(display='PID')]) -> None:
"""Attach the process to the given target."""
prog = drgn.Program()
prog.set_pid(int(pid))
util.selected_pid = int(pid)
util.selected_tid = prog.main_thread().tid
default_symbols = {"default": True, "main": True}
try:
prog.load_debug_info(None, **default_symbols)
except drgn.MissingDebugInfoError as e:
print(e)
# commands.ghidra_trace_start(pid)
commands.PROGRAMS[pid] = prog
commands.prog = prog
with commands.open_tracked_tx('Refresh Processes'):
commands.ghidra_trace_put_processes()
@REGISTRY.method(action='attach', display='Attach core dump')
def attach_core(processes: ProcessContainer,
core: Annotated[str, ParamDesc(display='Core dump')]) -> None:
"""Attach the process to the given target."""
prog = drgn.Program()
prog.set_core_dump(core)
default_symbols = {"default": True, "main": True}
try:
prog.load_debug_info(None, **default_symbols)
except drgn.MissingDebugInfoError as e:
print(e)
util.selected_pid += 1
commands.PROGRAMS[util.selected_pid] = prog
commands.prog = prog
with commands.open_tracked_tx('Refresh Processes'):
commands.ghidra_trace_put_processes()
@REGISTRY.method(action='step_into')
def step_into(thread: Thread,
n: Annotated[int, ParamDesc(display='N')] = 1) -> None:
"""Step one instruction exactly."""
find_thread_by_obj(thread)
time.sleep(1)
hooks.on_stop()
# @REGISTRY.method
# def kill(process: Process) -> None:
# """Kill execution of the process."""
# commands.ghidra_trace_kill()
# @REGISTRY.method(action='resume')
# def go(process: Process) -> None:
# """Continue execution of the process."""
# util.dbg.run_async(lambda: dbg().go())
# @REGISTRY.method
# def interrupt(process: Process) -> None:
# """Interrupt the execution of the debugged program."""
# # SetInterrupt is reentrant, so bypass the thread checks
# util.dbg._protected_base._control.SetInterrupt(
# DbgEng.DEBUG_INTERRUPT_ACTIVE)

View file

@ -1,67 +1,21 @@
<context> <context>
<schema name="TTDSession" elementResync="NEVER" attributeResync="NEVER"> <schema name="DrgnRoot" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="EventScope" />
<interface name="FocusScope" />
<interface name="Aggregate" />
<element schema="VOID" />
<attribute name="Processes" schema="ProcessContainer" required="yes" fixed="yes" /> <attribute name="Processes" schema="ProcessContainer" required="yes" fixed="yes" />
<attribute name="Available" schema="AvailableContainer" required="yes" fixed="yes" /> <attribute name="State" schema="ANY" />
<attribute name="_event_thread" schema="OBJECT" hidden="yes" /> <attribute-alias from="_state" to="State" />
<attribute name="_focus" schema="Selectable" required="yes" hidden="yes" />
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY"/>
</schema> </schema>
<schema name="Selectable" elementResync="NEVER" attributeResync="NEVER"> <schema name="Selectable" elementResync="NEVER" attributeResync="NEVER">
<element schema="OBJECT" /> <element schema="OBJECT" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="VOID" />
</schema> </schema>
<schema name="BreakpointContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="BreakpointSpec" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" />
</schema>
<schema name="AvailableContainer" canonical="yes" elementResync="ALWAYS" attributeResync="NEVER">
<element schema="Attachable" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" />
</schema>
<schema name="ProcessContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="ProcessContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="Process" /> <element schema="Process" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY" />
</schema>
<schema name="BreakpointSpec" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="BreakpointSpec" />
<interface name="BreakpointLocation" />
<interface name="Togglable" />
<element schema="VOID" />
<attribute name="Expression" schema="STRING" required="yes" hidden="yes" />
<attribute-alias from="_expression" to="Expression" />
<attribute name="Kinds" schema="STRING" required="yes" hidden="yes" />
<attribute-alias from="_kinds" to="Kinds" />
<attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute name="Range" schema="RANGE" />
<attribute-alias from="_range" to="Range" />
<attribute name="_enabled" schema="BOOL" required="yes" hidden="yes" />
<attribute name="Commands" schema="STRING" />
<attribute name="Condition" schema="STRING" />
<attribute name="Hit Count" schema="INT" />
<attribute name="Ignore Count" schema="INT" />
<attribute name="Pending" schema="BOOL" />
<attribute name="Silent" schema="BOOL" />
<attribute name="Temporary" schema="BOOL" />
<attribute schema="VOID" />
</schema>
<schema name="Attachable" elementResync="NEVER" attributeResync="NEVER">
<element schema="VOID" />
<attribute name="PID" schema="LONG" />
<attribute-alias from="_pid" to="PID" />
<attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" />
</schema> </schema>
<schema name="Process" elementResync="NEVER" attributeResync="NEVER"> <schema name="Process" elementResync="NEVER" attributeResync="NEVER">
<interface name="Activatable" /> <interface name="Activatable" />
@ -70,12 +24,14 @@
<interface name="ExecutionStateful" /> <interface name="ExecutionStateful" />
<element schema="VOID" /> <element schema="VOID" />
<attribute name="Threads" schema="ThreadContainer" required="yes" fixed="yes" /> <attribute name="Threads" schema="ThreadContainer" required="yes" fixed="yes" />
<attribute name="Breakpoints" schema="BreakpointContainer" required="yes" fixed="yes" /> <attribute name="Symbols" schema="SymbolContainer" required="yes" fixed="yes" />
<attribute name="Exit Code" schema="LONG" /> <attribute name="Exit Code" schema="LONG" />
<attribute-alias from="_exit_code" to="Exit Code" /> <attribute-alias from="_exit_code" to="Exit Code" />
<attribute name="Environment" schema="Environment" required="yes" fixed="yes" /> <attribute name="Environment" schema="Environment" required="yes" fixed="yes" />
<attribute name="Memory" schema="Memory" required="yes" fixed="yes" /> <attribute name="Memory" schema="Memory" required="yes" fixed="yes" />
<attribute name="Modules" schema="ModuleContainer" required="yes" fixed="yes" /> <attribute name="Modules" schema="ModuleContainer" required="yes" fixed="yes" />
<attribute name="Handle" schema="STRING" fixed="yes" />
<attribute name="Id" schema="STRING" fixed="yes" />
<attribute name="PID" schema="LONG" hidden="yes" /> <attribute name="PID" schema="LONG" hidden="yes" />
<attribute-alias from="_pid" to="PID" /> <attribute-alias from="_pid" to="PID" />
<attribute name="State" schema="EXECUTION_STATE" required="yes" hidden="yes" /> <attribute name="State" schema="EXECUTION_STATE" required="yes" hidden="yes" />
@ -83,7 +39,7 @@
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_short_display" schema="STRING" hidden="yes" /> <attribute name="_short_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY" />
</schema> </schema>
<schema name="Environment" elementResync="NEVER" attributeResync="NEVER"> <schema name="Environment" elementResync="NEVER" attributeResync="NEVER">
<interface name="Environment" /> <interface name="Environment" />
@ -102,7 +58,7 @@
<schema name="ModuleContainer" canonical="yes" elementResync="ONCE" attributeResync="NEVER"> <schema name="ModuleContainer" canonical="yes" elementResync="ONCE" attributeResync="NEVER">
<element schema="Module" /> <element schema="Module" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY" />
</schema> </schema>
<schema name="Memory" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="Memory" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="Memory" /> <interface name="Memory" />
@ -113,15 +69,7 @@
<schema name="ThreadContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="ThreadContainer" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<element schema="Thread" /> <element schema="Thread" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY" />
</schema>
<schema name="Method" elementResync="NEVER" attributeResync="NEVER">
<interface name="Method" />
<element schema="VOID" />
<attribute name="_display" schema="STRING" required="yes" fixed="yes" hidden="yes" />
<attribute name="_return_type" schema="TYPE" required="yes" fixed="yes" hidden="yes" />
<attribute name="_parameters" schema="MAP_PARAMETERS" required="yes" fixed="yes" hidden="yes" />
<attribute schema="VOID" fixed="yes" hidden="yes" />
</schema> </schema>
<schema name="Thread" elementResync="NEVER" attributeResync="NEVER"> <schema name="Thread" elementResync="NEVER" attributeResync="NEVER">
<interface name="Activatable" /> <interface name="Activatable" />
@ -130,7 +78,8 @@
<interface name="Aggregate" /> <interface name="Aggregate" />
<element schema="VOID" /> <element schema="VOID" />
<attribute name="Stack" schema="Stack" required="yes" fixed="yes" /> <attribute name="Stack" schema="Stack" required="yes" fixed="yes" />
<attribute name="Registers" schema="RegisterValueContainer" required="yes" fixed="yes" /> <attribute name="Environment" schema="ANY" fixed="yes" />
<attribute name="Id" schema="STRING" fixed="yes" />
<attribute name="TID" schema="LONG" /> <attribute name="TID" schema="LONG" />
<attribute-alias from="_tid" to="TID" /> <attribute-alias from="_tid" to="TID" />
<attribute name="State" schema="EXECUTION_STATE" required="yes" hidden="yes" /> <attribute name="State" schema="EXECUTION_STATE" required="yes" hidden="yes" />
@ -138,8 +87,7 @@
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_short_display" schema="STRING" hidden="yes" /> <attribute name="_short_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute name="Advance" schema="Method" required="yes" fixed="yes" hidden="yes" /> <attribute schema="ANY" />
<attribute schema="VOID" />
</schema> </schema>
<schema name="Module" elementResync="NEVER" attributeResync="NEVER"> <schema name="Module" elementResync="NEVER" attributeResync="NEVER">
<interface name="Module" /> <interface name="Module" />
@ -152,17 +100,17 @@
<attribute-alias from="_range" to="Range" /> <attribute-alias from="_range" to="Range" />
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute name="ToDisplayString" schema="BOOL" hidden="yes" />
<attribute schema="ANY" />
</schema> </schema>
<schema name="MemoryRegion" elementResync="NEVER" attributeResync="NEVER"> <schema name="MemoryRegion" elementResync="NEVER" attributeResync="NEVER">
<interface name="MemoryRegion" /> <interface name="MemoryRegion" />
<element schema="VOID" /> <element schema="VOID" />
<attribute name="Base" schema="LONG" required="yes" fixed="yes" />
<attribute name="Object File" schema="STRING" fixed="yes" /> <attribute name="Object File" schema="STRING" fixed="yes" />
<attribute name="_readable" schema="BOOL" required="yes" hidden="yes" /> <attribute name="_readable" schema="BOOL" required="yes" hidden="yes" />
<attribute name="_writable" schema="BOOL" required="yes" hidden="yes" /> <attribute name="_writable" schema="BOOL" required="yes" hidden="yes" />
<attribute name="_executable" schema="BOOL" required="yes" hidden="yes" /> <attribute name="_executable" schema="BOOL" required="yes" hidden="yes" />
<attribute name="Range" schema="RANGE" required="yes" hidden="yes" /> <attribute name="Range" schema="RANGE" required="yes" />
<attribute-alias from="_range" to="Range" /> <attribute-alias from="_range" to="Range" />
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
@ -176,8 +124,9 @@
<schema name="Stack" canonical="yes" elementResync="NEVER" attributeResync="NEVER"> <schema name="Stack" canonical="yes" elementResync="NEVER" attributeResync="NEVER">
<interface name="Stack" /> <interface name="Stack" />
<element schema="StackFrame" /> <element schema="StackFrame" />
<attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="ANY" />
</schema> </schema>
<schema name="SymbolContainer" canonical="yes" elementResync="ONCE" attributeResync="NEVER"> <schema name="SymbolContainer" canonical="yes" elementResync="ONCE" attributeResync="NEVER">
<element schema="Symbol" /> <element schema="Symbol" />
@ -197,12 +146,11 @@
<element schema="VOID" /> <element schema="VOID" />
<attribute name="Function" schema="STRING" hidden="yes" /> <attribute name="Function" schema="STRING" hidden="yes" />
<attribute-alias from="_function" to="Function" /> <attribute-alias from="_function" to="Function" />
<attribute name="PC" schema="ADDRESS" required="yes" />
<attribute-alias from="_pc" to="PC" />
<attribute name="SP" schema="ADDRESS" />
<attribute name="Registers" schema="RegisterValueContainer" required="yes" fixed="yes" /> <attribute name="Registers" schema="RegisterValueContainer" required="yes" fixed="yes" />
<attribute name="Instruction Offset" schema="ADDRESS" required="yes" /> <attribute name="Locals" schema="LocalsContainer" required="yes" fixed="yes" />
<attribute-alias from="_pc" to="Instruction Offset" />
<attribute name="Stack Offset" schema="ADDRESS" />
<attribute name="Return Offset" schema="ADDRESS" />
<attribute name="Frame Offset" schema="ADDRESS" />
<attribute name="_display" schema="STRING" hidden="yes" /> <attribute name="_display" schema="STRING" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" /> <attribute schema="ANY" />
@ -219,15 +167,17 @@
</schema> </schema>
<schema name="RegisterValueContainer" attributeResync="ONCE"> <schema name="RegisterValueContainer" attributeResync="ONCE">
<interface name="RegisterContainer" /> <interface name="RegisterContainer" />
<attribute name="General Purpose Registers" schema="RegisterBank" />
<attribute name="Floating Point Registers" schema="RegisterBank" />
<attribute name="Advanced Vector Extensions" schema="RegisterBank" />
<attribute name="Memory Protection Extensions" schema="RegisterBank" />
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="VOID" />
</schema> </schema>
<schema name="RegisterBank" canonical="yes" elementResync="ONCE" attributeResync="NEVER"> <schema name="LocalsContainer" attributeResync="ONCE">
<attribute name="_order" schema="INT" hidden="yes" /> <attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="VOID" /> <attribute schema="Local" />
</schema>
<schema name="Local" attributeResync="ONCE">
<attribute name="Address" schema="ADDRESS" />
<attribute name="Kind" schema="ANY" hidden="yes" />
<attribute name="_order" schema="INT" hidden="yes" />
<attribute schema="ANY" />
</schema> </schema>
</context> </context>

View file

@ -0,0 +1,119 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
from collections import namedtuple
from dataclasses import dataclass
import os
import re
import sys
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
import drgn
import drgn.cli
DrgnVersion = namedtuple('DrgnVersion', ['display', 'full'])
selected_pid = 0
selected_tid = 0
selected_level = 0
def _compute_drgn_ver() -> DrgnVersion:
blurb = drgn.cli.version_header()
top = blurb.split('\n')[0]
full = top.split()[1] # "drgn x.y.z"
return DrgnVersion(top, full)
DRGN_VERSION = _compute_drgn_ver()
@dataclass(frozen=True)
class Region:
start: int
end: int
offset: int
perms: Optional[str]
objfile: str
def full_mem(self) -> Region:
return Region(0, 1 << 64, 0, None, 'full memory')
def get_debugger():
return drgn
def selected_process() -> int:
return selected_pid
def selected_thread() -> int:
return selected_tid
def selected_frame() -> int:
return selected_level
def select_process(id: int) -> int:
global selected_pid
selected_pid = id
return selected_pid
def select_thread(id: int) -> int:
global selected_tid
selected_tid = id
return selected_tid
def select_frame(id: int) -> int:
global selected_level
selected_level = id
return selected_level
conv_map: Dict[str, Any] = {}
def get_convenience_variable(id: str):
# val = get_target().GetEnvironment().Get(id)
if id not in conv_map:
return "auto"
val = conv_map[id]
if val is None:
return "auto"
return val
def set_convenience_variable(id: str, value: Any) -> None:
# env = get_target().GetEnvironment()
# return env.Set(id, value, True)
conv_map[id] = value
def escape_ansi(line: str) -> str:
ansi_escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
return ansi_escape.sub('', line)
def debracket(init: str) -> str:
val = init
val = val.replace("[", "(")
val = val.replace("]", ")")
return val

View file

@ -13,8 +13,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
// Not technically a Java project, but required to be a Help project
apply from: "${rootProject.projectDir}/gradle/javaProject.gradle"
apply from: "${rootProject.projectDir}/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle" apply from: "$rootProject.projectDir/gradle/hasPythonPackage.gradle"
apply plugin: 'eclipse' apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-agent-gdb' eclipse.project.name = 'Debug Debugger-agent-gdb'
dependencies {
// Only for Help :/
api project(':Debugger-rmi-trace')
}

View file

@ -2,18 +2,17 @@
##MODULE IP: JSch License ##MODULE IP: JSch License
Module.manifest||GHIDRA||||END| Module.manifest||GHIDRA||||END|
README.md||GHIDRA||||END| README.md||GHIDRA||||END|
data/debugger-launchers/local-gdb.bat||GHIDRA||||END|
data/debugger-launchers/qemu-sys-gdb.bat||GHIDRA||||END|
data/debugger-launchers/remote-gdb.bat||GHIDRA||||END|
data/debugger-launchers/ssh-gdb.bat||GHIDRA||||END|
data/debugger-launchers/ssh-gdbserver.bat||GHIDRA||||END|
data/scripts/fallback_info_proc_mappings.gdb||GHIDRA||||END| data/scripts/fallback_info_proc_mappings.gdb||GHIDRA||||END|
data/scripts/fallback_maintenance_info_sections.gdb||GHIDRA||||END| data/scripts/fallback_maintenance_info_sections.gdb||GHIDRA||||END|
data/scripts/getpid-linux-i386.gdb||GHIDRA||||END| data/scripts/getpid-linux-i386.gdb||GHIDRA||||END|
data/scripts/wine32_info_proc_mappings.gdb||GHIDRA||||END| data/scripts/wine32_info_proc_mappings.gdb||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/gdb/gdb.html||GHIDRA||||END|
src/main/help/help/topics/gdb/images/GdbLauncher.png||GHIDRA||||END|
src/main/py/LICENSE||GHIDRA||||END| src/main/py/LICENSE||GHIDRA||||END|
src/main/py/MANIFEST.in||GHIDRA||||END| src/main/py/MANIFEST.in||GHIDRA||||END|
src/main/py/README.md||GHIDRA||||END| src/main/py/README.md||GHIDRA||||END|
src/main/py/pyproject.toml||GHIDRA||||END| src/main/py/pyproject.toml||GHIDRA||||END|
src/main/py/src/ghidragdb/py.typed||GHIDRA||||END|
src/main/py/src/ghidragdb/schema.xml||GHIDRA||||END| src/main/py/src/ghidragdb/schema.xml||GHIDRA||||END|
src/main/py/tests/EMPTY||GHIDRA||||END| src/main/py/tests/EMPTY||GHIDRA||||END|

View file

@ -1,67 +0,0 @@
::@title gdb
::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>gdb</tt></h3>
::@desc <p>
::@desc This will launch the target on the local machine using <tt>gdb</tt>.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group local
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#gdb
::@enum StartCmd:str run start starti
::@enum Endian:str auto big little
::@env OPT_TARGET_IMG:file="" "Image" "The target binary executable image"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
::@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
@echo off
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
IF EXIST %GHIDRA_HOME%\.git (
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
IF EXIST %GHIDRA_HOME%\ghidra\.git (
set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
IF "%OPT_TARGET_IMG%"=="" (
"%OPT_GDB_PATH%" ^
-q ^
-ex "set pagination off" ^
-ex "set confirm off" ^
-ex "show version" ^
-ex "python import ghidragdb" ^
-ex "set architecture %OPT_ARCH%" ^
-ex "set endian %OPT_ENDIAN%" ^
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
-ex "ghidra trace start" ^
-ex "ghidra trace sync-enable" ^
-ex "set confirm on" ^
-ex "set pagination on"
) ELSE (
"%OPT_GDB_PATH%" ^
-q ^
-ex "set pagination off" ^
-ex "set confirm off" ^
-ex "show version" ^
-ex "python import ghidragdb" ^
-ex "set architecture %OPT_ARCH%" ^
-ex "set endian %OPT_ENDIAN%" ^
-ex "target exec %OPT_TARGET_IMG%" ^
-ex "set args %OPT_TARGET_ARGS%" ^
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
-ex "ghidra trace start" ^
-ex "ghidra trace sync-enable" ^
-ex "%OPT_START_CMD%" ^
-ex "set confirm on" ^
-ex "set pagination on"
)

View file

@ -0,0 +1,49 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb
#@image-opt arg:1
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>gdb</tt></h3>
#@desc <p>
#@desc This will launch the target on the local machine using <tt>gdb</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#local
#@depends Debugger-rmi-trace
#@enum StartCmd:str run start starti
#@enum Endian:str auto big little
#@arg :file "Image" "The target binary executable image"
#@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
#@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
. ..\support\gdbsetuputils.ps1
$pypathTrace = Ghidra-Module-PyPath "Debugger-rmi-trace"
$pypathGdb = Ghidra-Module-PyPath
$Env:PYTHONPATH = "$pypathGdb;$pypathTrace;$Env:PYTHONPATH"
$arglist = Compute-Gdb-Usermode-Args `
-TargetImage $args[0] `
-RmiAddress "$Env:GHIDRA_TRACE_RMI_ADDR"
Start-Process -FilePath $arglist[0] -ArgumentList $arglist[1..$arglist.Count] `
-NoNewWindow -Wait

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -23,9 +23,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group local #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb #@help gdb#local
#@depends Debugger-rmi-trace
#@enum StartCmd:str run start starti #@enum StartCmd:str run start starti
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :file "Image" "The target binary executable image, empty for no target" #@arg :file "Image" "The target binary executable image, empty for no target"
@ -37,57 +38,19 @@
#@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target."
#@tty TTY_TARGET if env:OPT_EXTRA_TTY #@tty TTY_TARGET if env:OPT_EXTRA_TTY
if [ -d ${GHIDRA_HOME}/ghidra/.git ] . ../support/gdbsetuputils.sh
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH pypathGdb=$(ghidra-module-pypath)
elif [ -d ${GHIDRA_HOME}/.git ] export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
target_image="$1" target_image="$1"
shift shift
target_args="$@"
# Ghidra will leave TTY_TARGET empty when OPT_EXTRA_TTY is false. Gdb takes empty to mean the same terminal. function launch-gdb() {
local -a args
compute-gdb-usermode-args "$target_image" "$GHIDRA_TRACE_RMI_ADDR" "$@"
if [ -z "$target_image" ] "${args[@]}"
then }
"$OPT_GDB_PATH" \ launch-gdb "$@"
-q \
-ex "set pagination off" \
-ex "set confirm off" \
-ex "show version" \
-ex "python import ghidragdb" \
-ex "set architecture $OPT_ARCH" \
-ex "set endian $OPT_ENDIAN" \
-ex "set inferior-tty $TTY_TARGET" \
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
-ex "ghidra trace start" \
-ex "ghidra trace sync-enable" \
-ex "set confirm on" \
-ex "set pagination on"
else
"$OPT_GDB_PATH" \
-q \
-ex "set pagination off" \
-ex "set confirm off" \
-ex "show version" \
-ex "python import ghidragdb" \
-ex "set architecture $OPT_ARCH" \
-ex "set endian $OPT_ENDIAN" \
-ex "file \"$target_image\"" \
-ex "set args $target_args" \
-ex "set inferior-tty $TTY_TARGET" \
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
-ex "ghidra trace start" \
-ex "ghidra trace sync-enable" \
-ex "$OPT_START_CMD" \
-ex "set confirm on" \
-ex "set pagination on"
fi

View file

@ -0,0 +1,66 @@
#!/usr/bin/env bash
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb-rr
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>rr/gdb</tt></h3>
#@desc <p>
#@desc This will open a trace of a target on the local machine using <tt>rr/gdb</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#rr
#@depends Debugger-rmi-trace
#@enum StartCmd:str run start starti
#@enum Endian:str auto big little
#@arg :file "Trace Dir" "The target trace directory (e.g. .local/share/rr/trace)"
#@env OPT_RR_PATH:file="rr" "rr command" "The path to rr. Omit the full path to resolve using the system PATH."
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
#@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target."
#@tty TTY_TARGET if env:OPT_EXTRA_TTY
. ../support/gdbsetuputils.sh
pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
pypathGdb=$(ghidra-module-pypath)
export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
target_trace="$1"
# Ghidra will leave TTY_TARGET empty when OPT_EXTRA_TTY is false. Gdb takes empty to mean the same terminal.
RRINIT=$(mktemp)
echo '
set pagination off
set confirm off
set $use_trace="true"
show version
python import ghidragdb
set architecture ' $OPT_ARCH '
set endian ' $OPT_ENDIAN '
set inferior-tty ' $TTY_TARGET '
ghidra trace connect ' $GHIDRA_TRACE_RMI_ADDR '
ghidra trace start
ghidra trace sync-enable
set confirm on
set pagination on
' > $RRINIT
"$OPT_RR_PATH" replay -x $RRINIT "$target_trace"

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@title qemu + gdb #@title gdb + qemu
#@image-opt arg:1 #@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
#@desc <h3>Launch with <tt>qemu</tt> and connect with <tt>gdb</tt></h3> #@desc <h3>Launch with <tt>qemu</tt> and connect with <tt>gdb</tt></h3>
@ -24,9 +24,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group cross #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_qemu #@help gdb#qemu
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :file! "Image" "The target binary executable image" #@arg :file! "Image" "The target binary executable image"
#@args "Arguments" "Command-line arguments to pass to the target" #@args "Arguments" "Command-line arguments to pass to the target"
@ -40,58 +41,33 @@
#@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)." #@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)."
#@tty TTY_TARGET if env:OPT_EXTRA_TTY #@tty TTY_TARGET if env:OPT_EXTRA_TTY
if [ -d ${GHIDRA_HOME}/ghidra/.git ] . ../support/gdbsetuputils.sh
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH pypathGdb=$(ghidra-module-pypath)
elif [ -d ${GHIDRA_HOME}/.git ] export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
target_image="$1" target_image="$1"
# No need to put QEMU_GDB on command line. It's already a recognized environment variable. # No need to put QEMU_GDB on command line. It's already a recognized environment variable.
if [ -z "$TTY_TARGET" ] if [ -z "$TTY_TARGET" ]
then then
"$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS $@ & "$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS "$@" &
else else
"$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS $@ <$TTY_TARGET >$TTY_TARGET 2>&1 & "$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS "$@" <$TTY_TARGET >$TTY_TARGET 2>&1 &
fi fi
# Give QEMU a moment to open the socket # Give QEMU a moment to open the socket
sleep 0.1 sleep 0.1
gdb_args=( function launch-gdb() {
-q local -a args
-ex "set pagination off" compute-gdb-remote-args "$target_image" "remote localhost:$QEMU_GDB" "$GHIDRA_TRACE_RMI_ADDR"
-ex "set confirm off"
-ex "show version"
-ex "python import ghidragdb"
-ex "set architecture $OPT_ARCH"
-ex "set endian $OPT_ENDIAN"
-ex "file \"$target_image\""
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\""
-ex "ghidra trace start"
-ex "ghidra trace sync-enable"
-ex "target remote localhost:$QEMU_GDB"
-ex "set confirm on"
-ex "set pagination on"
)
# If using OPT_PULL_ALL_SECTIONS, append instructions to push all sections from qemu if [ "$OPT_PULL_ALL_SECTIONS" = "true" ]; then
if [ "$OPT_PULL_ALL_SECTIONS" = "true" ] args+=(-ex "ghidra trace tx-open 'Put Sections' 'ghidra trace put-sections -all-objects'")
then
gdb_args+=(
-ex "ghidra trace tx-start put-all-sections"
-ex "ghidra trace put-sections -all-objects"
-ex "ghidra trace tx-commit"
)
fi fi
IFS="" "${args[@]}"
"$OPT_GDB_PATH" ${gdb_args[*]} }
launch-gdb

View file

@ -1,60 +0,0 @@
::@title qemu-system + gdb
::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>qemu-system</tt> and connect with <tt>gdb</tt></h3>
::@desc <p>
::@desc This will launch the target on the local machine using <tt>qemu-system</tt>.
::@desc Then in a second terminal, it will connect <tt>gdb</tt> to QEMU's GDBstub.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group cross
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#gdb_qemu
::@enum Endian:str auto big little
::@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image"
::@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture."
::@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu"
::@env OPT_EXTRA_QEMU_ARGS:str="" "Extra qemu arguments" "Extra arguments to pass to qemu. Use with care."
::@env OPT_GDB_PATH:file="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
::@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
::@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for qemu."
@echo off
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
IF EXIST %GHIDRA_HOME%\.git (
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
IF EXIST %GHIDRA_HOME%\ghidra\.git (
set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
IF "%OPT_EXTRA_TTY%"=="true" (
start "qemu" "%GHIDRA_LANG_EXTTOOL_qemu_system%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%"
) ELSE (
start /B "qemu" "%GHIDRA_LANG_EXTTOOL_qemu_system%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%"
)
:: Give QEMU a moment to open the socket
powershell -nop -c "& {sleep -m 100}"
"%OPT_GDB_PATH%" ^
-q ^
-ex "set pagination off" ^
-ex "set confirm off" ^
-ex "show version" ^
-ex "python import ghidragdb" ^
ex "set architecture %OPT_ARCH%" ^
ex "set endian %OPT_ENDIAN%" ^
-ex "target exec '%OPT_TARGET_IMG%'" ^
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
-ex "ghidra trace start" ^
-ex "ghidra trace sync-enable" ^
-ex "target remote localhost:%QEMU_GDB%" ^
-ex "set confirm on" ^
-ex "set pagination on"

View file

@ -0,0 +1,68 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb + qemu-system
#@image-opt env:OPT_TARGET_IMG
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>qemu-system</tt> and connect with <tt>gdb</tt></h3>
#@desc <p>
#@desc This will launch the target on the local machine using <tt>qemu-system</tt>.
#@desc Then in a second terminal, it will connect <tt>gdb</tt> to QEMU's GDBstub.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#qemu
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little
#@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image"
#@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture."
#@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu"
#@env OPT_EXTRA_QEMU_ARGS:str="" "Extra qemu arguments" "Extra arguments to pass to qemu. Use with care."
#@env OPT_GDB_PATH:file="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
#@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for qemu."
. ..\support\gdbsetuputils.ps1
$pypathTrace = Ghidra-Module-PyPath "Debugger-rmi-trace"
$pypathGdb = Ghidra-Module-PyPath
$Env:PYTHONPATH = "$pypathGdb;$pypathTrace;$Env:PYTHONPATH"
$qemuargs = @("`"$Env:GHIDRA_LANG_EXTTOOL_qemu_system`"")
if ("$Env:OPT_EXTRA_QEMU_ARGS" -ne "") {
$qemuargs+=("$Env:OPT_EXTRA_QEMU_ARGS")
}
$qemuargs+=("-gdb", "tcp::$Env:QEMU_GDB", "-S")
$qemuargs+=("`"$Env:OPT_TARGET_IMG`"")
if ("$Env:OPT_EXTRA_TTY" -eq "true") {
Start-Process -FilePath $qemuargs[0] -ArgumentList $qemuargs[1..$qemuargs.Count]
}
else {
Start-Process -FilePath $qemuargs[0] -ArgumentList $qemuargs[1..$qemuargs.Count] -NoNewWindow
}
# Give QEMU a moment to open the socket
sleep -m 100
$arglist = Compute-Gdb-Remote-Args `
-TargetImage $args[0] `
-TargetCx "remote localhost:$Env:QEMU_GDB" `
-RmiAddress "$Env:GHIDRA_TRACE_RMI_ADDR"
Start-Process -FilePath $arglist[0] -ArgumentList $arglist[1..$arglist.Count] -NoNewWindow -Wait

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@title qemu-system + gdb #@title gdb + qemu-system
#@image-opt arg:1 #@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
#@desc <h3>Launch with <tt>qemu-system</tt> and connect with <tt>gdb</tt></h3> #@desc <h3>Launch with <tt>qemu-system</tt> and connect with <tt>gdb</tt></h3>
@ -24,9 +24,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group cross #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_qemu #@help gdb#qemu
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :file! "Image" "The target binary executable image" #@arg :file! "Image" "The target binary executable image"
#@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture." #@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture."
@ -39,57 +40,32 @@
#@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)." #@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)."
#@tty TTY_TARGET if env:OPT_EXTRA_TTY #@tty TTY_TARGET if env:OPT_EXTRA_TTY
if [ -d ${GHIDRA_HOME}/ghidra/.git ] . ../support/gdbsetuputils.sh
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH pypathGdb=$(ghidra-module-pypath)
elif [ -d ${GHIDRA_HOME}/.git ] export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
target_image="$1" target_image="$1"
if [ -z "$TTY_TARGET" ] if [ -z "$TTY_TARGET" ]
then then
"$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 & "$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $target_image &
else else
"$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 <$TTY_TARGET >$TTY_TARGET 2>&1 & "$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $target_image <$TTY_TARGET >$TTY_TARGET 2>&1 &
fi fi
# Give QEMU a moment to open the socket # Give QEMU a moment to open the socket
sleep 0.1 sleep 0.1
gdb_args=( function launch-gdb() {
-q local -a args
-ex "set pagination off" compute-gdb-remote-args "$target_image" "remote localhost:$QEMU_GDB" "$GHIDRA_TRACE_RMI_ADDR"
-ex "set confirm off"
-ex "show version"
-ex "python import ghidragdb"
-ex "set architecture $OPT_ARCH"
-ex "set endian $OPT_ENDIAN"
-ex "file \"$target_image\""
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\""
-ex "ghidra trace start"
-ex "ghidra trace sync-enable"
-ex "target remote localhost:$QEMU_GDB"
-ex "set confirm on"
-ex "set pagination on"
)
# If using OPT_PULL_ALL_SECTIONS, append instructions to push all sections from qemu if [ "$OPT_PULL_ALL_SECTIONS" = "true" ]; then
if [ "$OPT_PULL_ALL_SECTIONS" = "true" ] args+=(-ex "ghidra trace tx-open 'Put Sections' 'ghidra trace put-sections -all-objects'")
then
gdb_args+=(
-ex "ghidra trace tx-start put-all-sections"
-ex "ghidra trace put-sections -all-objects"
-ex "ghidra trace tx-commit"
)
fi fi
IFS="" "${args[@]}"
"$OPT_GDB_PATH" ${gdb_args[*]} }
launch-gdb

View file

@ -1,49 +0,0 @@
::@title remote gdb
::@desc <html><body width="300px">
::@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3>
::@desc <p>
::@desc This will start <tt>gdb</tt> on the local system and then use it to connect to the remote system.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group remote
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#gdb_remote
::@enum TargetType:str remote extended-remote
::@enum Endian:str auto big little
::@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target"
::@env OPT_HOST:str="localhost" "Host" "The hostname of the target"
::@env OPT_PORT:int=9999 "Port" "The host's listening port"
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
::@env OPT_ARCH:str="auto" "Architecture" "Target architecture override"
::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
@echo off
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
IF EXIST %GHIDRA_HOME%\.git (
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
IF EXIST %GHIDRA_HOME%\ghidra\.git (
set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
"%OPT_GDB_PATH%" ^
-q ^
-ex "set pagination off" ^
-ex "set confirm off" ^
-ex "show version" ^
-ex "python import ghidragdb" ^
-ex "set architecture %OPT_ARCH%" ^
ex "set endian %OPT_ENDIAN%" ^
-ex "echo Connecting to %OPT_HOST%:%OPT_PORT%... " ^
-ex "target %OPT_TARGET_TYPE% %OPT_HOST%:%OPT_PORT%" ^
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
-ex "ghidra trace start" ^
-ex "ghidra trace sync-enable" ^
-ex "ghidra trace sync-synth-stopped" ^
-ex "set confirm on" ^
-ex "set pagination on"

View file

@ -0,0 +1,50 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb remote
#@image-opt arg:1
#@desc <html><body width="300px">
#@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3>
#@desc <p>
#@desc This will start <tt>gdb</tt> on the local system and then use it to connect to the remote system.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#remote
#@depends Debugger-rmi-trace
#@enum TargetType:str remote extended-remote
#@enum Endian:str auto big little
#@arg :file "Image" "The target binary executable image (a copy on the local system)"
#@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target"
#@env OPT_HOST:str="localhost" "Host" "The hostname of the target"
#@env OPT_PORT:int=9999 "Port" "The host's listening port"
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture override"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
. ..\support\gdbsetuputils.ps1
$pypathTrace = Ghidra-Module-PyPath "Debugger-rmi-trace"
$pypathGdb = Ghidra-Module-PyPath
$Env:PYTHONPATH = "$pypathGdb;$pypathTrace;$Env:PYTHONPATH"
$arglist = Compute-Gdb-Remote-Args `
-TargetImage $args[0] `
-TargetCx "$Env:OPT_TARGET_TYPE $Env:OPT_HOST`:$Env:OPT_PORT" `
-RmiAddress "$Env:GHIDRA_TRACE_RMI_ADDR"
Start-Process -FilePath $arglist[0] -ArgumentList $arglist[1..$arglist.Count] -NoNewWindow -Wait

View file

@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@title remote gdb #@title gdb remote
#@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
#@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3> #@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3>
#@desc <p> #@desc <p>
@ -22,11 +23,13 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group remote #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_remote #@help gdb#remote
#@depends Debugger-rmi-trace
#@enum TargetType:str remote extended-remote #@enum TargetType:str remote extended-remote
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :file "Image" "The target binary executable image (a copy on the local system)"
#@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target" #@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target"
#@env OPT_HOST:str="localhost" "Host" "The hostname of the target" #@env OPT_HOST:str="localhost" "Host" "The hostname of the target"
#@env OPT_PORT:int=9999 "Port" "The host's listening port" #@env OPT_PORT:int=9999 "Port" "The host's listening port"
@ -34,32 +37,18 @@
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture override" #@env OPT_ARCH:str="auto" "Architecture" "Target architecture override"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
if [ -d ${GHIDRA_HOME}/ghidra/.git ] . ../support/gdbsetuputils.sh
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
elif [ -d ${GHIDRA_HOME}/.git ]
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
"$OPT_GDB_PATH" \ pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
-q \ pypathGdb=$(ghidra-module-pypath)
-ex "set pagination off" \ export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
-ex "set confirm off" \
-ex "show version" \ target_image="$1"
-ex "python import ghidragdb" \
-ex "set architecture $OPT_ARCH" \ function launch-gdb() {
-ex "set endian $OPT_ENDIAN" \ local -a args
-ex "echo Connecting to $OPT_HOST:$OPT_PORT... " \ compute-gdb-remote-args "$target_image" "$OPT_TARGET_TYPE $OPT_HOST:$OPT_PORT" "$GHIDRA_TRACE_RMI_ADDR"
-ex "target $OPT_TARGET_TYPE $OPT_HOST:$OPT_PORT" \
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ "${args[@]}"
-ex "ghidra trace start" \ }
-ex "ghidra trace sync-enable" \ launch-gdb
-ex "ghidra trace sync-synth-stopped" \
-ex "set confirm on" \
-ex "set pagination on"

View file

@ -1,62 +0,0 @@
::@timeout 60000
::@title gdb via ssh
::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px">
::@desc <h3>Launch with <tt>gdb</tt> via <tt>ssh</tt></h3>
::@desc <p>
::@desc This will launch the target on a remote machine using <tt>gdb</tt> via <tt>ssh</tt>.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group remote
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#gdb_ssh
::@enum StartCmd:str run start starti
::@enum Endian:str auto big little
::@env OPT_TARGET_IMG:str="" "Image" "The target binary executable image on the remote system"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
::@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
::@env OPT_REMOTE_PORT:int=12345 "Remote Trace RMI Port" "A free port on the remote end to receive and forward the Trace RMI connection."
::@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
::@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH."
::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
@echo off
IF "%OPT_TARGET_IMG%" == "" (
set cmd=TERM='%TERM%' '%OPT_GDB_PATH%' ^
-q ^
-ex 'set pagination off' ^
-ex 'set confirm off' ^
-ex 'show version' ^
-ex 'python import ghidragdb' ^
-ex 'set architecture %OPT_ARCH%' ^
ex 'set endian %OPT_ENDIAN%' ^
-ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^
-ex 'ghidra trace start' ^
-ex 'ghidra trace sync-enable' ^
-ex 'set confirm on' ^
-ex 'set pagination on'
) ELSE (
set cmd=TERM='%TERM%' '%OPT_GDB_PATH%' ^
-q ^
-ex 'set pagination off' ^
-ex 'set confirm off' ^
-ex 'show version' ^
-ex 'python import ghidragdb' ^
-ex 'set architecture %OPT_ARCH%' ^
ex 'set endian %OPT_ENDIAN%' ^
-ex 'file \"%OPT_TARGET_IMG%\"' ^
-ex 'set args %OPT_TARGET_ARGS%' ^
-ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^
-ex 'ghidra trace start' ^
-ex 'ghidra trace sync-enable' ^
-ex '%OPT_START_CMD%' ^
-ex 'set confirm on' ^
-ex 'set pagination on'
)
"%OPT_SSH_PATH%" "-R%OPT_REMOTE_PORT%:%GHIDRA_TRACE_RMI_ADDR%" -t %OPT_EXTRA_SSH_ARGS% "%OPT_HOST%" "%cmd%"

View file

@ -0,0 +1,85 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb via ssh
#@image-opt arg:1
#@desc <html><body width="300px">
#@desc <h3>Launch with <tt>gdb</tt> via <tt>ssh</tt></h3>
#@desc <p>
#@desc This will launch the target on a remote machine using <tt>gdb</tt> via <tt>ssh</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#ssh
#@depends Debugger-rmi-trace
#@enum StartCmd:str run start starti
#@enum Endian:str auto big little
#@arg :str "Image" "The target binary executable image on the remote system"
#@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
#@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
#@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
#@env OPT_REMOTE_PORT:int=12345 "Remote Trace RMI Port" "A free port on the remote end to receive and forward the Trace RMI connection."
#@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
#@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH."
#@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
. ..\support\gdbsetuputils.ps1
$arglist = Compute-Gdb-Usermode-Args -TargetImage $args[0] -RmiAddress "localhost:$Env:OPT_REMOTE_PORT"
$sshargs = Compute-Ssh-Args $arglist True
$sshproc = Start-Process -FilePath $sshargs[0] -ArgumentList $sshargs[1..$sshargs.Count] -NoNewWindow -Wait -PassThru
$version = Get-Ghidra-Version
$answer = Check-Result-And-Prompt-Mitigation $sshproc @"
It appears ghidragdb is missing from the remote system. This can happen if you
forgot to install the required package. This can also happen if you installed
the packages to a different Python environment than is being used by the
remote's gdb.
This script is about to offer automatic resolution. If you'd like to resolve
this manually, answer no to the next question and then see Ghidra's help by
pressing F1 in the dialog of launch parameters.
WARNING: Answering yes to the next question will invoke pip to try to install
missing or incorrectly-versioned dependencies. It may attempt to find packages
from the PyPI mirror configured on the REMOTE system. If you have not configured
one, it will connect to the official one.
WARNING: We invoke pip with the --break-system-packages flag, because some
debuggers that embed Python (gdb, lldb) may not support virtual environments,
and so the packages must be installed to your user environment.
NOTE: This will copy Python wheels into the HOME directory of the user on the
remote system. You may be prompted to authenticate a few times while packages
are copied and installed.
NOTE: Automatic resolution will cause this session to terminate. When it has
finished, try launching again.
"@ "Would you like to install 'ghidragdb>=$version'?"
if ($answer) {
Write-Host "Copying Wheels to $Env:OPT_HOST"
Mitigate-Scp-PyModules "Debugger-rmi-trace" "<SELF>"
Write-Host "Installing Wheels into GDB's embedded Python"
$arglist = Compute-Gdb-PipInstall-Args "'-f'" "os.environ['HOME']" "'ghidragdb>=$version'"
$sshargs = Compute-Ssh-Args $arglist False
Start-Process -FilePath $sshargs[0] -ArgumentList $sshargs[1..$sshargs.Count] -NoNewWindow -Wait
}

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@timeout 60000
#@title gdb via ssh #@title gdb via ssh
#@image-opt arg:1 #@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
@ -24,9 +23,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group remote #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_ssh #@help gdb#ssh
#@depends Debugger-rmi-trace
#@enum StartCmd:str run start starti #@enum StartCmd:str run start starti
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :str "Image" "The target binary executable image on the remote system" #@arg :str "Image" "The target binary executable image on the remote system"
@ -40,40 +40,61 @@
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" #@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
. ../support/gdbsetuputils.sh
target_image="$1" target_image="$1"
shift shift
target_args="$@"
if [ -z "$target_image" ] function launch-gdb-ssh() {
then local -a args
"$OPT_SSH_PATH" "-R$OPT_REMOTE_PORT:$GHIDRA_TRACE_RMI_ADDR" -t $OPT_EXTRA_SSH_ARGS "$OPT_HOST" "TERM='$TERM' '$OPT_GDB_PATH' \ compute-gdb-usermode-args "$target_image" "localhost:$OPT_REMOTE_PORT" "$@"
-q \ local -a sshargs
-ex 'set pagination off' \ compute-ssh-args true "${args[@]}"
-ex 'set confirm off' \
-ex 'show version' \ "${sshargs[@]}"
-ex 'python import ghidragdb' \ }
-ex 'set architecture $OPT_ARCH' \ version=$(get-ghidra-version)
-ex 'set endian $OPT_ENDIAN' \
-ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \ function do-installation() {
-ex 'ghidra trace start' \ local -a pipargs
-ex 'ghidra trace sync-enable' \ compute-gdb-pipinstall-args "'-f'" "os.environ['HOME']" "'ghidragdb>=$version'"
-ex 'set confirm on' \ local -a sshargs
-ex 'set pagination on'" compute-ssh-args false "${pipargs[@]}"
else
"$OPT_SSH_PATH" "-R$OPT_REMOTE_PORT:$GHIDRA_TRACE_RMI_ADDR" -t $OPT_EXTRA_SSH_ARGS "$OPT_HOST" "TERM='$TERM' '$OPT_GDB_PATH' \ "${sshargs[@]}"
-q \ }
-ex 'set pagination off' \
-ex 'set confirm off' \ launch-gdb-ssh "$@"
-ex 'show version' \ if check-result-and-prompt-mitigation $? "
-ex 'python import ghidragdb' \ It appears ghidragdb is missing from the remote system. This can happen if you
-ex 'set architecture $OPT_ARCH' \ forgot to install the required package. This can also happen if you installed
-ex 'set endian $OPT_ENDIAN' \ the packages to a different Python environment than is being used by the
-ex 'file \"$target_image\"' \ remote's gdb.
-ex 'set args $target_args' \
-ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \ This script is about to offer automatic resolution. If you'd like to resolve
-ex 'ghidra trace start' \ this manually, answer no to the next question and then see Ghidra's help by
-ex 'ghidra trace sync-enable' \ pressing F1 in the dialog of launch parameters.
-ex '$OPT_START_CMD' \
-ex 'set confirm on' \ WARNING: Answering yes to the next question will invoke pip to try to install
-ex 'set pagination on'" missing or incorrectly-versioned dependencies. It may attempt to find packages
from the PyPI mirror configured on the REMOTE system. If you have not configured
one, it will connect to the official one.
WARNING: We invoke pip with the --break-system-packages flag, because some
debuggers that embed Python (gdb, lldb) may not support virtual environments,
and so the packages must be installed to your user environment.
NOTE: This will copy Python wheels into the HOME directory of the user on the
remote system. You may be prompted to authenticate a few times while packages
are copied and installed.
NOTE: Automatic resolution will cause this session to terminate. When it has
finished, try launching again.
" "Would you like to install 'ghidragdb>=$version'?"; then
echo "Copying Wheels to $OPT_HOST"
mitigate-scp-pymodules "Debugger-rmi-trace" "<SELF>"
echo "Installing Wheels into GDB's embedded Python"
do-installation
fi fi

View file

@ -1,53 +0,0 @@
::@timeout 60000
::@title gdb + gdbserver via ssh
::@image-opt env:OPT_TARGET_IMG
::@desc <html><body width="300px">
::@desc <h3>Launch with local <tt>gdb</tt> and <tt>gdbserver</tt> via <tt>ssh</tt></h3>
::@desc <p>
::@desc This will start <tt>gdb</tt> on the local system and then use it to connect and launch the target in <tt>gdbserver</tt> on the remote system via <tt>ssh</tt>.
::@desc For setup instructions, press <b>F1</b>.
::@desc </p>
::@desc </body></html>
::@menu-group remote
::@icon icon.debugger
::@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh
::@enum Endian:str auto big little
::@env OPT_TARGET_IMG:str!="" "Image" "The target binary executable image on the remote system"
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
::@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
::@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
::@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
::@env OPT_GDBSERVER_PATH:str="gdbserver" "gdbserver command (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH."
::@env OPT_EXTRA_GDBSERVER_ARGS:str="" "Extra gdbserver arguments" "Extra arguments to pass to gdbserver. Use with care."
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
::@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
@echo off
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
IF EXIST %GHIDRA_HOME%\.git (
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
IF EXIST %GHIDRA_HOME%\ghidra\.git (
set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
)
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
"%OPT_GDB_PATH%" ^
-q ^
-ex "set pagination off" ^
-ex "set confirm off" ^
-ex "show version" ^
-ex "python import ghidragdb" ^
-ex "set architecture %OPT_ARCH%" ^
ex "set endian %OPT_ENDIAN%" ^
-ex "target remote | '%OPT_SSH_PATH%' %OPT_EXTRA_SSH_ARGS% '%OPT_HOST%' '%OPT_GDBSERVER_PATH%' %OPT_EXTRA_GDBSERVER_ARGS% - '%OPT_TARGET_IMG%' %OPT_TARGET_ARGS%" ^
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
-ex "ghidra trace start" ^
-ex "ghidra trace sync-enable" ^
-ex "ghidra trace sync-synth-stopped" ^
-ex "set confirm on" ^
-ex "set pagination on"

View file

@ -0,0 +1,52 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
#@title gdb + gdbserver via ssh
#@image-opt arg:1
#@desc <html><body width="300px">
#@desc <h3>Launch with local <tt>gdb</tt> and <tt>gdbserver</tt> via <tt>ssh</tt></h3>
#@desc <p>
#@desc This will start <tt>gdb</tt> on the local system and then use it to connect and launch the target in <tt>gdbserver</tt> on the remote system via <tt>ssh</tt>.
#@desc For setup instructions, press <b>F1</b>.
#@desc </p>
#@desc </body></html>
#@menu-group gdb
#@icon icon.debugger
#@help gdb#gdbserver_ssh
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little
#@arg :str! "Image" "The target binary executable image on the remote system"
#@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
#@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
#@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
#@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
#@env OPT_GDBSERVER_PATH:str="gdbserver" "gdbserver command (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH."
#@env OPT_EXTRA_GDBSERVER_ARGS:str="" "Extra gdbserver arguments" "Extra arguments to pass to gdbserver. Use with care."
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
. ..\support\gdbsetuputils.ps1
$pypathTrace = Ghidra-Module-PyPath "Debugger-rmi-trace"
$pypathGdb = Ghidra-Module-PyPath
$Env:PYTHONPATH = "$pypathGdb;$pypathTrace;$Env:PYTHONPATH"
$arglist = Compute-Gdb-Remote-Args `
-TargetImage $args[0] `
-TargetCx "remote | '$Env:OPT_SSH_PATH' $Env:OPT_EXTRA_SSH_ARGS '$Env:OPT_HOST' '$Env:OPT_GDBSERVER_PATH' $Env:OPT_EXTRA_GDBSERVER_ARGS - '$($args[0])' $Env:OPT_TARGET_ARGS" `
-RmiAddress "$Env:GHIDRA_TRACE_RMI_ADDR"
Start-Process -FilePath $arglist[0] -ArgumentList $arglist[1..$arglist.Count] -NoNewWindow -Wait

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@timeout 60000
#@title gdb + gdbserver via ssh #@title gdb + gdbserver via ssh
#@image-opt arg:1 #@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
@ -24,9 +23,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group remote #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh #@help gdb#gdbserver_ssh
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :str! "Image" "The target binary executable image on the remote system" #@arg :str! "Image" "The target binary executable image on the remote system"
#@args "Arguments" "Command-line arguments to pass to the target" #@args "Arguments" "Command-line arguments to pass to the target"
@ -39,31 +39,21 @@
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture" #@env OPT_ARCH:str="auto" "Architecture" "Target architecture"
#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order"
if [ -d ${GHIDRA_HOME}/ghidra/.git ] . ../support/gdbsetuputils.sh
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
elif [ -d ${GHIDRA_HOME}/.git ]
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
"$OPT_GDB_PATH" \ pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
-q \ pypathGdb=$(ghidra-module-pypath)
-ex "set pagination off" \ export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
-ex "set confirm off" \
-ex "show version" \ target_image="$1"
-ex "python import ghidragdb" \ shift
-ex "set architecture $OPT_ARCH" \
-ex "set endian $OPT_ENDIAN" \ function launch-gdb() {
-ex "target remote | '$OPT_SSH_PATH' $OPT_EXTRA_SSH_ARGS '$OPT_HOST' '$OPT_GDBSERVER_PATH' $OPT_EXTRA_GDBSERVER_ARGS - $@" \ local qargs
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ printf -v qargs '%q ' "$@"
-ex "ghidra trace start" \ local -a args
-ex "ghidra trace sync-enable" \ compute-gdb-remote-args "$target_image" "remote | '$OPT_SSH_PATH' $OPT_EXTRA_SSH_ARGS '$OPT_HOST' '$OPT_GDBSERVER_PATH' $OPT_EXTRA_GDBSERVER_ARGS - '$target_image' $qargs" "$GHIDRA_TRACE_RMI_ADDR"
-ex "ghidra trace sync-synth-stopped" \
-ex "set confirm on" \ "${args[@]}"
-ex "set pagination on" }
launch-gdb "$@"

View file

@ -1,4 +1,4 @@
#!/usr/bin/bash #!/usr/bin/env bash
## ### ## ###
# IP: GHIDRA # IP: GHIDRA
# #
@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
## ##
#@title wine + gdb #@title gdb + wine
#@image-opt arg:1 #@image-opt arg:1
#@desc <html><body width="300px"> #@desc <html><body width="300px">
#@desc <h3>Launch with <tt>gdb</tt> and <tt>wine</tt></h3> #@desc <h3>Launch with <tt>gdb</tt> and <tt>wine</tt></h3>
@ -23,9 +23,10 @@
#@desc For setup instructions, press <b>F1</b>. #@desc For setup instructions, press <b>F1</b>.
#@desc </p> #@desc </p>
#@desc </body></html> #@desc </body></html>
#@menu-group cross #@menu-group gdb
#@icon icon.debugger #@icon icon.debugger
#@help TraceRmiLauncherServicePlugin#gdb_wine #@help gdb#wine
#@depends Debugger-rmi-trace
#@enum Endian:str auto big little #@enum Endian:str auto big little
#@arg :file! "Image" "The target binary executable image" #@arg :file! "Image" "The target binary executable image"
#@args "Arguments" "Command-line arguments to pass to the target" #@args "Arguments" "Command-line arguments to pass to the target"
@ -36,37 +37,20 @@
#@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target."
#@tty TTY_TARGET if env:OPT_EXTRA_TTY #@tty TTY_TARGET if env:OPT_EXTRA_TTY
if [ -d ${GHIDRA_HOME}/ghidra/.git ]
then
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
elif [ -d ${GHIDRA_HOME}/.git ]
then
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
else
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
fi
# NOTE: Ghidra will leave TTY_TARGET empty, which gdb takes for the same terminal. . ../support/gdbsetuputils.sh
"$OPT_GDB_PATH" \ pypathTrace=$(ghidra-module-pypath "Debugger-rmi-trace")
-q \ pypathGdb=$(ghidra-module-pypath)
-ex "set pagination off" \ export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
-ex "set confirm off" \
-ex "show version" \ target_image="$1"
-ex "python import ghidragdb.wine" \ shift
-ex "set architecture $OPT_ARCH" \
-ex "set endian $OPT_ENDIAN" \ function launch-gdb() {
-ex "file \"$OPT_WINE_PATH\"" \ local -a args
-ex "set args $@" \ compute-gdb-wine-args "$target_image" "$GHIDRA_TRACE_RMI_ADDR" "$@"
-ex "set inferior-tty $TTY_TARGET" \
-ex "starti" \ "${args[@]}"
-ex "ghidra wine run-to-image \"$1\"" \ }
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ launch-gdb "$@"
-ex "ghidra trace start \"$1\"" \
-ex "ghidra trace sync-enable" \
-ex "ghidra trace sync-synth-stopped" \
-ex "set confirm on" \
-ex "set pagination on"

View file

@ -0,0 +1,106 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
. $Env:MODULE_Debugger_rmi_trace_HOME\data\support\setuputils.ps1
function Add-Gdb-Init-Args {
param([ref]$ArgList)
$ArgList.Value+=("-q")
$ArgList.Value+=("-ex", "`"set pagination off`"")
$ArgList.Value+=("-ex", "`"set confirm off`"")
$ArgList.Value+=("-ex", "`"show version`"")
$ArgList.Value+=("-ex", "`"python import ghidragdb`"")
$ArgList.Value+=("-ex", "`"python if not 'ghidragdb' in locals(): exit(253)`"")
$ArgList.Value+=("-ex", "`"set architecture $Env:OPT_ARCH`"")
$ArgList.Value+=("-ex", "`"set endian $Env:OPT_ENDIAN`"")
}
function Add-Gdb-Image-And-Args {
param([ref]$ArgList, $TargetImage, $TargetArgs)
if ("$TargetImage" -ne "") {
$image = $TargetImage -replace "\\", "\\\\"
$ArgList.Value+=("-ex", "`"file '$image'`"")
}
if ("$TargetArgs" -ne "") {
$tgtargs = $TargetArgs -replace "`"", "\`""
# Escaping parentheses in the arguments is no longer necessary in powershell vs cmd
$ArgList.Value+=("-ex", "`"set args $tgtargs`"")
}
}
function Add-Gdb-Connect-And-Sync {
param([ref]$ArgList, $Address)
$ArgList.Value+=("-ex", "`"ghidra trace connect '$Address'`"")
$ArgList.Value+=("-ex", "`"ghidra trace start`"")
$ArgList.Value+=("-ex", "`"ghidra trace sync-enable`"")
}
function Add-Gdb-Start-If-Image {
param([ref]$ArgList, $TargetImage)
if ("$TargetImage" -ne "") {
$ArgList.Value+=("-ex", "`"$Env:OPT_START_CMD`"")
}
}
function Add-Gdb-Tail-Args {
param([ref]$ArgList)
$ArgList.Value+=("-ex", "`"set confirm on`"")
# $ArgList.Value+=("-ex", "`"set pagination on`"")
}
function Compute-Gdb-Usermode-Args {
param($TargetImage, $RmiAddress)
$arglist = @("`"$Env:OPT_GDB_PATH`"")
Add-Gdb-Init-Args -ArgList ([ref]$arglist)
Add-Gdb-Image-And-Args -ArgList ([ref]$arglist) -TargetImage $TargetImage -TargetArgs $Env:OPT_TARGET_ARGS
Add-Gdb-Connect-And-Sync -ArgList ([ref]$arglist) -Address $RmiAddress
Add-Gdb-Start-If-Image -ArgList ([ref]$arglist) -TargetImage $TargetImage
Add-Gdb-Tail-Args -ArgList ([ref]$arglist)
return $arglist
}
function Compute-Gdb-Remote-Args {
param($TargetImage, $TargetCx, $RmiAddress)
$arglist = @("`"$Env:OPT_GDB_PATH`"")
Add-Gdb-Init-Args -ArgList ([ref]$arglist)
Add-Gdb-Image-And-Args -ArgList ([ref]$arglist) -TargetImge $TargetImage -TargetArgs ""
$arglist+=("-ex", "`"echo Connecting to $TargetCx\n`"")
$arglist+=("-ex", "`"target $TargetCx`"")
Add-Gdb-Connect-And-Sync -ArgList ([ref]$arglist) -Address $RmiAddress
$arglist+=("-ex", "`"ghidra trace sync-synth-stopped`"")
Add-Gdb-Tail-Args -ArgList ([ref]$arglist)
return $arglist
}
function Compute-Gdb-PipInstall-Args {
$argvpart = $args -join ", "
$arglist = @("`"$Env:OPT_GDB_PATH`"")
$arglist+=("-ex", "`"set pagination off`"")
$arglist+=("-ex", "`"python import os, sys, runpy`"")
$arglist+=("-ex", "`"python sys.argv=['pip', 'install', '--force-reinstall', $argvpart]`"")
$arglist+=("-ex", "`"python os.environ['PIP_BREAK_SYSTEM_PACKAGE']='1'`"")
$arglist+=("-ex", "`"python runpy.run_module('pip', run_name='__main__')`"")
return $arglist
}

View file

@ -0,0 +1,127 @@
## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
. $MODULE_Debugger_rmi_trace_HOME/data/support/setuputils.sh
add-gdb-init-args() {
args+=(-q)
args+=(-ex "set pagination off")
args+=(-ex "set confirm off")
args+=(-ex "show version")
args+=(-ex "python import ghidragdb")
args+=(-ex "python if not 'ghidragdb' in locals(): exit(253)")
args+=(-ex "set architecture $OPT_ARCH")
args+=(-ex "set endian $OPT_ENDIAN")
}
add-gdb-image-and-args() {
target_image=$1
shift
if [ -n "$target_image" ]; then
args+=(-ex "file '$target_image'")
fi
if [ "$#" -ne 0 ]; then
local qargs
printf -v qargs '%q ' "$@"
args+=(-ex "set args $qargs")
fi
}
add-gdb-inferior-tty() {
# Ghidra will leave TTY_TARGET empty when OPT_EXTRA_TTY is false.
# Gdb takes empty to mean the same terminal.
args+=(-ex "set inferior-tty $TTY_TARGET")
}
add-gdb-connect-and-sync() {
address=$1
args+=(-ex "ghidra trace connect '$address'")
args+=(-ex "ghidra trace start")
args+=(-ex "ghidra trace sync-enable")
}
add-gdb-start-if-image() {
target_image=$1
if [ -n "$target_image" ]; then
args+=(-ex "$OPT_START_CMD")
fi
}
add-gdb-tail-args() {
args+=(-ex "set confirm on")
# args+=(-ex "set pagination on")
}
compute-gdb-usermode-args() {
target_image=$1
rmi_address=$2
shift
shift
args+=("$OPT_GDB_PATH")
add-gdb-init-args
add-gdb-image-and-args "$target_image" "$@"
add-gdb-inferior-tty
add-gdb-connect-and-sync "$rmi_address"
add-gdb-start-if-image "$target_image"
add-gdb-tail-args
}
compute-gdb-wine-args() {
target_image=$1
rmi_address=$2
shift
shift
args+=("$OPT_GDB_PATH")
add-gdb-init-args
add-gdb-image-and-args "$OPT_WINE_PATH" "$target_image" "$@"
add-gdb-inferior-tty
gdb+=(-ex "starti")
gdb+=(-ex "ghidra wine run-to-image '$target_image'")
add-gdb-connect-and-sync "$rmi_address"
gdb+=(-ex "ghidra trace sync-synth-stopped")
add-gdb-tail-args
}
compute-gdb-remote-args() {
target_image=$1
target_cx=$2
rmi_address=$3
args+=("$OPT_GDB_PATH")
add-gdb-init-args
add-gdb-image-and-args "$target_image"
args+=(-ex "echo Connecting to $target_cx\n")
args+=(-ex "target $target_cx")
add-gdb-connect-and-sync "$rmi_address"
args+=(-ex "ghidra trace sync-synth-stopped")
add-gdb-tail-args
}
compute-gdb-pipinstall-args() {
local argvpart
printf -v argvpart ", %s" "$@"
pipargs=("$OPT_GDB_PATH")
pipargs+=(-q)
pipargs+=(-ex "set pagination off")
pipargs+=(-ex "python import os, sys, runpy")
pipargs+=(-ex "python sys.argv=['pip', 'install', '--force-reinstall'$argvpart]")
pipargs+=(-ex "python os.environ['PIP_BREAK_SYSTEM_PACKAGE']='1'")
pipargs+=(-ex "python runpy.run_module('pip', run_name='__main__')")
}

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- See Base's TOC_Source.xml for help -->
<tocroot>
<tocref id="TraceRmiLauncherServicePlugin">
<tocdef id="gdb" text="GDB Integration"
target="help/topics/gdb/gdb.html">
<tocdef id="gdb_local" text="Local"
target="help/topics/gdb/gdb.html#local" />
<tocdef id="gdb_ssh" text="Via SSH"
target="help/topics/gdb/gdb.html#ssh" />
<tocdef id="gdb_gdbserver_ssh" text="gdbserver via SSH"
target="help/topics/gdb/gdb.html#gdbserver_ssh" />
<tocdef id="gdb_qemu" text="QEMU"
target="help/topics/gdb/gdb.html#qemu" />
<tocdef id="gdb_wine" text="Wine"
target="help/topics/gdb/gdb.html#wine" />
<tocdef id="gdb_remote" text="Remote"
target="help/topics/gdb/gdb.html#remote" />
<tocdef id="gdb_rr" text="rr"
target="help/topics/gdb/gdb.html#rr" />
</tocdef>
</tocref>
</tocroot>

Some files were not shown because too many files have changed in this diff Show more