Open Wall-AF opened 3 months ago
I recently upgraded a lot of images and I think it's also generally broken right now for a lot of this kind of access. I've noticed a lot of arrays cast as int
and then indeed, losing type information (ppc,mips,sparc)
Hopefully fixed by either #6718 or #6722
I recently upgraded a lot of images and I think it's also generally broken right now for a lot of this kind of access. I've noticed a lot of arrays cast as
int
and then indeed, losing type information (ppc,mips,sparc)Hopefully fixed by either #6718 or #6722
I haven't updated to include those yet!
They're not merged, I haven't tried either yet in a local build to see if it fixes the issues I've seen, but looks promising
I recently upgraded a lot of images and I think it's also generally broken right now for a lot of this kind of access. I've noticed a lot of arrays cast as
int
and then indeed, losing type information (ppc,mips,sparc) Hopefully fixed by either #6718 or #6722I haven't updated to include those yet!
No dice! Tried both fixes together and independently to no effect.
I believe the 2 sizes of pointers is what really needs fixing for my issues. E.g. if a structure contains a pointer and that pointer stores the segment and offset that turns it into a 4-byte pointer which then interferes with Ghidra's internals as they cannot cope with 2 sizes! Is there any hope for that to be investigated?
Maybe the 2 screenshots below illustrate the situation. In the first, pFld0x2->field4_0xa
is defined as a pointer of size 32-bits and the second uses the default size (as per cspec
(16-bit)).
Describe the bug Using sized pointers, say
ScriptHandler *32
in a 16-bit app to establish afar
pointer, simple arithmetic used to index the array of those objects fails to use the base object size and consequently doesn't recognise the calculation as the index. Something liketurns into
*(int *)&pThis->lpScrptHldr_0x16 = *(int *)&pThis->lpScrptHldr_0x16 + iVar4 * -0x402;
instead of (if the pointer is sized 16 - the native pointer size)pThis->lpScrptHldr_0x16 = pThis->lpScrptHldr_0x16 + -iVar4;
admittedly not perfect, but better!Expected behavior Array index calculations should only use the pointer size when pointer-to-pointer... (and the index level is NOT at the lowest dereferencing point) is being sought otherwise use its base type size.
Screenshots See bug description.
Attachments None.
Environment (please complete the following information):
Additional context None.