<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Delphi &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/delphi/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 19:19:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ptesc.tech/wp-content/uploads/2026/09/cropped-cropped-large_icon-32x32.png</url>
	<title>Delphi &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Reverse engineering Delphi without IDR</title>
		<link>https://ptesc.tech/en/reversing-delphi-without-idr/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Fri, 27 Sep 2024 16:38:11 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[reverse]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%80%d0%b5%d0%b2%d0%b5%d1%80%d1%81%d0%b8%d0%bc-delphi-%d0%b1%d0%b5%d0%b7-idr/</guid>

					<description><![CDATA[🛠 Reverse Engineering Delphi without IDR When you're actively involved in reverse engineering, sooner or later you encounter an executable file written in Delphi. Analyzing objects in Delphi requires a special approach, and doing it manuall…]]></description>
										<content:encoded><![CDATA[🛠 <strong>Reverse Engineering Delphi without IDR</strong><br />
<br />
When you&#8217;re actively involved in reverse engineering, sooner or later you encounter an executable file written in Delphi. Analyzing objects in Delphi requires a special approach, and doing it manually is difficult. However, such analysis can be significantly accelerated with automation, if you know exactly how the object structure is organized.<br />
<br />
🕵️ <strong>The first step when analyzing Delphi</strong> — don&#8217;t forget to toggle the compiler parameter in <code>Options</code> → <code>Compiler Options</code> → <code>Compiler</code>, then IDA will handle function calls better.<br />
<br />
Classes in Delphi are created through the <code>ClassCreate</code> function, which receives a pointer to the class structure as input and calls the <code>Tobject_NewInstance</code> function within it by subtracting an offset from the VMT pointer. <br />
<br />
👀<strong> The class structure in Delphi itself looks as follows</strong> (<em>example in screenshot 1</em>):<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">
struct DelphiClassInternal
{
  DWORD* vmt;
  DWORD* InterfaceTable; used only for interfaces
  DWORD* PAutoTable; 
  DWORD* PInitTable;  
  DWORD* TypeInfo;
  DWORD* FieldTable;
  DWORD* MethodTable;
  DWORD* DynamicMethodTable;
}
</code></span></pre><br />
<br />
💼 Let&#8217;s examine the contents of the <code>TypeInfo</code>, <code>MethodTable</code>, and <code>FieldTable</code> fields in more detail, since they contain the most information useful for analysis.<br />
<br />
➡️ <strong>TypeInfo</strong><br />
<br />
In Delphi, every object type has its own identifier. As seen in screenshot 2, our object has identifier 7 — type <code>Class</code>. Depending on this type, the corresponding context is specified for the object. For classes, this is information about <code>Property</code> and a pointer to the parent type. Knowing the <code>Property</code> name, it&#8217;s easy to understand and annotate the <code>Get/Set functions</code>. Recovering these names greatly simplifies the perception of certain code blocks. <em>Example in screenshot 3</em>.<br />
<br />
➡️ <strong>MethodTable</strong><br />
<br />
The attentive reader will notice that <em>in screenshot 1</em> some method names are present. They can be extracted by looking into the table of published methods (of the current and parent classes). Delphi does not store information about other method types: private, protected, and public. Besides the name, it also provides: the return type, the number of arguments, their types and names. <br />
<br />
<strong>The pseudo-structure of a method can be represented as follows</strong> (<em>example in screenshot 4</em>):<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">
struct CMArg
{
  DWORD* TypeInfo;
  WORD   UNK;
  BYTE   NameLen;
  char   Name&#91;];
  BYTE   UNK2&#91;3];
}
struct ClassPubMethod
{
   WORD   EntrySize;
   DWORD* MethodPtr;
   BYTE   NameLen;
   char   Name&#91;];
   WORD   W_UNK1;
   DWORD* ReturnType;
   WORD   W_UNK2;
   BYTE   ArgCount;
   CMArg  Args&#91;];
}
</code></span></pre><br />
<br />
Due to the method inheritance mechanism in Delphi, recovering even a portion of method names is highly beneficial if done globally, for all classes. This can then be used, among other things, to generate the class VMT structure with meaningful names. <em>Example — in screenshot 5</em>.<br />
<br />
➡️ <strong>FieldTable</strong><br />
<br />
By looking into <code>Class</code> → <code>FieldTable</code>, you can find a large amount of information about variables (<em>example in screenshot 6</em>). It can be presented in two variants: <br />
<br />
<strong>1. </strong>As a name, offset, and variable type number (from the type table). The first two bytes in <code>FieldTable</code> — the number of entries in this table, the next four — a pointer to the type table.<br />
<br />
<strong>2.</strong> As a name, offset, and pointer to the variable type (the table begins immediately after the table from item 1). <br />
<br />
<strong>The variable structure has the following form:</strong><br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">
struct VarTypeTable
{
  WORD   Count;
  DWORD* Entries&#91;];
}
struct ClassVar
{
  DWORD* TypeInfo;
  WORD   VarOffset;
  WORD   UNK;
  BYTE   NameLen;
  char   Name&#91;];
}
struct TableClassVar
{
  WORD VarOffet;
  WORD UNK;
  WORD TableTypeNum;
  BYTE NameLen;
  char Name&#91;];
}
</code></span></pre><br />
<br />
Based on the obtained information about variables, a class structure can be composed (don&#8217;t forget that variables are also inherited from parent classes). <em>Example — in screenshot 7</em>.<br />
<br />
🤔 <strong>Summary</strong>: Delphi contains a large amount of RTTI information, thanks to which it is relatively easy to annotate a large number of functions or recover class structures to simplify static analysis.

<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_72@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_73@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_74@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_75@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="666" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_76@27-09-2024_16-38-11-1024x666.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_76@27-09-2024_16-38-11-1024x666.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_76@27-09-2024_16-38-11-300x195.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_76@27-09-2024_16-38-11-768x499.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_76@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/09/photo_77@27-09-2024_16-38-11.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>

<br />
<br />
<span class="hashtag">#TI</span> <span class="hashtag">#Delphi</span> <span class="hashtag">#Reverse</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
