4 ms·
It's great that this contest has been running for so long and still produces interesting new approaches, but I wish there were more work being done in the field
by dane-pgp 6y ago
It's great that this contest has been running for so long and still produces interesting new approaches, but I wish there were more work being done in the field of underhanded code contests, e.g. [0].
One area of technology that seems to have continued the work of discovering underhanded techniques is the realm of cryptocurrency, specifically the "Solidity Underhanded Contest". The results for 2020 are here[1], which links to (spoiler alert) a great trick on line 65 here[2] (select the line character by character with a mouse to reveal it).
[0] https://en.wikipedia.org/wiki/Underhanded_C_Contest https://en.wikipedia.org/wiki/Underhanded_C_Contest
[1] https://blog.soliditylang.org/2020/12/03/solidity-underhanded-contest-winners/ https://blog.soliditylang.org/2020/12/03/solidity-underhande...
[2] https://github.com/ethereum/solidity-underhanded-contest/blob/master/submissions_2020/submission11_RobertMCForster/contracts/TimelockUpgrade.sol#L65 https://github.com/ethereum/solidity-underhanded-contest/blo...
- jcranmer 6y agoOne of my favorite programs was one where every single variable looked like 'K' but was different (there's K, Κ, K, 𐌊, 𝖪, К, Ꮶ, Ⲕ, etc.), and all of the strings were encoded in Roman numerals, e.g. ⅲⅰⅶⅺⅲⅶⅳⅰⅰⅳ.
- kregasaurusrex 6y agoI agree wholeheartedly- found about the Underhanded C Contest through an HN thread and enjoyed reading through the submissions every year. Sadly it seems to have not been run since 2015.
- userbinator 6y agoGreat example of why Unicode and source code do not mix well... it reminds me of when I taught CS courses and had a few instances of very confused students who managed to somehow get one of those "invisible formatting characters" into their files. Fortunately, a hexdump --- or even just an "old school" ANSI-only editor --- reveals all.
- andreareina 6y agoEmacs and IIRC vim highlight control characters and nonstandard whitespace. I kinda thought it standard for code editors.
- addcninblue 6y agoFor vim, it's under the listchars setting, in case anyone wanted to know! (":help listchars") This has been crucial in debugging really strange issues students manage to create.
- andreareina 6y agoOne of the strange things I've encountered is bare \r (i.e. no accompanying \n) in the middle of a line from a windows-sourced file. Don't know how they got there, just that redshift didn't like it one bit.
- bear8642 6y agoodd Windows gave you that - believe \r was Mac's standard at one point…
- tcoff91 6y agoI think how it happens with windows is one windows editor adds \r\n and then the file is edited in an editor that isn't properly aware of the windows line ending and the \n gets deleted. I've seen this happen before. It's especially likely to happen if the file has mixed line endings.
- Anarch157a 6y agoI had a problem like this at work just before Xmas break. A script wa returning "command not found" for 'chmod' because of an invisible Unicode character. The guy who asked my help refused to believe it, untill I showed him a hex dump of the script, he got convinced when he saw 2 byted between the command and parameters.
- deleted 6y ago[deleted]