Use C/C++ standard fixed sized integers in the decompiler

Since C99 and C++11, the C and C++ languages have standardized fixed-sized integer typedefs from the <stdint.h> header, which are very useful when you need 100% precise binary format. Open source decompilers like RetDec use these fixed sized integers extensively which makes it easier to actually use the decompiled code and refactor it.

Currently, the Hex-Rays decompiler uses its own typedefs, which are based on legacy WIN32 typedefs from WinAPI (_DWORD,_BYTE, _QWORD, etc.). I wish there was a way (maybe an option in the decompiler plugin settings) to force Hex-Rays to use C/C++ fixed sized integers from <stdint.h> rather than use these legacy Windows typedefs.

1 Like

I understand your desire but the partial types like _DWORD are not the same as int32_t because they are not completely defined. For example, they don’t have a fixed sign and may be replaced by a more precise defined type in some contexts. However, you can always specify the type of a variable to be more precise that a partial type.

Those are not legacy Windows typedefs. The definitions are in idafolder/include/defs.h.