The correct calling convention should be inferred.
Actual behavior
When analyzing x86_32 PE binaries produced by MSVC (with C++ classes), rizin will mistakenly assume the class method calling convention to be cdecl while it is actually thiscall.
It's possible this misleads the user and the decompiler.
Steps to reproduce the behavior
Here is a test binary I compiled with MSVC2019 - msvc_cc_test.zip (password: rizin)
Open the file
s 0x00403ff0 (seek to A::method2() - see source code below)
af
afi
The following output suggests the calling convention is cdecl (but based on the disassembly one can see ECX is treated as an argument, so it is actually thiscall):
Work environment
rizin -v
full output, not truncated (mandatory)Expected behavior
The correct calling convention should be inferred.
Actual behavior
When analyzing x86_32 PE binaries produced by MSVC (with C++ classes), rizin will mistakenly assume the class method calling convention to be
cdecl
while it is actuallythiscall
.It's possible this misleads the user and the decompiler.
Steps to reproduce the behavior
s 0x00403ff0
(seek to A::method2() - see source code below)af
afi
The following output suggests the calling convention is
cdecl
(but based on the disassembly one can see ECX is treated as an argument, so it is actuallythiscall
):Test program source code