<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C-P01NTs on P01NT</title><link>https://outofsrvc.github.io/en/cworkshop/</link><description>Recent content in C-P01NTs 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/cworkshop/index.xml" rel="self" type="application/rss+xml"/><item><title>The Stages Code Goes Through</title><link>https://outofsrvc.github.io/en/cworkshop/compilation-stages/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/compilation-stages/</guid><description>&lt;p>Assalamu alaikum wa rahmatullahi wa barakatuh.&lt;/p>
&lt;p>This series covers the fundamentals of the C language that matter most for &lt;strong>reverse engineering&lt;/strong>. We will not expand into every detail of the language — only into what matters when reading disassembly and analyzing binaries.&lt;/p>
&lt;h2 id="the-stages-c-code-goes-through">The Stages C Code Goes Through&lt;/h2>
&lt;p>We start with the &lt;strong>source code&lt;/strong> — the &lt;code>.c&lt;/code> file containing what we wrote. This code passes through four stages before it executes, and understanding them is extremely important:&lt;/p></description></item><item><title>Program Structure</title><link>https://outofsrvc.github.io/en/cworkshop/program-structure/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/program-structure/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will look at the basic structural anatomy of a C program. The structure consists of essential parts that every C program adheres to:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;stdio.h&amp;gt; // Including system libraries&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>&lt;span class="c1">// Definition of constants or global variables
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&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 class="c1">// Other functions
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&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 class="kt">int&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Core code here
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// Variables, functions, loops, conditionals
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">return&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// Return value to the operating system
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>
&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 class="c1">// Other functions
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="1-includes">1. Includes&lt;/h2>
&lt;p>Example: &lt;code>#include &amp;lt;stdio.h&amp;gt;&lt;/code> — used to import built-in libraries. This particular library is responsible for input and output, and its name &lt;code>stdio&lt;/code> stands for:&lt;/p></description></item><item><title>Variables and Constants</title><link>https://outofsrvc.github.io/en/cworkshop/variables-and-constants/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/variables-and-constants/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover how to declare variables, the steps involved and the naming rules, plus how to define constants, their types, and how to declare them — and finally we will clarify the difference between variables and constants.&lt;/p>
&lt;h2 id="first-variables">First: Variables&lt;/h2>
&lt;p>&lt;strong>Definition&lt;/strong>: a location reserved in memory (RAM) to store a specific value while the program runs.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>A subtle note&lt;/strong>: when a function ends, a local variable&amp;rsquo;s space on the stack is reclaimed — but the value itself may &lt;strong>remain in physical memory&lt;/strong> until it is overwritten by other values. This concept matters greatly in reverse engineering: analysts sometimes hunt for stale values that were never deliberately wiped.&lt;/p></description></item><item><title>Data Types and Format Specifiers</title><link>https://outofsrvc.github.io/en/cworkshop/data-types-and-format-specifiers/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/data-types-and-format-specifiers/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will look at data types and the format specifiers associated with them.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Note&lt;/strong>: sometimes memorizing the English terminology is a must, because most of your work with programming languages will be in English — and Arabic translations vary from one person to another.&lt;/p>&lt;/blockquote>
&lt;h2 id="what-are-data-types">What Are Data Types?&lt;/h2>
&lt;p>They are the form in which data (such as variables) is stored so it can be kept and processed. The most important types:&lt;/p></description></item><item><title>Escape Sequences</title><link>https://outofsrvc.github.io/en/cworkshop/escape-sequences/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/escape-sequences/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will look at escape sequences, their importance, and their uses.&lt;/p>
&lt;h2 id="what-are-escape-sequences">What Are Escape Sequences?&lt;/h2>
&lt;p>They are used inside strings to represent special characters or to control output formatting. They are written as a backslash (&lt;code>\&lt;/code>) followed by one or more characters. Their purpose is to make it easy to represent special characters that are hard to type inside a string literal — such as tab or newline.&lt;/p></description></item><item><title>Conditional Statements</title><link>https://outofsrvc.github.io/en/cworkshop/conditionals/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/conditionals/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover if / else-if / else, nested if statements, the switch statement, and the ternary operator.&lt;/p>
&lt;p>&lt;strong>Conditional statements&lt;/strong>: used to make decisions based on certain conditions — different instructions execute depending on whether a condition evaluates to true or false.&lt;/p>
&lt;h2 id="1-the-if-statement">1. The if Statement&lt;/h2>
&lt;p>Used to check a condition and execute code if it is true. It is the simplest form.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">condition&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// runs if the condition is true
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="2-the-if-else-statement">2. The if-else Statement&lt;/h2>
&lt;p>Executes one piece of code if the condition is true, and a different piece if it is false.&lt;/p></description></item><item><title>Loops</title><link>https://outofsrvc.github.io/en/cworkshop/loops/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/loops/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover loops: &lt;code>while&lt;/code>, &lt;code>do-while&lt;/code>, &lt;code>for&lt;/code>, and nested loops — along with how to control them and when each one fits.&lt;/p>
&lt;p>&lt;strong>Loops&lt;/strong>: used to execute a block of instructions repeatedly based on a condition. There are several kinds, and each suits a different use case.&lt;/p>
&lt;h2 id="1-the-while-loop">1. The while Loop&lt;/h2>
&lt;p>Used when repetition depends on a condition — and the loop may not run at all if the condition is never met.&lt;/p></description></item><item><title>Arrays and Strings</title><link>https://outofsrvc.github.io/en/cworkshop/arrays-and-strings/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/arrays-and-strings/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover arrays and strings, their uses, and their importance in reverse engineering.&lt;/p>
&lt;blockquote>
&lt;p>From this article onward we go deeper — because the remaining articles are among the most valuable for reverse engineering, and mastering them is essential.&lt;/p>&lt;/blockquote>
&lt;p>Arrays and strings are among the most important data structures for storing and processing data, and they differ in usage and structure. &lt;strong>Understanding how they live in memory is the foundation of executable analysis, especially when it comes to uncovering vulnerabilities.&lt;/strong>&lt;/p></description></item><item><title>Functions</title><link>https://outofsrvc.github.io/en/cworkshop/functions/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/functions/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we will cover functions, their types and forms, and the functions that matter most in reverse engineering.&lt;/p>
&lt;p>&lt;strong>Functions play a pivotal role in programming, and especially in reverse engineering&lt;/strong> — they are the fundamental unit of analysis: when you open any program in IDA or Ghidra, the first thing you see is a list of functions, and understanding them is how you understand the program.&lt;/p>
&lt;h2 id="what-is-a-function">What Is a Function?&lt;/h2>
&lt;p>Fundamental units for reusing and organizing code — &amp;ldquo;blocks&amp;rdquo; of instructions designed to perform specific tasks. Every function can accept arguments and return a value.&lt;/p></description></item><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>Bitwise Operators</title><link>https://outofsrvc.github.io/en/cworkshop/bitwise-operators/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/bitwise-operators/</guid><description>&lt;p>Assalamu alaikum wa rahmatullahi wa barakatuh.&lt;/p>
&lt;p>From this article on we deal with C at a genuinely &lt;strong>low level&lt;/strong>.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Before starting&lt;/strong>: you should be comfortable with the basics of C — you can review the previously published basics series.&lt;/p>&lt;/blockquote>
&lt;p>In this article we cover bitwise operators plus increment/decrement and the ternary operator. We will not focus on simple arithmetic (addition, subtraction&amp;hellip;) because it is self-evident — this series focuses on the more powerful constructs that serve us in reverse engineering.&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><item><title>Passing by Value vs by Reference</title><link>https://outofsrvc.github.io/en/cworkshop/pass-by-value-vs-reference/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/pass-by-value-vs-reference/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>From this article we begin entering &lt;strong>x86-64 Assembly&lt;/strong> to gain low-level understanding. The explanation will be simple and clear.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Prerequisite&lt;/strong>: a study of computer architecture and organization, plus basic knowledge of memory and registers (covered in the pointers and stack-vs-heap articles), is recommended before continuing this series.&lt;/p>&lt;/blockquote>
&lt;blockquote>
&lt;p>&lt;strong>Example environment&lt;/strong>: the gcc outputs here are from Linux (the SysV convention, where the first argument goes in RDI). On Windows x64 the argument registers differ (RCX/RDX/R8/R9) as explained in the virtual memory article.&lt;/p></description></item><item><title>Functions — Part Two</title><link>https://outofsrvc.github.io/en/cworkshop/functions-part-two/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/functions-part-two/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>Having laid the cornerstone of C, memory division, pointers, and the assembly introduction — we continue toward a complete body of knowledge. This article treats functions at an &lt;strong>advanced&lt;/strong> level, with K&amp;amp;R as a primary reference, tracing registers in the assembly to see how the code moves at the low level.&lt;/p>
&lt;p>&lt;strong>Article index:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>1.1 Variable Scope&lt;/li>
&lt;li>1.2 Header Files&lt;/li>
&lt;li>1.3 Static Variables and Functions&lt;/li>
&lt;li>1.4 Recursion&lt;/li>
&lt;/ul>
&lt;h2 id="function-essentials">Function Essentials&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Component&lt;/th>
 &lt;th>Description&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>&lt;strong>Signature&lt;/strong>&lt;/td>
 &lt;td>the declaration: &lt;code>returnType funcName(Parameters) {}&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Body&lt;/strong>&lt;/td>
 &lt;td>what the function does&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Parameters&lt;/strong>&lt;/td>
 &lt;td>input values&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;strong>Return value&lt;/strong>&lt;/td>
 &lt;td>the main output&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="a-functions-execution-model">A Function&amp;rsquo;s Execution Model&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="nf">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">int&lt;/span> &lt;span class="n">a&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kt">int&lt;/span> &lt;span class="n">b&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kt">int&lt;/span> &lt;span class="n">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">a&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">b&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">result&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="the-assembly-32-bit">The Assembly (32-bit)&lt;/h3>
