<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Heap on P01NT</title><link>https://outofsrvc.github.io/en/tags/heap/</link><description>Recent content in Heap on P01NT</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 13 Aug 2026 10:00:00 +0300</lastBuildDate><atom:link href="https://outofsrvc.github.io/en/tags/heap/index.xml" rel="self" type="application/rss+xml"/><item><title>Pointers and Memory Management</title><link>https://outofsrvc.github.io/en/cworkshop/pointers-and-memory/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/pointers-and-memory/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover pointers and their types, along with an introduction to memory management and allocation. This is &lt;strong>the final article of the basics series&lt;/strong>, God willing.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note&lt;/strong>: we will not expand into memory management as deeply as the topic deserves — we cover the core concepts that help us understand pointers, because the subject warrants its own article.&lt;/p>&lt;/blockquote>
&lt;p>Pointers are a powerful tool giving direct control over memory, which makes them of paramount importance when analyzing programs and understanding binary instructions.&lt;/p></description></item><item><title>Virtual Memory: Stack vs Heap</title><link>https://outofsrvc.github.io/en/cworkshop/virtual-memory-stack-vs-heap/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/virtual-memory-stack-vs-heap/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we discuss the design of stack and heap memory, and clarify the differences between them.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note&lt;/strong>: this article does not cover everything exhaustively, but it will bring us to a full understanding of the topics we discuss.&lt;/p>&lt;/blockquote>
&lt;h2 id="memory-layout">Memory Layout&lt;/h2>
&lt;p>As mentioned in the pointers article, program memory in modern x86/x64 systems divides into 5 main segments (some say 4 by merging Data with BSS):&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Text Segment&lt;/strong> — the executable instructions (read-only).&lt;/li>
&lt;li>&lt;strong>Data Segment&lt;/strong> — initialized globals.&lt;/li>
&lt;li>&lt;strong>BSS Segment&lt;/strong> — uninitialized globals.&lt;/li>
&lt;li>&lt;strong>Heap&lt;/strong> — dynamic allocation.&lt;/li>
&lt;li>&lt;strong>Stack&lt;/strong> — locals and function frames.&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">+-----------------+ high addresses
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| Stack | grows downward
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| | |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| v |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">+-----------------+
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| (gap) |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">+-----------------+
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| ^ |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| | |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| Heap | grows upward
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">+-----------------+
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| BSS |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| Data |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| Text |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">+-----------------+ low addresses
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;blockquote>
&lt;p>We are dealing only with the &lt;strong>user space&lt;/strong> here — kernel space is another topic.&lt;/p></description></item><item><title>Dynamic Memory Allocation</title><link>https://outofsrvc.github.io/en/cworkshop/dynamic-allocation/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/dynamic-allocation/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>After discussing the heap and the stack and understanding the internal structure of each, today we cover &lt;strong>dynamic memory allocation&lt;/strong> in an expanded way — free-memory management and the most common vulnerabilities in this area.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Dynamic Memory Allocation&lt;/strong>: understanding it is essential for analyzing software, exploiting vulnerabilities, and understanding how programs work from the inside.&lt;/p>&lt;/blockquote>
&lt;h2 id="core-allocation-functions">Core Allocation Functions&lt;/h2>
&lt;h3 id="1-malloc-and-free">1. malloc() and free()&lt;/h3>
&lt;p>&lt;strong>malloc&lt;/strong> allocates a heap block of a given size (in bytes) &lt;strong>without initialization&lt;/strong> — its contents are garbage values:&lt;/p></description></item></channel></rss>