Skip to content

Instantly share code, notes, and snippets.

@djg
Created July 8, 2010 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djg/467484 to your computer and use it in GitHub Desktop.
Save djg/467484 to your computer and use it in GitHub Desktop.
// Yet another test. Also had a .obj along side.
#include <winsock2.h>
int
main()
{
u_short x = 1;
x = htons(x);
return x;
}
// Dump of file test.obj
//
// File Type: COFF OBJECT
//
// _main:
// 00000000: 55 push ebp
// 00000001: 8B EC mov ebp,esp
// 00000003: 51 push ecx
// 00000004: 66 C7 45 FC 01 00 mov word ptr [ebp-4],1
// 0000000A: 66 8B 45 FC mov ax,word ptr [ebp-4]
// 0000000E: 50 push eax
// 0000000F: FF 15 00 00 00 00 call dword ptr [__imp__htons@4]
// 00000015: 66 89 45 FC mov word ptr [ebp-4],ax
// 00000019: 0F B7 45 FC movzx eax,word ptr [ebp-4]
// 0000001D: 8B E5 mov esp,ebp
// 0000001F: 5D pop ebp
// 00000020: C3 ret
//
// Summary
//
// 61 .debug$S
// 5D .drectve
// 21 .text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment