Assembly Language for Beginners

(nextflipdebug2) #1

11.2 Function arguments number statistics


As a last resort, it is possible to write jumps that circumvent the relocs, or you will have to edit the relocs
table.


11.2 Function arguments number statistics


I’ve always been interesting in what is average number of function arguments.


I’ve analyzed many Windows 7 32-bit DLLs
(crypt32.dll,mfc71.dll,msvcr100.dll,shell32.dll,user32.dll,d3d11.dll,mshtml.dll,msxml6.dll,sqlncli11.dll,
wininet.dll, mfc120.dll, msvbvm60.dll, ole32.dll, themeui.dll, wmp.dll) (because they usestdcallconven-
tion, and so it is easy togrepdisassembly output just byRETN X).



  • no arguments:≈ 29 %

  • 1 argument:≈ 23 %

  • 2 arguments:≈ 20 %

  • 3 arguments:≈ 11 %

  • 4 arguments:≈ 7 %

  • 5 arguments:≈ 3 %

  • 6 arguments:≈ 2 %

  • 7 arguments:≈ 1 %


Figure 11.1:Function arguments number statistics

This is heavily dependent on programming style and may be very different for other software products.


11.3 Compiler intrinsic.


A function specific to a compiler which is not an usual library function. The compiler generates a specific
machine code instead of a call to it. It is often a pseudofunction for specificCPUinstruction.


For example, there are no cyclic shift operations in C/C++ languages, but they are present in mostCPUs.

Free download pdf