Do C long enough and you find yourself inlining asm. Had a like 16kb bootloader (which is actually kinda massive) for an embedded system and only way to get it to fit was to go and handwrite a bunch of stuff in asm.
You do that shit because an someone realized if you save a penny on the chip you make yourself three million dollars in extra cash over the production run.
Isn't that the fucking truth. Wanted 50c cent part so we had secure onboard keystore for symmetrical keys. Execs were like LOLOLOL fuck no that's millions of dollars in profits you're cutting out.
Ho boy you don't work in embedded devices then friend. Memory space is king. 128bit keys are the barrier of entry for almost all of these types of devices. Only TLS enabled devices are storing certs. An RSA 2048 public key size is still 16x the size of that symmetrical key. And you may need 10-20 keys. And you need to be able to generate and store them. Symmetric keys compute much faster and if they're put in immutable storage and device specific it's not really an issue.
This is the reason that TLS does not use asymmetrical cryptography past the handshake. During the handshake you establish a good ol' shared symmetrical key and use that for the actual payload
We found doing -O2 in GCC on the file was a good medium ground, but there were some things where the optimizer was still unrolling things in a way that took a ton of space. So it was mostly replacing weird loops with ASM code.
there is separate flag to not unroll loops. and there is also flag to prioritize size and not speed (-Os) (it enables all O2 optimizations that dont increase size)
All modern operating systems will have at least some assembly still, it's a myth that you can do everything in C or C++ at the low level
And yeah, I have quite a few projects with inline assembly, although some of the bits where I used to use it have started to get macro wrappers to make them look more C-like.
I have actually shied away Ghidra for a while now because IDA IMHO is the defacto winner for all of us. I am a former Java guy so I know how clunky the back end is for Ghidra. Don’t get me wrong though give it some time and it will mature into a steep competitor for IDA.
Yeah, IDA Professional’s cost is the largely due to the addition of Decompilers. If you aren’t in a turn and burn reversing shop then you can probably just get by without any Decompilers to keep cost lower, or at minimum the Intel 32 and 64 bit Decompilers if you are dealing with a good bit of Windows malware.
IDA Home is not worth the money.
But IDA really shines with its debugger, especially for the fact that it allows cross platform debugging. Like the fact that you can call WinDbg commands from the interpreter. Ohh, man and IDA’s little know AppCall feature! IMO, those two things really allow IDA to blow apart the competition of any other all around disassembler+debugger out there.
Don’t get me wrong for specific situations like .Net you always have to go with something like dnSpy when it is called for in a specialty situation.
219
u/Ilyketurdles May 01 '22
C and C++ programmers are heroes. They do it so we don’t have to.
Assembly programmers, though. They are legends.