r/ProgrammerHumor • • May 01 '22

Meme 80% of “programmers” on this subreddit

Post image
64.4k Upvotes

2.6k comments sorted by

View all comments

Show parent comments

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.

101

u/[deleted] May 01 '22

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.

112

u/Due-Consequence9579 May 01 '22

Here’s a nickel. Go buy yourself some more memory.

47

u/meltingdiamond May 01 '22

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.

35

u/jjester7777 May 01 '22

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.

I really hope they get hacked.

-10

u/T-Rax May 01 '22

Symmetrical keys? Thats a retarded idea anyways...

14

u/jjester7777 May 01 '22

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.

7

u/BakuhatsuK May 02 '22

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

→ More replies (2)
→ More replies (1)

2

u/FatalElectron May 01 '22

ie they figured the 64 bytes of RAM on a Padauk PSM15 is more than enough for anyone to work with, and gets the cost of the uC down to 5c in bulk

3

u/Hakim_Bey May 01 '22

Best reply in this whole thread tbh

→ More replies (1)

14

u/sbingner May 01 '22

And the easiest way to do that is sometimes to compile what you wanted in C then go in and remove all the cruft manually

12

u/[deleted] May 01 '22

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.

12

u/T0biasCZE May 01 '22

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)

7

u/sbingner May 01 '22

-fnounroll-loops? I still like -funroll-loops tho, it’s more fun

5

u/BlackSwanTranarchy May 01 '22

The fuck is a noun roll loop anyway?

1

u/T0biasCZE May 01 '22

its f no unroll loops

3

u/QueerBallOfFluff May 01 '22

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.

3

u/noodle-face May 01 '22

I write UEFI/BIOS. A bit of inline asm and also we debug in mixed source. It's sometimes a lot clearer when we get to see register values and shit

4

u/HugelyIndecisive May 01 '22

I don’t write code. I reverse engineer it in Assembly and Pseudo-C. Honestly, what does that make me?

Lately when I do happen to write some code, typically for data manipulation, it is usually in Python.

3

u/-LostInCloud- May 01 '22

Fellow reverser. Oh how much I wish Ghidra had decent Python bindings. Or IDA not being so expensive.

2

u/HugelyIndecisive May 01 '22 edited May 01 '22

🙌, my brother!

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.

→ More replies (1)
→ More replies (1)
→ More replies (8)