Menu

#2 hex2bin fix

Unstable_(example)
open
nobody
hex2bin (1)
1
2015-05-20
2015-05-20
No

Currently hex2bin is defunct. whenever a 0A is in the hexdump, it adds an extra 0D corrupting the executable.

in hex2bin.c where it says:
.....
if (outfname && !freopen(outfname,"wb",stdout)) {
fprintf(stderr,E_OpenWrite,argv[0],outfname);
exit(1);
}

total=mainloop();
.....

change to:

if (outfname && !freopen(outfname,"wb",stdout)) {
fprintf(stderr,E_OpenWrite,argv[0],outfname);
exit(1);
}

if (_setmode(fileno(stdout), O_BINARY) == -1) {
fprintf(stderr,E_SetMode,argv[0]);
exit(1);
}

total=mainloop();

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.