Last active
August 29, 2015 14:12
Revisions
-
wirewc revised this gist
Jan 1, 2015 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,8 +14,8 @@ void copy_string(char *target, char *source) void implant(char *stuff) { char loader[] = "Hello"; copy_string(stuff, (char*)loader); } @@ -27,12 +27,12 @@ int main(void) implant(toload); printf("%s\n",toload); free(toload); implant(toload); printf("%s\n",toload); return 0; } -
wirewc created this gist
Jan 1, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> void copy_string(char *target, char *source) { while(*source) { *target = *source; source++; target++; } *target = '\0'; } void implant(char *stuff) { char* loader = "Hello"; copy_string(stuff, loader); } int main(void) { char *toload = malloc(20); implant(toload); printf("%s\n",toload); free(toload); implant(toload); printf("%s\n",toload); return 0; }