what I'm looking for
I have a binary that, for various reasons, I'm pretty sure is executable machine code (although possibly for a VM language, although I doubt it's Java). I'm looking for a table of byte frequencies for byte values v. architecture.
I recognize that those values will vary by compiler, operating system ABI / API, application, and binary format, but for my purposes I'm assuming they vary most markedly by architecture, and:
- I just need frequencies for the actual executable code- the
.text
section- not the entire binary. - the binary's targeting one of the most common end-user operating systems from 1985 - 2005 (so, old-style unices, Linux, VMS, DOS, Windows NT, MacOS, or OSX).
- it was compiled with default flags on the most common compilers for those systems
If all that fails, I'd at least want a list of
Wait, there's this list on wikipedia. Thank you, wikipedia.nop
opcodes for all the most common architectures, since I think it's probably fair to assume most compilers use nops for padding, and runs of nops will help me figure out where a good entry point for a disassembler would be.
my use case
I have a snippet of a binary, which I'm pretty sure is executable object code (sans headers / section information. I think it's the .text
section (or whatever you'd call that) in its original format).
I'm not sure that it's even from a binary, but when converted to a grayscale bitmap it has some clear patterns (stripes at regular intervals), and I've noticed that the bytes FF FF
appear often enough, and beside other bytes in the form Fx
, that I get the feeling I'm looking at high memory addresses. The shannon entropy is low enough I'm pretty sure it's not compressed or encrypted (around 7.76), but all 256 possible byte values are represented.
I can't actually give the hexdump itself for personal reasons.
binwalk
, which in fairness I hadn't found in previous searches on the larger internet. I feel kind of silly now, but I'll leave this question and answer it myself in a bit. Assuming binwalk actually helps. If it doesn't help, I guess I'll just... wait around...binwalk -A
isn't getting me anything, nor isbinwalk -I
. Literally- they're giving me no hits. Just as a sanity check, runningbinwalk -A
against/bin/bash
also got me no hits and no error codes, so I'm not sure what to think.binwalk
does give me entropy values consistently around 0.94 for all four kilobytes, while/bin/bash
(for the code section) consistently fluctuates around 0.75. Not sure what to make of that.binwalk -H
reports that both /bin/bash and the binary I'm looking at appear to have a "high entropy" section that extends for nearly the same number of KB (~5 for bash and ~6 for the binary I'm using). According toreadelf
, that starts at the tail end of.gnu.hash
and the rest (most of it) is in.dynsym
.