02-09-2024, 11:16 PM
there is many methods for identifying the main function on C/C++
one of them is to identify the compiler so you can use it for your advantage
You can use IDA Pro Free to de-compile the source code on the cloud
But in This Post we will use Ghidra to identify WinMain function in C++
there is some notes make it in your concern to understand the different between Main() and WinMain() and DllMain() in C/C++
1- WinMain() is Used For GUI (Non-Console ) Application.
2- Main() is Used For (Non-GUI) Application console Based .
3-DllMain() Is Used For a Dll's.
Before going into The Main Subject which is "simple"
let's take a pref look for the Compile Unicode
- in Windows programming, there are two main entry points for Windows applications: wmain and WinMain.
The wmain entry point is used for Unicode (wide-character) applications,
The WinMain entry point is used for ANSI (narrow-character) applications
![[Image: 1.png]](https://external-content.duckduckgo.com/iu/?u=https://i.ibb.co/Zgh75nc/1.png)
![[Image: 2.png]](https://external-content.duckduckgo.com/iu/?u=https://i.ibb.co/kDMtYnM/2.png)
![[Image: 3.png]](https://external-content.duckduckgo.com/iu/?u=https://i.ibb.co/B2GcvpK/3.png)
![[Image: 4.png]](https://external-content.duckduckgo.com/iu/?u=https://i.ibb.co/bLKz9Qz/4.png)
Zelda