Support for mixed-size pointers, PASCAL calling convention, "based" types +
Is your feature request related to a problem? Please describe. I am trying to reverse engineer several 16-bit Windows applications that use PASCAL calling convention (left-to-right parameter stacking); near, far and huge pointers (we can probably ignore the huge ones); functions with based arguments and return types (see below) to name a few.
Here are a couple of example function prototypes from Microsoft that I'm trying to parse and get into Ghrida:
void far _pascal fmemcpy(void near*, const void far*, long); Successfully!
void _based(void) * _cdecl _bexpand(_segment,
void _based(void) *, size_t);Here's another example of a failure:
interface IRpcChannel : IUnknown
{
STDMETHOD(GetStream)(REFIID iid, int iMethod, BOOL fSend,
BOOL fNoWait, DWORD size, IStream FAR* FAR* ppIStream) = 0;
STDMETHOD(Call)(IStream FAR* pIStream) = 0;
STDMETHOD(GetDestCtx)(DWORD FAR* lpdwDestCtx, LPVOID FAR* lplpvDestCtx) = 0;
STDMETHOD(IsConnected)(void) = 0;
};Describe the solution you'd like I would like the CParser updated so that examples like these will be accepted and we can then use them to create some new GDT files for older operating systems and their different compilers.
Describe alternatives you've considered Over the past few weeks I have been looking into the classes that deal with this and I have produced some working code that I now need help with. I have successfully implemented FAR and NEAR pointers and updated the numerous files such a change requires. So far, I have not updated DataOrganization side of things as I have hardcoded the pointer sizes temporarily. I will include my endeavours below in a tar.zip file. near_far_etc.tar.zip
This is based on: commit c1095fe9383b153fffdfa7453679512124a60d87
Included in the zip file is a copy of the PreProcessed CParserPlugin.out file containing all the header files from MSVC 1.51.
Source: NationalSecurityAgency/ghidra