How do I distinguish between ‘binary’ and ‘text’ files?

Informally, most of us understand that there are ‘binary’ files (object files, images, movies, executables, proprietary document formats, etc) and ‘text’ files (source code, XML files, HTML files, email, etc). In general, you need to know the contents of a file to be able to do anything useful with it, and form that point of … Read more

Tools to help reverse engineer binary file formats

What tools are available to aid in decoding unknown binary data formats? I know Hex Workshop and 010 Editor both support structures. These are okay to a limited extent for a known fixed format but get difficult to use with anything more complicated, especially for unknown formats. I guess I’m looking at a module for … Read more

What is the format of a patch file?

What does the following mean ? diff -rBNu src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java — src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 11:34:01.000000000 -0700 +++ src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 14:11:55.000000000 -0700 @@ -4,9 +4,12 @@ + int CJK = 21; + int DIGIT = 22; int DEFAULT = 0; String[] tokenImage = { “<EOF>”, + “\”OR\””, “<WORD>”, “<ACRONYM>”, “<SIGRAM>”, @@ -39,6 +42,8 @@ “\”\\\”\””, “\”:\””, “\”/\””, … Read more

Write a file in UTF-8 using FileWriter (Java)?

I have the following code however, I want it to write as a UTF-8 file to handle foreign characters. Is there a way of doing this, is there some need to have a parameter? I would really appreciate your help with this. Thanks. try { BufferedReader reader = new BufferedReader(new FileReader(“C:/Users/Jess/My Documents/actresses.list”)); writer = new … Read more

What is the difference between “JPG” / “JPEG” / “PNG” / “BMP” / “GIF” / “TIFF” Image?

I have seen many types of image extensions but have never understood the real differences between them. Are there any links out there that clearly explain their differences? Are there standards to consider when choosing a particular type of image to use in an application? What do we use for web applications? Answer Yes. They … Read more

What does “magic tests” mean for the file command?

I was reading about the file command and I came across something I don’t quite understand: file is designed to determine the kind of file being queried…. file accomplishes this by performing three sets of tests on the file in question: filesystem tests, magic tests, language tests What are magic tests? Answer “magic” here refers … Read more

What does “LSB” mean when referring to executable files in the output of /bin/file?

I have found the term “LSB executable” or “LSB shared object” in the output of the file command in Linux. For example: $ file /bin/ls /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=4637713da6cd9aa30d1528471c930f88a39045ff, stripped What does “LSB” mean in this context? Answer “LSB” here stands for … Read more

How can I correctly decompress a ZIP archive of files with Hebrew names?

Someone sent me a ZIP file containing files with Hebrew names (and created on Windows, not sure with which tool). I use LXDE on Debian Stretch. The Gnome archive manager manages to unzip the file, but the Hebrew characters are garbled. I think I’m getting UTF-8 octets extended into Unicode characters, e.g. I have a … Read more