Reverse Engineering Vendor Firmware [video]
youtube.com
youtube.com
There's a reason many reverse-engineers drink so much. It's because we have to look at someone else's code and figure out what they were thinking - and sometimes, the thing foremost in our mind throughout that process is: what the hell were they thinking?!
The things I've seen...
- Interrupts which relied on no-one using the debug registers (deliberately).
- I've seen copy protection faults which quit to desktop releasing a bootsector virus linked in when triggered. (Yes, 'virus protection' really existed, but I only saw it once.)
- Highly expensive dongle hardware whose entire purpose was being a 16-bit LFSR, which was perfectly matched in software with an equivalent routine, and the output compared with beq and nothing else done with it. (Let me just change that to a bra...)
- 'Encryption' using RC4 with no key. Ahahaha no.
When people think no-one's going to read it...
Developing software in a corporate environment under the constraints of capatalism often means average management and average coders both with a tight deadline.
Trying to take shortcuts in such an environment is only human nature, and getting non-optimal designs and implementations then should be no surprise.
The complete opposite is fixed requirements specifications and many layers between devs and users. This will get expensive and easily quite mediocre when devs know they are not really building the product the end user needs since motivation so easily falters in such an environment.
I assume that the comment at the end - that this vendor tool was probably a hurried, barely-documented port of a DOS tool (which would have been safer 'because DOS doesn't do anything') - is probably right on the mark.
So many vendor "engineering" backdoors, too. Gah.
The question at the end about why Linux allows user-space access to PCI registers was also very interesting. Apparently it was historically required by X, but should no longer be needed with KMS. Therefore one should in theory be able to disable /dev/mem completely.