ZerBea / hcxtools

A small set of tools to convert packets from capture files to hash files for use with Hashcat or John the Ripper.
MIT License
2.02k stars 392 forks source link

Input file must be opened in binary mode #339

Closed wizardsd closed 4 months ago

wizardsd commented 4 months ago

getmagicnumber expects input file to be opened in the binary mode

ZerBea commented 4 months ago

Thanks, merged.

But please note: Linux, and just about every flavor of Unix for that matter, doesn't differentiate between binary and text files. There's nothing about O_BINARY or O_TEXT in POSIX; the concepts are irrelevant. https://www.man7.org/linux/man-pages/man2/open.2.html

ZerBea commented 4 months ago

I'm going to revert this commit due to an ERROR: $ make cc -O3 -Wall -Wextra -Wpedantic -std=gnu99 -MMD -MF .deps/hcxpcapngtool.d -o hcxpcapngtool hcxpcapngtool.c -lssl -lcrypto -lz -DVERSION_TAG=\"6.3.4-32-gdad6a3a\" -DVERSION_YEAR=\"2024\" -DWANTZLIB hcxpcapngtool.c: In function 'processcapfile': hcxpcapngtool.c:5693:40: error: 'O_BINARY' undeclared (first use in this function); did you mean 'Z_BINARY'? 5693 | fd_pcap = open(pcapnameptr, O_RDONLY | O_BINARY); | ^~~~ | Z_BINARY hcxpcapngtool.c:5693:40: note: each undeclared identifier is reported only once for each function it appears in make: *** No rule to make target 'hcxpcapngtool', needed by 'build'. Stop.

Your PR failed.

ZerBea commented 4 months ago

Which OS do you use?