Hacker News new | past | comments | ask | show | jobs | submit login

Is there a way to determine the instruction set automatically? Like you hit a button on the remote and it looks for a specific change in the hex instruction. Or is the only way to do it is through deductive reasoning and experience like how the author does?



You might try to disassemble the code for a bunch of ISAs and see if your disassembly produces meaningful function prologue & epilogue for that ISAs ABI. Automatically.

Not sure if someone is doing that. Our (commercial) disassembler for example is told by the user what target it's disassembling (and I usually look at the output, not the actual opcodes; so maybe that's not feasible).


It's really a matter of experience (and sometimes lots of brute force); it's not easy to explain but I am able to make a reasonable guess at identifying ARM, MIPS, and x86, and Z80 by looking at the "texture" of the bytes as displayed in a hexdump or ASCII. Basically, stare at enough binaries for long enough and it tends to come naturally, just like people are usually able to tell apart human languages even if they don't actually know them.


The author's reasoning is the usual approach, just as it's possible for an amateur to distinguish between Czech and Finnish by eyeball statistical analysis even without speaking either language.

I'm now wondering if it would be possible / an interesting challenge to compose x86 code that fits the "E upper nibble every 4th byte" pattern of ARM...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: