<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Lowyat.NET: Latest topics by angch</title>
        <description></description>
        <link>http://forum.lowyat.net/</link>
        <lastBuildDate>Sun, 05 Jul 2026 16:32:20 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Advent of Code 2021</title>
            <link>http://forum.lowyat.net/topic/5220717</link>
            <description>&lt;a href='https://adventofcode.com/' target='_blank'&gt;https://adventofcode.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Christmas-themed computer programming challenges that follow an Advent calendar and can be solved using any programming language. &lt;br /&gt;&lt;br /&gt;Day 2 soon. &lt;br /&gt;&lt;br /&gt;PM me if anyone wanna join my private leaderboard. &lt;a href='https://adventofcode.com/2021/leaderboard/private' target='_blank'&gt;https://adventofcode.com/2021/leaderboard/private&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve posted by solution for yesterday&amp;#39;s puzzle here:&lt;br /&gt;&lt;br /&gt;&lt;a href='https://github.com/angch/adventofcode/tree/master/angch/2021-01' target='_blank'&gt;https://github.com/angch/adventofcode/tree/...r/angch/2021-01&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some of us discuss the solutions and puzzles over at the #code channel on &lt;a href='https://engineersmy.slack.com' target='_blank'&gt;https://engineersmy.slack.com&lt;/a&gt; (invites via &lt;a href='https://engineers.my/' target='_blank'&gt;https://engineers.my/&lt;/a&gt; ) I&amp;#39;ll stream/record my attempts whenever I can.&lt;br /&gt;&lt;br /&gt;New day, new challenge begins everyday until 25th December, at our lunch time, 1PM.&lt;br /&gt;&lt;br /&gt;Good luck, have fun.</description>
            <author>angch</author>
            <category>Codemasters</category>
            <pubDate>Thu, 02 Dec 2021 12:09:29 +0800</pubDate>
        </item>
        <item>
            <title>Windows Portable Executable files as a unix script</title>
            <link>http://forum.lowyat.net/topic/5015853</link>
            <description>&lt;!--QuoteBegin--&gt;&lt;div class='quotetop'&gt;QUOTE&lt;/div&gt;&lt;div class='quotemain'&gt;&lt;!--QuoteEBegin--&gt;it&amp;#39;s possible to encode Windows Portable Executable files as a UNIX Sixth Edition shell script, due to the fact that the Thompson Shell didn&amp;#39;t use a shebang line. Once I realized it&amp;#39;s possible to create a synthesis of the binary formats being used by Unix, Windows, and MacOS, I couldn&amp;#39;t resist the temptation of making it a reality, since it means that high-performance native code can be almost as pain-free as web apps. Here&amp;#39;s how it works:&lt;br /&gt;&lt;!--QuoteEnd--&gt;&lt;/div&gt;&lt;!--QuoteEEnd--&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&lt;br /&gt;MZqFpD=&amp;#39;&lt;br /&gt;BIOS BOOT SECTOR&amp;#39;&lt;br /&gt;exec 7&amp;#60;&amp;#62; &amp;#036;&amp;#40;command -v &amp;#036;0&amp;#41;&lt;br /&gt;printf &amp;#39;&amp;#092;177ELF...LINKER-ENCODED-FREEBSD-HEADER&amp;#39; &amp;#62;&amp;amp;7&lt;br /&gt;exec &amp;#34;&amp;#036;0&amp;#34; &amp;#34;&amp;#036;@&amp;#34;&lt;br /&gt;exec qemu-x86_64 &amp;#34;&amp;#036;0&amp;#34; &amp;#34;&amp;#036;@&amp;#34;&lt;br /&gt;exit 1&lt;br /&gt;REAL MODE...&lt;br /&gt;ELF SEGMENTS...&lt;br /&gt;OPENBSD NOTE...&lt;br /&gt;MACHO HEADERS...&lt;br /&gt;CODE AND DATA...&lt;br /&gt;ZIP DIRECTORY..&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='https://justine.storage.googleapis.com/ape.html' target='_blank'&gt;https://justine.storage.googleapis.com/ape.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='https://github.com/jart/cosmopolitan' target='_blank'&gt;https://github.com/jart/cosmopolitan&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Go wild, @Tullamarine.</description>
            <author>angch</author>
            <category>Codemasters</category>
            <pubDate>Mon, 24 Aug 2020 11:03:10 +0800</pubDate>
        </item>
        <item>
            <title>Quote. Your. Damn. SQL. Inputs&amp;#33;</title>
            <link>http://forum.lowyat.net/topic/3517328</link>
            <description>&lt;a href='https://forum.lowyat.net/topic/3398408' target='_blank'&gt;https://forum.lowyat.net/topic/3398408&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yes, I&amp;#39;m talking about you, &lt;a href='https://forum.lowyat.net/topic/3517025' target='_blank'&gt;https://forum.lowyat.net/topic/3517025&lt;/a&gt;</description>
            <author>angch</author>
            <category>Codemasters</category>
            <pubDate>Mon, 09 Mar 2015 13:26:09 +0800</pubDate>
        </item>
        <item>
            <title>Quote your damn SQL inputs&amp;#33;</title>
            <link>http://forum.lowyat.net/topic/3398408</link>
            <description>Sigh, have enough of seeing bad code passing by here, and people replying and fixing the wrong (IMHO) things. Topic is closed, so didn&amp;#39;t manage to post proper reply to the original post.&lt;br /&gt;&lt;br /&gt;Read these:&lt;br /&gt;&lt;br /&gt;&lt;a href='http://en.wikipedia.org/wiki/SQL_injection' target='_blank'&gt;http://en.wikipedia.org/wiki/SQL_injection&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://php.net/manual/en/mysqli-stmt.bind-param.php' target='_blank'&gt;http://php.net/manual/en/mysqli-stmt.bind-param.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://php.net/manual/en/security.database.sql-injection.php' target='_blank'&gt;http://php.net/manual/en/security.database.sql-injection.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TL/DR:&lt;br /&gt;&lt;br /&gt;Don&amp;#39;t do this:&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&amp;#036;mysqli-&amp;#62;query&amp;#40;&amp;#34;UPDATE table Foo set body= &amp;#39;&amp;#34;.&amp;#036;_POST&amp;#91;&amp;#39;body&amp;#39;&amp;#93;.&amp;#34;&amp;#39; where id= &amp;#39;&amp;#34;.&amp;#036;_POST&amp;#91;&amp;#39;id&amp;#39;&amp;#93;.&amp;#34;&amp;#39;&amp;#34;&amp;#41;;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;Do this (well, a *better* version of this):&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;&amp;#036;stmt = mysqli_prepare&amp;#40;&amp;#036;link, &amp;#34;UPDATE table Foo set body = ? where id= ?&amp;#34;&amp;#41;;&lt;br /&gt;mysqli_stmt_bind_param&amp;#40;&amp;#036;stmt, &amp;#39;sd&amp;#39;, &amp;#036;_POST&amp;#91;&amp;#39;body&amp;#39;&amp;#93;, &amp;#036;_POST&amp;#91;&amp;#39;id&amp;#39;&amp;#93;&amp;#41;;&lt;br /&gt;mysqli_stmt_execute&amp;#40;&amp;#036;stmt&amp;#41;;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;</description>
            <author>angch</author>
            <category>Codemasters</category>
            <pubDate>Mon, 03 Nov 2014 20:26:57 +0800</pubDate>
        </item>
    </channel>
</rss>
