Remix.run Logo
▲ isoprophlex an hour ago

What the hell is up with that comparison at the end?! Seems... overly verbose?

▲nananana9 5 minutes ago | parent | next [-]

The programmer probably wrote memcmp(pass, buf, 5) which compilers will often fold into an inlined loop, or a few comparisons if they know the 3rd arg.

The weird thing is it didn't emit a 32-bit load+compare for the first 4 bytes, this could probably be done with 2 comparsions. Idk. Maybe weird CPU with stricter alignment rules.

▲Turneyboy an hour ago | parent | prev [-]

Most likely this is decompiled and not the way it was originally written.

▲jonatron 26 minutes ago | parent [-]

Yep, and you can prompt something like "the function was a decompiled version, translate it into a readable version", if you don't like reading [probably] ghidra output.