Comments (8)
There is a chicken and egg problem: to detect a calling convention like you propose, you need dataflow information, to get the dataflow information, you need calling conventions known. Maybe the following solution will work satisfactory: 50bffeb
It would be great if you could contribute a test (I do not have MSVC nearby).
from snowman.
Are we using the presence of 'ret n' instructions to detect stdcall? It didn't look like we were.
from snowman.
@jrmuizel I don't believe you can detect stdcall
in a definitive way using that method. But it might be possible to do with some heuristics like you propose.
from snowman.
@mrexodia What are the circumstances that you are thinking of where you have stdcall but no 'ret n' or vice versa?
from snowman.
Added recognition of 'ret n': 915b6f8.
from snowman.
@jrmuizel There is for example no way to determine the calling convention of a function without arguments 😃 But like I said, it is fine as heuristic.
from snowman.
I did some basic testing of this and it seemed to work ok. I'll try to put together some test cases next week.
from snowman.
I have pushed my changes to master: 6cd5753, 8dcd9e2, 4c77102.
Ideally, we should have some information about the compiler or C++ ABI used, and not consider passing this
through ecx for non-thiscall-capable compilers. Maybe in future...
from snowman.
Related Issues (20)
- gnuradio? HOT 3
- odd number of 0x00s after return or jumps possibly causing misinterpretation of next opcode HOT 5
- Snowman crashes when open file HOT 4
- FPU instructions support HOT 1
- Application Crash during Dataflow Analysis HOT 1
- Snowman sometimes struggles to interpret switch tables
- Reduce simple arithmetic of constant values
- Remove untaken branches from output HOT 2
- ms-dos executables ? HOT 6
- Android support needed. HOT 2
- Qt Wdeprecated-declarations warnings HOT 3
- Variable value can change when address is taken
- Can snowman standalone run on a predisassembled file? HOT 2
- Is it possible to decompile everything in order with all the diff files and such.
- [Question] Why does this ELF not work? HOT 4
- Can't save the c++ code HOT 3
- macOS prebuilt version
- Naming of struct fields wrong HOT 2
- Instructions unreadable in IDA 7.6 HOT 14
- Link is forwarding to youtube video?! HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snowman.