Skip to content

Instantly share code, notes, and snippets.

@zah
Created December 13, 2011 01:31
Show Gist options
  • Select an option

  • Save zah/1469972 to your computer and use it in GitHub Desktop.

Select an option

Save zah/1469972 to your computer and use it in GitHub Desktop.
volatile stack roots
int main()
{
009F1000 push ecx
volatile int y;
volatile int z;
void* x;
x = malloc(10);
009F1001 push 0Ah
009F1003 call dword ptr [__imp__malloc (9F20A0h)]
y = (int)x;
009F1009 mov dword ptr [esp+4],eax
z = (int)x;
009F100D mov dword ptr [esp+4],eax
return (int)(x);
}
009F1011 add esp,8
009F1014 ret
int main()
{
volatile void* y;
volatile void* z;
void* x;
x = malloc(10);
00D91000 push 0Ah
00D91002 call dword ptr [__imp__malloc (0D920A0h)]
00D91008 add esp,4
y = x;
z = x;
return (int)(x);
}
00D9100B ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment