Daniele Esposti's Blog

Cross-compile 64-bit code on 32-bit machine

Now that I have a spare machine where I can do all my experiments, I can start again to write posts about Disassembly C code for fun but, wait, my current hardware is a 32-bit Pentium-M CPU and I want to build and disassembly 64-bit code! Let’s set up my...


Install Ubuntu without PAE support

Last night I brought to a new life my old laptop to be used during my commuting time to write posts, to experiments some technologies and last but not least show how old hardware can be recycled and used efficiently. With my great surprise I discovered most of the 32-bit...


Hamming weight's Python implementation

Counting the number of 1’s in a binary representation of a number (aka Hamming weight aka popcount when binary numbers are involved) with Python using different implementations (naive implementations are obviously excluded :-) ). Implementation and benchmarking To compute the Hamming weight of a number in binary representation two implementations...


Disassembly C code for fun – Part 7: buffer overflow protection

Originally this article was about strings but as soon as I disassembled the first C test code I saw an interesting bit of assembly code so I switched the topic: today we will talk about buffer overflow protection and the canary (obviously I’m not talking about the little bird but...


Disassembly C code for fun – Part 6: inlining expansion

Today we will talk about code inlining which means the ability of the compiler to replace a function call with the body of the called function. The sample code and disassembly The code outputs the power of two between 0 to 9 by colling a power() function: #include <stdio.h> int...