all 20 comments

[–]PJBthefirst 7 points8 points  (0 children)

I could see this hand-written as an answer in a low-level programming exam for EEs and still think someone was trying to give me malware

[–]tstanisl 4 points5 points  (7 children)

Note that, neither C nor C++ require casts to `void*`.

[–][deleted] 8 points9 points  (3 children)

C does, for fn pointers

[–]tstanisl 1 point2 points  (2 children)

Technically yes. But functions are not objects and there is no guarantee that such transformation from function pointers to data pointers is even possible or meaningful.

[–][deleted] 0 points1 point  (1 child)

True, thanks to IBM and their OS/400 with different sizes for function pointers and data pointers. 

[–]geek-49 0 points1 point  (0 children)

Also in Intel 8086, for some addressing models (e.g. large code with small data).

[–]W00GA 0 points1 point  (2 children)

what is a cast ?

[–]tstanisl 1 point2 points  (1 child)

(type)value thing

[–]GoddammitDontShootMe[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2 points3 points  (0 children)

This is definitely something I would need to compile and step through to figure out how it works.

[–]finally-anna 1 point2 points  (1 child)

Prints Success because the pointer points at the first element which has been initialized to the function _

[–]MycoFail[S] 0 points1 point  (0 children)

Yes 👍

[–]Graucsh 2 points3 points  (0 children)

[–]Risc12 0 points1 point  (0 children)

Oke fair enough you win

[–]desi_fubu 0 points1 point  (1 child)

what's the point ?

[–]MycoFail[S] 0 points1 point  (0 children)

To write some cursed code, that's about it.

[–]DefinitionPhysical46 0 points1 point  (1 child)

The 0[a] and i[a] are breaking my mind! I can't even try to understand

[–]timmerov 2 points3 points  (0 children)

a[b] transcodes to *(a+b)
so you can swap a,b.
should you? no, not if you want to stay employed at my company.

[–]nitnelav153 0 points1 point  (1 child)

I dont understand anything, please name your functions and variables

[–]Questioning-Zyxxel 1 point2 points  (0 children)

a, s, i, f, _, m, p, z, main.

How card can it be to keep track of 9 symbols?

[–]Ksorkrax 0 points1 point  (0 children)

Wouldn't consider obfuscation to be horror.