&lt;p>We use &lt;code>-m32&lt;/code> to simplify the explanation (the classic EBP pattern seen in millions of legacy programs):&lt;/p></description></item><item><title>Data Modifiers</title><link>https://outofsrvc.github.io/en/cworkshop/data-modifiers/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/data-modifiers/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we cover &lt;strong>data modifiers&lt;/strong> — the keywords that change the properties and shape of data types:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Sign&lt;/strong>: &lt;code>signed&lt;/code>, &lt;code>unsigned&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Size&lt;/strong>: &lt;code>short&lt;/code>, &lt;code>long&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Storage&lt;/strong>: &lt;code>auto&lt;/code>, &lt;code>register&lt;/code>, &lt;code>extern&lt;/code>, &lt;code>static&lt;/code>.&lt;/li>
&lt;/ul>
&lt;h3 id="general-notes">General Notes&lt;/h3>
&lt;ul>
&lt;li>You cannot combine more than one modifier of the same kind (&lt;code>long short&lt;/code> together is invalid).&lt;/li>
&lt;li>Some modifiers are invalid in certain positions — like &lt;code>unsigned float&lt;/code>, because floats are &lt;strong>always signed&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;h2 id="1-sign-modifiers">1. Sign Modifiers&lt;/h2>
&lt;p>How is a signed variable represented inside a data type? Three methods evolved over time:&lt;/p></description></item><item><title>Structures</title><link>https://outofsrvc.github.io/en/cworkshop/structures/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/structures/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we cover the &lt;strong>Structure&lt;/strong> — the first user-defined data type.&lt;/p>
&lt;h2 id="struct-basics">Struct Basics&lt;/h2>
&lt;p>We know C ships with standard data types: &lt;code>int&lt;/code>, &lt;code>char&lt;/code>, &lt;code>float&lt;/code>, &lt;code>double&lt;/code>&amp;hellip;&lt;/p>
&lt;p>What if we want to represent a &lt;strong>real-world object&lt;/strong> — like a person with a &lt;strong>name&lt;/strong> and an &lt;strong>age&lt;/strong>? We need to mix a string (array of characters) with an int inside one object.&lt;/p>
&lt;p>That is where the &lt;strong>Structure&lt;/strong> comes in: it resembles an array, but it &lt;strong>groups variables of multiple types&lt;/strong> (whereas arrays hold one type). Since the developer designs it, it counts as a &lt;strong>User Defined Data Type&lt;/strong>.&lt;/p></description></item><item><title>Bit Fields, Unions, and Enums</title><link>https://outofsrvc.github.io/en/cworkshop/bit-fields-unions-enums/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/bit-fields-unions-enums/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>In this article we cover &lt;strong>Bit Fields&lt;/strong>, &lt;strong>Unions&lt;/strong>, and &lt;strong>Enums&lt;/strong>.&lt;/p>
&lt;h2 id="1-bit-fields">1. Bit Fields&lt;/h2>
&lt;p>We established in the previous article that a struct distributes &lt;strong>bytes&lt;/strong> — but what if we want to split a &lt;strong>single byte into bits&lt;/strong>? That is the bit field: we specify the number of bits per member.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="k">typedef&lt;/span> &lt;span class="k">struct&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">u8&lt;/span> &lt;span class="nl">a&lt;/span> &lt;span class="p">:&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 4 bits
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="n">u8&lt;/span> &lt;span class="nl">b&lt;/span> &lt;span class="p">:&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 2 bits
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="n">u8&lt;/span> &lt;span class="nl">c&lt;/span> &lt;span class="p">:&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 1 bit
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span> &lt;span class="n">student&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 7 bits total ← inside one byte
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&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">+---+---+---+---+---+---+---+---+
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">| a (4 bits) | b (2) | c | (free) |
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">+---+---+---+---+---+---+---+---+
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;blockquote>
&lt;p>&lt;strong>Note&lt;/strong>: the compiler packs bit fields into the byte, but does not guarantee identical behavior across all compilers (implementation-defined). During analysis, reading bit fields in assembly involves &lt;code>and&lt;/code>/&lt;code>shift&lt;/code> operations.&lt;/p></description></item><item><title>The Preprocessor</title><link>https://outofsrvc.github.io/en/cworkshop/preprocessor/</link><pubDate>Thu, 13 Aug 2026 10:00:00 +0300</pubDate><guid>https://outofsrvc.github.io/en/cworkshop/preprocessor/</guid><description>&lt;p>Bismillah.&lt;/p>
&lt;p>After this series of articles we have completed the fundamentals of C — and next, God willing, comes the Malware Development series.&lt;/p>
&lt;p>In this article we cover the &lt;strong>directives&lt;/strong> of the preprocessor — the &lt;code>#&lt;/code> sign followed by reserved words that the preprocessor understands, substituted before compilation.&lt;/p>
&lt;blockquote>
&lt;p>A recap of the compilation stages (covered in the first article) — in isolated form:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">gcc -E file.c -o file.i &lt;span class="c1"># 1. Preprocessor&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">gcc -S file.i -o file.s &lt;span class="c1"># 2. Compiler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">gcc -c file.s -o file.o &lt;span class="c1"># 3. Assembler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">gcc file.o -o file &lt;span class="c1"># 4. Linker&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/blockquote>
&lt;h2 id="1-inclusion-directives">1. Inclusion Directives&lt;/h2>
&lt;h3 id="include">&lt;code>#include&lt;/code>&lt;/h3>
&lt;p>It enables restructuring: splitting a large program into multiple files, each responsible for a specific function:&lt;/p></description></item></channel></rss>