Skip to content

Instantly share code, notes, and snippets.

@martell
Last active June 13, 2016 02:12
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 martell/e4040515fa064c6740049247d838409d to your computer and use it in GitHub Desktop.
Save martell/e4040515fa064c6740049247d838409d to your computer and use it in GitHub Desktop.
#pragma data_seg(".ctors")
__declspec(allocate(".ctors")) void *__CTOR_LIST__[] = {(void*)-1};
#pragma data_seg(".ctors$zzzz")
__declspec(allocate(".ctors$zzzz")) void *__CTOR_END__[] = {(void*)0};
#pragma data_seg(".dtors")
__declspec(allocate(".dtors")) void *__DTOR_LIST__[] = {(void*)-1};
#pragma data_seg(".dtors$zzzz")
__declspec(allocate(".dtors$zzzz")) void *__DTOR_END__[] = {(void*)0};
static int hello = 10;
void __attribute__ (( __constructor__, __used__ )) just_use_msvcrt_lib(void){
hello = 1000;
}
#include <stdio.h>
int main() {
return hello;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment