Skip to content

0xC-M0NK3Y/Windows_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Windows_wrapper

Program to link functions to your wrapped function

/!\ Only 64 bits /!\

Example:

wrapped.c :

    #include <stdio.h>
    
    // wrapped function must start with wrap_, or any 5 caracteres before the real function name
    int wrap_puts(const char *s) {
      puts("WRAPPED PUTS");
      puts(s);
      return 2626;
    }

compile the wrapped.c as dll :

    $ x86_64-w64-mingw32-gcc -shared wrapped.c -o wrapped.dll

testprog.c :

    #include <stdio.h>

    int main(void)
    {
      int dummy;

      printf("testing wrapped function puts : \n");
      dummy = puts("Call to puts");
      printf("dummy = %d\n", dummy);
      return 0;
    }

compile the testprog.c as executable :

    $ x86_64-w64-mingw32-gcc -c testprog.c -o testprog.o
    $ x86_64-w64-mingw32-gcc testprog.o -o testprog.exe

Then just compile the actual wrapper program :

    $ make

Finally launch the programme like this :

    $ ./wrapper.exe wrapped.dll testprog.exe

WRAPPER

About

Program to link functions to your wrapped function

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published