![]() |
|
#10
|
|||
|
|||
|
Calling conventions are, well...hopelessly complicated
![]() In a nutshell, when you call a procedure, it's rarely as simple as just executing a CALL statement, executing the procedure code, and then executing a RETN statement. The calling code and the procedure both have to agree on how to do several things:
For high-level languages, the calling convention also defines how the function name in the source code will get translated for the export section. This is particularly important for languages like C++ that support function overloading. That is, you have two or more functions declarations in your source code that are represented by the same symbol, but different arguments. Internally, the compiler actually gives each version of the function a unique name according to the name you gave it and the argument list in the function declaration. Then it looks at all the calls in your source code and changes them to the appropriate mangled name. Since the mangled names are what actually go in the export table, the mangling protocol is included in the calling convention. Probably the most commonly used conventions are:
By the way, I'm just reciting this from my notoriously shakey memory, so it's probable that I've made a mistake somewhere. If I were you, I wouldn't count on it being entirely accurate
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Site like crackmes.de to learn RE | mesagio | General Discussion | 5 | 01-17-2018 21:38 |
| could help me learn assembly language | kcire_eae | General Discussion | 12 | 08-18-2014 09:33 |
| When will Crapkey learn ??? | Numega Softice | General Discussion | 4 | 06-10-2004 14:44 |
| Where can I learn HASP tutorial? | tumtum | General Discussion | 3 | 11-09-2003 00:25 |