Include test binaries and fix ascii decoding

This commit is contained in:
Liam Dalgarno
2020-12-09 18:12:01 +00:00
parent 2438be66f4
commit 7934330d2e
9 changed files with 6 additions and 11 deletions

BIN
test-binaries/crashmail Executable file

Binary file not shown.

BIN
test-binaries/elf-Linux-x86 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
null-data-addr: null-data-addr.c
gcc -fno-stack-protector -m32 -static $^ -o $@ -Tdata 0x080f0000

Binary file not shown.

View File

@ -0,0 +1,37 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
int copyData(char *string)
{
char buf[32];
strcpy(buf, string);
return (0);
}
int main(int argc, char *argv[])
{
char buffer[700];
FILE *file;
if (argc !=2)
{
printf("[*] invalid arguments!\n [*] > %s file_name\n",argv[0]);
exit(0);
}
printf("opening file\n");
file = fopen(argv[1],"rb");
if (!file)
{
//printf("file not opened %s", strerror(errno));
fprintf(stderr,"file not opened %s", strerror(errno));
//printf("error");
return (0);
}
printf("file opened\n");
fread(buffer, 699,1,file);
fclose(file);
copyData(buffer);
return (0);
}