calling convention cheat sheet

cdecl, stdcall, fastcall, c++

Overgeneralization, but may be helpful.

  • cdecl: parameters right to left on the stack, caller places parameters and removes parameters. gcc uses this.
  • stdcall: similar to cdecl, but callee removes function parameters from the stack when finished. Advantage, clean up code doesn’t need to be rewritten for each function. disadvantage, unknown number of parameters are impossible (printf) Microsoft compilers use this
  • fastcall stdcall, but uses two parameters in cpu registers (ecx and then edx)
  • c++ ‘this’ is passed in ecx (ms visual c++) or passed as first parameter (g++)

More handy is this: http://en.wikipedia.org/wiki/X86_calling_conventions
awesome

snmp cheatsheet

In my line of work, I come across SNMP default community strings quite a bit. I seem to always be searching for a reference on how to query various things – and also what I might change.

I’ve found the following page very useful:

http://www-01.ibm.com/software/webservers/httpservers/doc/v1319/9ac2mib.htm

Then an example query might be:

snmpget -v 2c -c private 70.37.128.238 sysDescr.0

Follow

Get every new post delivered to your Inbox.