Replies: 2 comments 1 reply
-
Try creating a call fixup for |
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe the function |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm playing with a firmware written for an 8-bit PIC-18 microcontroller. This is my first time working with that architecture. I do have source for the firmware, possibly from a slightly different version.
The C source code goes:
Expand disassembly listing for the relevant code.
The original Ghidra pseudocode looks like this:
I'd like to improve the decompilation by teaching it that
DAT_DATA_0076
is the 32-bit dividend/result andDAT_DATA_007a
is the 32-bit divisor. I.e., I would like:The function signature of
__llmod
isunsigned long int __llmod(unsigned long int dividend, unsigned long int divisor)
. I tried inputting this into the function editor like so:Then I modified the types of
DAT_DATA_0076
,DAT_DATA_007a
, andDAT_DATA_01dd
to beulong
.However, the pseudocode is now messier:
Playing around, I also tried turning these into unions of
uint32_t
anduint8_t[4]
. Strangely it then produced pseudocode that copies the bytes out of order from what the assembly actually does?Beta Was this translation helpful? Give feedback.
All reactions