>>102778837
Asking for help because i have been suffering, grasping at straws for too long now
int main(uint32_t argc, uint8_t ** argv){
/* SOME LOCAL VARIABLES */
/* MEMORY ALLOCATIONS */
if (memcmp_zs(PROGRAM_NAME,argv[0],strlen(PROGRAM_NAME)) ==0){ --i;} //argv[0] is not the name of the executable when called by strace
for (; i < argc; ++i){
if (memcmp_zs("-i",argv[i],2)==0){
++i;
if (input_file_fd != MAX32BIT){
killed_by_duplicate_input_file();
}
input_file_fd = open(argv[i],O_RDONLY,0); //passing nullptr is not a worry
if (input_file_fd == MAX32BIT){
killed_by_bad_input_file();
}
/* ...}
IN ANOTHER FILE */
//secured for null-ending strings shorter than len
uint32_t memcmp_zs(uint8_t * one, uint8_t * two, uint64_t len){
for (uint64_t i = 0; i < len; ++i){
if (one[i] != two[i]){
return 1;
}
if ( (one[i] == 0) || (two[i] == 0) ){ return 1;}
}
return 0;
}
/* STRACE OUTPUT */
mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|21<<MAP_HUGE_SHIFT, -1, 0) = 0x7e83b9000000
mmap(NULL, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7e83b9be0000
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7e83b9bdc000
mmap(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7e83b8800000
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7e83b99c7000
mmap(NULL, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7e83b99af000
openat(AT_FDCWD, "-i", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffffffffff} ---
/* THE COMMAND LINE */
strace -o log.txt ./PROGRAM_NAME -i /* ITS FUCKING "-i"*/\
SOMEFILE -o nigger
Me retardo?