You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where a register is being set to the start of a parent structure and offsets are being added to get the member. So far so good! However, the members these offsets refer to belong to an array of embedded structures (with structures within etc.) that are being iterated over (and the array is not at the start of the parent). At the end of the loop, the member's size is being added to aforementioned register, however because Ghidra recognises that register as the parent structure the addition isn't correclty understood and the array elements are missed too, leading to bad C.
I've tried to use offset pointers, but that doesn't work!
Below is a simplified example of the structures involved:
typedef struct tagSubComponent<T> {
...;
T * aData;
} SubComponent;
typedef struct tagComponent {
int nTotal;
int nElems;
...;
SubComponent<int> data;
...;
} Component;
typedef struct tagParent {
int nDepth;
...;
Component aComps[5];
...;
} Parent;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a situation where a register is being set to the start of a parent structure and offsets are being added to get the member. So far so good! However, the members these offsets refer to belong to an array of embedded structures (with structures within etc.) that are being iterated over (and the array is not at the start of the parent). At the end of the loop, the member's size is being added to aforementioned register, however because Ghidra recognises that register as the parent structure the addition isn't correclty understood and the array elements are missed too, leading to bad C.
I've tried to use offset pointers, but that doesn't work!
Below is a simplified example of the structures involved:
Beta Was this translation helpful? Give feedback.
All reactions