all repos — site @ ad6e42281c617e19578967c99b2a64c12393a4d3

source for my site, found at icyphox.sh

Update Python for RE post with clarification

Signed-off-by: Anirudh <icyph0x@pm.me>
Anirudh icyph0x@pm.me
Thu, 20 Jun 2019 17:57:39 +0530
commit

ad6e42281c617e19578967c99b2a64c12393a4d3

parent

0b0232a3818122c625943a3976a88b880c210fdc

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M build/blog/python-for-re-1/index.htmlbuild/blog/python-for-re-1/index.html

@@ -307,6 +307,8 @@ </code></pre>

<p>I’m not sure why it uses <code>puts</code> here? I might be missing something; perhaps <code>printf</code> calls <code>puts</code>. I could be wrong. I also confirmed with radare2 that those locations are actually the strings “haha yes!” and “nah dude”.</p> +<p><strong>Update</strong>: It's because of compiler optimization. A <code>printf()</code> (in this case) is seen as a bit overkill, and hence gets simplified to a <code>puts()</code>.</p> + <h3>Conclusion</h3> <p>Wew, that took quite some time. But we’re done. If you’re a beginner, you might find this extremely confusing, or probably didn’t even understand what was going on. And that’s okay. Building an intuition for reading and grokking disassembly comes with practice. I’m no good at it either.</p>
M pages/blog/python-for-re-1.mdpages/blog/python-for-re-1.md

@@ -304,6 +304,8 @@

I’m not sure why it uses `puts` here? I might be missing something; perhaps `printf` calls `puts`. I could be wrong. I also confirmed with radare2 that those locations are actually the strings “haha yes!” and “nah dude”. +**Update**: It's because of compiler optimization. A `printf()` (in this case) is seen as a bit overkill, and hence gets simplified to a `puts()`. + ### Conclusion Wew, that took quite some time. But we’re done. If you’re a beginner, you might find this extremely confusing, or probably didn’t even understand what was going on. And that’s okay. Building an intuition for reading and grokking disassembly comes with practice. I’m no good at it either.