Obtain struct offsets with clang's memory layout

One of the most interesting things to do when instrumenting binaries with FRIDA is the ability to read structs because these are used by multiple syscalls in different systems, some examples of this usage can be found in the stat API or in Window’s GetSystemInfo API: https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/ns-sysinfoapi-system_info
The hard part of parsing structs with FRIDA is that it is required to manually calculate their offsets which requires taking into account the architecture of the process, datatypes and size of pointers.

Article Link: Obtain struct offsets with clang's memory layout