Answer
stringlengths
38
29k
Id
stringlengths
1
5
CreationDate
stringlengths
23
23
Body
stringlengths
55
28.6k
Title
stringlengths
15
145
Tags
stringlengths
3
68
<p>The easiest way to find out the function in question would probably be by dynamic analysis. You can easily do this by placing a breakpoint on that instruction in a debugger and examining the registers. </p> <p>A more general solution would probably involve some scripting to record all calls and add that information...
2127
2013-05-28T16:36:23.640
<p>I am reverse engineering some code from which IDA has generated the following disassembly. These specific lines of code are just for illustrative purposes. Notice that the third line does not call a specifc function by its name but rather by its address.</p> <pre><code>mov rcx, [rsp+128h+var_D8] // reg CX gets t...
How to identify function calls in IDA Pro's disassembly?
|ida|disassembly|virtual-functions|
<p>I think the default in IDA 6.8 is a Cross reference depth of 16. I increased this first to 32 and then to 1024 and then to 65535 (because why not). None of this led to my xref working as desired so I must not understand something.</p> <p>I'm analyzing an ARM ELF shared object file. The function I'm looking at is ca...
2130
2013-05-28T19:21:45.277
<p>In the IDA view I see (<code>glb_SomeVar</code> is a byte array):</p> <pre><code>cmp al, glb_SomeVar+22h </code></pre> <p>But when I hit <kbd>x</kbd> to find the cross references of glb_SomeVar, I only find two other matches in the same function:</p> <pre><code>cmp al, glb_SomeVar+0Ah cmp al, glb_SomeVar+0Bh </co...
IDA is not recognizing cross references
|ida|
<p>If you can not add something to the imports viewer you can write your own. Here is the simple example (it is slightly modified example referenced at <a href="http://www.hexblog.com/?p=229" rel="noreferrer">this hexblog entry</a> and located <a href="http://hexblog.com/ida_pro/files/ImportExportViewer.py" rel="norefe...
2133
2013-05-29T16:04:24.183
<p>The title says most of it. Say I have a Windows PE (x86, 32bit) binary (just so we have case to discuss), the imports list will usually only show the imports found in the import directory. The attributes it shows are address of the function, name and library from which it got imported as shown in this screenshot sni...
In IDA, is there a way to add a reference to a dynamically imported function into the Imports tab?
|ida|idapython|import-reconstruction|ida-plugin|
<p><strong>Note:</strong> I am assuming 32bit x86 on Windows, your question unfortunately doesn't state for certain. But since it's Windows and you don't explicitly mention x64 this was the sanest assumption I could make.</p> <p>First off, try to search for the function names with a search engine. Don't just settle fo...
2134
2013-05-29T21:00:14.810
<p>I have an unknown .dll from another program which I want to work with. With <a href="http://www.nirsoft.net/utils/dll_export_viewer.html">DLL Export Viewer</a> I was able to find the exported functions.</p> <p><img src="https://i.stack.imgur.com/qIDYL.png" alt="enter image description here"></p> <p>But to call the...
Get the function prototypes from an unknown .dll
|windows|dll|
<p>In a typical, non-packed Windows PE executable, the header contains metadata that describes to the operating system which symbols from other libraries that the executable depends upon. The operating system's loader is responsible for loading those libraries into memory (if they are not already loaded), and for plac...
2142
2013-05-30T22:15:57.203
<p>When reading about unpacking, I sometimes see an "import reconstruction" step. What is this and why is it necessary?</p>
What is import reconstruction and why is it necessary?
|unpacking|import-reconstruction|
<p>DynamoRIO could be very good for more in-depth dynamic library analysis. DynamoRIO is a dynamic binary translator that works on both Linux and Windows, for both x86 and x86-64.</p> <p>To analyse DLLs using DynamoRIO, you would register module load and unload events using the <code>dr_register_module_load_event</cod...
2147
2013-05-31T03:25:59.193
<p>Are there techniques for dynamic analysis of shared libraries? I know for example that DLLs have an entry point, but how about calling other exported functions? Do I need to write a custom executable that calls exports for each DLL I want to analyze?</p>
Dynamic Analysis for Shared Libraries?
|dynamic-analysis|dll|
<p>Ok, I had a few e-mails with Fabrice Desclaux (aka serpilliere), one of the main contributor of miasm.</p> <p>In fact, miasm (version 1) cannot disassemble amd64 opcodes (but do not issue any error if such executable is encountered). What is really misleading, is that the elf-64 is handled but the disassembler fail...
2152
2013-05-31T12:59:09.943
<p>I am trying to use <a href="http://code.google.com/p/smiasm/" rel="nofollow">Miasm</a> to reverse some binaries in i386 and amd64 instruction sets, but I encounter a few problem when using it.</p> <p>First, the installation phase went nice. I managed to install <code>tinycc</code> with the small modification of the...
Is miasm working on 64bits architecture?
|amd64|
<p>Following up alahel's answer, the date is indeed a number of milliseconds, but it includes 1 further bit to the left and is from the standard epoch of 1 Jan 1970. For example:</p> <pre><code>08014273ed2071a6800017 ~^^^^^^^^^^ </code></pre> <p>where it includes the least significant bit from the &quot;7&quot;, ...
2159
2013-06-01T10:36:24.940
<p>I have the following hex parts and I have a strong suspicion that behind them is a date of an event:</p> <pre><code>2013.05.23 20:35:00 08014273ed2071a6800017 2013.05.23 21:45:00 08014273ed246cf0000017 2013.05.24 17:10:00 08014273ed675173000017 2013.05.25 01:10:00 08014273ed82900f000017 2013.05.25 ...
Trying to reverse engineer dump of a timestamp
|obfuscation|file-format|
<p>Based on <a href="http://pastebin.com/raw.php?i=t8BG08xf" rel="nofollow">the output</a> of <a href="http://www.solemnwarning.net/page/code#nedump" rel="nofollow">NE dumper</a>, the level data appears to begin at file offset 0x17600 and each level appears to be 0x200 bytes long.</p>
2160
2013-06-01T13:33:26.727
<p>I am trying to recreate an old game just for the sake of nostalgia and learning something new alongside (I can program in various languages and know a bit of assembly language, but I'm new to reverse engineering). The game is called Banania and looks like this:</p> <p><img src="https://i.stack.imgur.com/VNEfD.jpg" ...
Find level data in binaries?
|binary-analysis|
<p>Your best bet is <a href="https://bitbucket.org/haypo/hachoir/wiki/hachoir-subfile" rel="nofollow noreferrer">Hachoir-Subfile</a>. You can pass a file stream to Hachior-Subfile, it will search for all known embedded files and display the location. Some known formats it will calculate the size of the file. This makes...
2161
2013-06-01T14:33:48.113
<p>I have a .bin file I would like to analyse. Especially find images embedded in this firmware update.</p> <ul> <li><a href="https://code.google.com/p/binwalk/" rel="nofollow">binwalk</a> couldn't find anything.</li> </ul> <p>What other tools do you know to search for possible embedded files?</p>
Find file signatures inside an unknown file
|tools|binary-analysis|file-format|firmware|
<p>Without further information, it looks like deliberate obfuscation: instructions with no ultimate effect inserted into the code to make it harder to read. I doubt that code was generated by a compiler.</p>
2167
2013-06-02T03:08:42.323
<p>I have recently came across the following sequence of assembly instructions. </p> <pre><code>call ds:WSAStartup push ecx push edi mov ecx, 69E65AC4h mov edi, 2776452Ah pop edi pop ecx jmp short loc_ABCD </code></pre> <p>Please help me make sense of these particular 4 instructions below...
What could this sequence of assembly instructions possibly mean?
|disassembly|windows|assembly|x86|
<p>To detect the polymorphic engine itself - properly - requires a copy of the engine. That was the case in the past, since the virus carried the engine in order to produce new copies of itself. The obvious attack against that is server-side polymorphism, where we ("we"=the AV industry) are left to guess at the capab...
2169
2013-06-02T06:03:22.543
<p>I was working on a hobby AV project using ClamAV's engine. While ClamAV is a good open source engine, it has poor support for detecting polymorphic viruses. The latest updated version failed to detect many instances of Virut and Sality. How do commercial AVs detect polymorphic viruses?</p>
How do AV vendors create signatures for polymorphic viruses?
|malware|
<p>MSR tracing generally refers to using the Intel Model-Specific Registers (MSRs) to obtain trace information from the CPU. Because modern (post-Pentium 4, generally) processors have hardware support for debugging, this can be faster than software-only solutions. There are a few ways this can be done:</p> <ul> <li><p...
2173
2013-06-02T19:01:38.480
<p>I was reading a <a href="http://www.openrce.org/blog/view/1061/Industrial-Grade_Binary-Only_Profiling_and_Coverage">old blog post on OpenRCE</a> that mentions MSR tracing in the context of binary only profiling and coverage. The only Google hits for this term are a few emails on the Xen mailing list that I am not ab...
What is MSR Tracing?
|dynamic-analysis|
<p>First Find the address you are looking for. Then cycle this:</p> <ol> <li>Find the base (the beginning of the record).</li> <li>Dissect the memory around this to recognize array or linked list.</li> <li>Search the memory for pointer to that base.</li> </ol> <p><strong>Example</strong>:</p> <p>Scan for parameter f...
2176
2013-06-03T06:13:11.763
<p>I am reversing a game using Cheat Engine and OllyDBG, through this memory addresses within an FPS game are read and monitored, these addresses will contain the coordinates(xyz) of enemies.</p> <p>My Objective is to find an address or a pattern that will allow me to loop through up to 32 enemies in order to read al...
How to find arrays of objects (entities, enemies) in a game I'm reversing with Cheat Engine?
|disassembly|ollydbg|debugging|debuggers|struct|
<p>Go to the <code>Local Types</code> (<code>View-&gt;Open Subviews-&gt;Local Types</code> or <kbd>Shift</kbd> + <kbd>F1</kbd>) window and then edit it from there by right clicking and clicking on <code>edit</code> on your structure's entry on the list.</p>
2178
2013-06-03T08:36:41.400
<p>I manage my structures in C files, the header might look like this:</p> <pre><code>#pragma pack(0) typedef struct { short important_value; char _A[2]; // unknown int interesting_value; } STRUCT; </code></pre> <p>I loaded this into IDA via <kbd>Ctrl</kbd>+<kbd>F9</kbd>. Now I find out more about the...
How to let IDA reload a structure from a C file?
|ida|
<blockquote> <p>But surely something must know where all the devices live in memory, because something is responsible for routing memory reads/writes to the correct device.</p> </blockquote> <p>In embedded devices there's nothing like PCI (well, it may be present but it's just one of the many HW blocks). So you can'...
2181
2013-06-03T17:03:07.547
<p>On many embedded systems, a great deal of communication with devices is done by reading and writing to memory-mapped I/O (MMIO) addresses in software. Supposing that I have access to the physical device, and a copy of the firmware that I can load in IDA, how can I figure out which devices are at which addresses?</p>...
How can I figure out the device memory map for an embedded system?
|hardware|embedded|
<p>Okay, Windows XP, OpenWatcom. I am using OpenWatcom 1.9. When trying to reproduce your problem, I used <code>calc.exe</code> from Windows XP for which there are no Watcom debug symbols available (only the PDB format from Microsoft, which Watcom doesn't support <em>at all</em>).</p> <p>When dismissing the open dialo...
2185
2013-06-03T22:45:34.807
<p><a href="http://www.openwatcom.org" rel="nofollow">OpenWatcom's</a> debugger just executes the binary instead of single-stepping through it, when I attempt the following steps:</p> <ol> <li><code>File-&gt;Open</code>, select executable</li> <li><code>Run-&gt;Trace Into</code></li> </ol> <p>This attempt <a href="ht...
How to debug using OpenWatcom's debugger?
|windows|debuggers|
<p>UPDATE: This seems to be obsolete.</p> <p>You can debug IDAPython scripts using Python Tools for Visual Studio. It is completely free, and very easy to use.</p> <p>See <a href="http://sark.readthedocs.org/en/latest/debugging.html" rel="nofollow noreferrer">this tutorial</a> for this information.</p>
2190
2013-06-04T19:47:44.587
<p>IDAPython is great plugin in IDA. It is so handy to write small script to decode, decrypt or fix (patch) a binary in IDA. I can just write, load and run a script, and can use <code>print</code> for the usual shotgun debugging. But when I develop a bigger IDAPython script, I need a way to debug it. </p> <p>I have s...
How to debug an IDAPython script from within IDA?
|python|idapython|ida|
<p>Have a look at the <code>var_4</code> definition at the start of the function:</p> <pre><code>var_4 = dword ptr -4 </code></pre> <p>So it's actually negative as expected.</p> <p>For a more complete picture, use <kbd>Ctrl+K</kbd> or double-click/Enter on the stack var to see the <a href="https://www.hex-rays.com/p...
2194
2013-06-07T01:11:42.543
<p>Let's take a look of how IDA displays address of local variable. For instance:</p> <pre><code>MOV EAX, [EBP + var_4] </code></pre> <p>As we all know as far as local variables go, they are located at lower addresses of EBP.</p> <p><img src="https://i.stack.imgur.com/XDoh3.png" alt="Stack Frame"></p> <p>Though, I ...
IDA EBP variable offset
|disassembly|assembly|static-analysis|callstack|ida|
<p>Hex-Rays performs liveness analysis and dead code elimination, which in the case of your function, it sounds like it decided everything was dead. I think it's impossible to tell Hex-Rays via __usercall that the return location for some function is in a flag location, so under that assumption, Hex-Rays can't help in...
2197
2013-06-07T21:36:26.960
<p>I came across a small function whose only side effects were to modify the state of some processor flags. When I decompiled this function using the Hex Rays decompiler, I simply got an empty function, which is not useful at all in figuring out what the function does. Instead I had to look up each instruction in the a...
Take A Snippet of Assembly and Make All Side Effects Explicit?
|assembly|x86|ida|
<blockquote> <p>Why does the function pointer get overwritten even though is declared before the vulnerable buffer?</p> </blockquote> <p>In the vulnerable code the order of declaration is:</p> <pre><code>void (*functionpointer)(void) = bad; char buffer[50]; </code></pre> <p>The assembly code shows us that the <s...
2209
2013-06-08T16:43:26.337
<p>I am working on <a href="http://io.smashthestack.org:84/" rel="noreferrer">io-wargames</a> for fun right now, level3:</p> <p>I do understand why there is a stack-overflow in this code <code>(strlen(argv[1])</code>), but what I don't understand is why it overflows the function pointer <code>functionpointer</code>. <...
Why does the function pointer get overwritten even though is declared before the vulnerable buffer?
|c|linux|assembly|x86|
<p>GDB protects you to overflow your char array. </p> <pre><code>(gdb) p &amp;buffer $25 = (char (*)[512]) 0x7fffffffdfe0 </code></pre> <p>To bypass this security you can either write directly the memory :</p> <pre><code>(gdb) set 0x7fffffffe1e0=0x41414141 </code></pre> <p>Or cast the array as a bigger one and then...
2215
2013-06-09T01:47:19.077
<p>I'm trying to understand very basic stack-based buffer overflow I'm running Debian wheezy on a x86_64 Macbook Pro.</p> <p>I have the following unsafe program:</p> <pre><code>#include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; CanNeverExecute() { printf("I can never execute\n"); exit(0); } GetInput...
GDB Error "Too many array elements"
|gdb|buffer-overflow|
<p>Control flow flattening is an obfuscation\transformation technique that can be applied to code for almost all languages in order to make it more difficult to understand and reverse engineer.</p> <pre><code>int gSDetETSDG119 = 1010545; while (gSDetETSDG119 != 1010544) { switch (gSDetETSDG119) ...
2221
2013-06-10T13:46:25.980
<p>I recently heard about the &quot;control-flow flattening&quot; obfuscation which seems to be is used to break the structure of the CFG of the binary program (see <a href="https://www.sstic.org/2013/presentation/execution_symbolique_et_CFG_flattening/" rel="nofollow noreferrer">Symbolic Execution and CFG Flattening</...
What is a "control-flow flattening" obfuscation technique?
|obfuscation|
<p>The difference between a debug apk and a release apk is that a debug apk is signed by a particular key which is provided with the SDK, whereas a release apk is signed by some other key. There's nothing to reverse engineer: all you have to do to make a release apk and sign it.</p> <p>Nobody but you can create an apk...
2223
2013-06-10T16:04:42.910
<p>I am making a system in which the users can create Android applications. I want them to give an option to download a <a href="http://developer.android.com/tools/building/building-cmdline.html#DebugMode" rel="noreferrer">debug apk</a> so that they can try it out first. After that, they have to pay for it to get the <...
Can a debug-apk be reverse engineered to make it a release-apk?
|decompilation|unpacking|android|copy-protection|apk|
<p><strong><a href="http://www.openrce.org/downloads/details/171" rel="nofollow noreferrer">Process Stalker</a></strong> is designed to do exactly what you want.</p> <p><img src="https://i.stack.imgur.com/qYf7z.gif" alt="Snippet of Process Stalker&#39;s basic block highlighting"></p> <p>Sample usage: <a href="https:/...
2228
2013-06-11T03:13:30.460
<p>When I execute a program using IDA's debugger interface, I would like to see the basic blocks that were executed highlighted in the IDB. Is there a way to do this?</p>
Highlight Executed Basic Blocks in IDA
|ida|
<p>As Dcoder indicated, an array of <code>short</code> data types begins at the lower address, and the increment of the base of the array by <code>2</code> corresponds to adding <code>1</code> to the index. Consider the following C code:</p> <pre><code>short array[256]; // ... cx = array[variable_1+1]; // ... // .....
2232
2013-06-11T18:24:18.107
<p>I have the following data:</p> <pre><code>.data:004305FC word_4305FC dw 1583h .data:004305FC .data:004305FE word_4305FE dw 35B6h .data:00430600 dw 6835h .data:00430602 dw 6553h .data:00430604 ...
What type of data structure is it?
|disassembly|assembly|ida|struct|
<p>This is my basic understanding of how Windows service works. I have used it with Windows XP and Windows 7. These are general concepts anyways. </p> <p>Any service requires three things to be present: </p> <ol> <li>A Main Entry Point</li> <li>A Service Entry Point</li> <li>A Service Control Handler</li> </ol> <p>Y...
2235
2013-06-11T22:01:06.090
<p>I'm trying to work out the internals of how a Windows process starts and maintains communication with <code>services.exe</code>. This is on Windows 8 x64, but if you have tips for Windows 7 that is fine too.</p> <p>So far I figure out <code>services.exe</code> does something approximately like this:</p> <pre><code...
How does services.exe trigger the start of a service?
|windows|
<p>Often times malware and/or obfuscated code (such as unpacking stubs) will do something such as the following:</p> <ol> <li>Set up an exception handler.</li> <li>Throw an exception.</li> <li>See if the exception handler caught the exception.</li> </ol> <p>If the exception handler didn't catch the exception then the...
2238
2013-06-12T03:12:40.930
<p>I came across some malware that raised an exception while I was single stepping through it. IDA gives me the option to pass the exception to the application or not. What exactly is going on here? When would I not want to pass the exception to the application?</p>
How to handle exceptions in a debugger when reversing malware?
|malware|debuggers|
<p>I was digging a bit into this, and found <a href="https://stackoverflow.com/questions/1515661/gdb-not-hitting-breakpoints">this question</a> on SO by mrduclaw (link in the original article is dead, but <a href="http://web.archive.org/web/20090611150423/http://sourceware.org/gdb/current/onlinedocs/gdb_5.html#SEC29" r...
2241
2013-06-12T16:04:52.383
<p>Long time ago I noticed that using</p> <blockquote> <p>set follow-fork-mode child</p> </blockquote> <p>in GDB on FreeBSD doesn't really work. This problem occurs very often with some challenges on various Capture The Flag contests. For example, a server will spawn a child which would handle the connection. The child...
gdb on FreeBSD and follow-fork-mode child
|gdb|exploit|debugging|multi-process|
<p>In the static context, this is known as "data flow analysis". For example, Hex-Rays incorporates the return-location information for function calls into its representation of the function so as to determine into which other locations that data flows. You don't give a lot of detail on what you want to do with this ...
2242
2013-06-12T17:12:41.647
<p>I wrote a simple IDA plugin that, after a function call, looks for <code>mov MEM_LOCATION eax</code> and adds a name for the memory where the return value is stored. I limit my search to only a few instructions after the function call and bail out if I see another call before the return value is stored. Is there a m...
Tracking What Is Done With a Function's Return Value
|ida|
<p><a href="https://reverseengineering.stackexchange.com/a/2253/2676">DCoder's answer</a> is a good one. To expand somewhat, I most often use DLL injection in the context of forcing an existing process to load a DLL through CreateRemoteThread. From there, the entrypoint of the DLL will be executed by the operating sy...
2252
2013-06-14T15:07:25.390
<p>I was reading a discussion about dumping a processes part of a process's memory and someone suggested using DLL injection to do this. I'll be honest in that I don't really understand. How does DLL injection work and what kinds of reversing tasks can you do with it?</p>
What is DLL Injection and how is it used for reversing?
|dll|dll-injection|
<p>Looking at it in <a href="http://www.ollydbg.de/" rel="noreferrer">OllyDbg</a> it looks like a heavy task. Looks like a custom database with encrypted and (custom?) compressed data. This or the like would usually be the case in such applications. A flat file with structured data is not part of this one.</p> <p>Anyho...
2260
2013-06-15T15:45:41.703
<p>I want to open finnish sports league "data file" used for bookkeeping. It includes all statistics for few decade, so it's interesting data file.</p> <p>The file is here: <a href="http://www.bittilahde.fi/Tietokanta.dat" rel="noreferrer">http://www.bittilahde.fi/Tietokanta.dat</a> (Database.dat in english)</p> <p>T...
Reverse engineering compressed file, where to start?
|file-format|
<p>There are multiple ways that you can use which <em>might</em> work (and see below for the reasons why they might not). Here are two:</p> <ul> <li>A process can debug itself, and then it will receive notifications of DLL loading.</li> <li>A process can host a TLS callback, and then it will receive notifications of ...
2262
2013-06-15T22:58:17.680
<p>In <a href="https://reverseengineering.stackexchange.com/questions/2252/what-is-dll-injection-and-how-is-it-used-for-reversing">this question on DLL injection</a> multiple answers mention that DLL injection can be used to modify games, perhaps for the purposes of writing a bot. It seems desirable to be able to detec...
How can DLL injection be detected?
|dll|dll-injection|
<p>Apart from the compiler, because they dont have remedy for RE security. You can use obfuscation and anti debugger tricks. If you want there are lots of good packer, use them </p>
2266
2013-06-16T13:59:56.810
<p>This is similar in nature to <a href="https://reverseengineering.stackexchange.com/q/118/2044">this question</a> and <a href="https://reverseengineering.stackexchange.com/a/58/2044">this question</a>; I'm interested in what compiler settings to enabled/disable to make a Visual C++ harder to reverse engineer.</p> <p...
Making Visual C++ harder to reverse engineer
|windows|obfuscation|c++|
<p>There are couple of ways that I could think of.</p> <p><strong>First off</strong>, you could use <a href="http://www.cuckoosandbox.org" rel="nofollow"><strong>Cuckoo Sandbox</strong></a>. It is an automated malware analysis system. It is open source and its modules are written in <a href="http://python.org" rel="no...
2274
2013-06-16T20:24:40.950
<p>Can anyone suggest a tool to prevent a malware from deleting itself on Windows x64? The purpose is to collect all the components of the whole process of infection.</p> <p>I've looked at CaptureBat, but its drivers are only 32-bit. I also thought about using file recovery utilities for this.</p>
Prevent malware from deleting itself during installation on Windows x64
|windows|malware|digital-forensics|
<p>Thank you all so much for your answers and comments. While reading your comments and preparing to update my question, I found the answer. </p> <p>I must give credit to <a href="https://reverseengineering.stackexchange.com/users/60/igor-skochinsky">Igor Skochinsky</a>, who asked me to provide functions' prolog instr...
2283
2013-06-19T02:00:31.260
<p>IDA Pro displays certain buffer or padding above (at lower addresses) local variables in stack frame view. For instance:</p> <p><strong>Example 1.</strong><br> The following screen shot of stack frame view shows 12 bytes (included in the red box) buffer: </p> <p><img src="https://i.stack.imgur.com/wB1ok.png" alt=...
IDA Pro function stack frame view
|disassembly|static-analysis|ida|calling-conventions|
<p>if you determined the argv and argc and values in there you gone half of the way . from value of argc you can understand how many arguments you should pass and from values in argv you can determine what you "should" pass.</p> <p>i wrote a very simple example for you</p> <pre><code>70 _main proc near ...
2299
2013-06-20T04:16:38.990
<p>I am working on a console windows executable. So far what I figured out is that the executable checks number of command line arguments. Afterwards, it branches out depending on the number of arguments passed (argv). The jumps are looked up using some sorts of jump table, which is constructed dynamically. It seems to...
How to reverse command line arguments?
|disassembly|binary-analysis|ida|c|c++|
<p>The strategy used by Metasm is referenced in the peer-reviewed literature on their website. Look at <a href="http://metasm.cr0.org/docs/sstic08-metasm-jcv.pdf" rel="nofollow">the article published in the Journal of Computer Virology in 2008</a>, in section 3.1. To quote them, </p> <blockquote> <p>Standard disasse...
2302
2013-06-20T09:06:48.170
<p><a href="http://metasm.cr0.org/" rel="nofollow">Metasm</a> is an assembly manipulation suite written in Ruby. It does provide a quite extensive API for disassembling and extracting a CFG representation from a binary program.</p> <p>I would like to know what algorithm is used to extract the CFG. Is this usual linear...
What algorithm does Metasm use to dissassemble binary code?
|disassembly|
<p>The short answer is "Yes." In fact, if you experiment by generating machine language op codes directly you will discover that there is a whole range of operations that are effectively NOPs, all of which take a single processor cycle to execute.</p> <p>While they are not technically "Documented," you will find that...
2304
2013-06-20T15:47:39.810
<p>I have recently learned that <code>nop</code> instruction is actually <code>xchg eax, eax</code>... what it does is basically exchanges <code>eax</code> with itself. </p> <p>As far as CPU goes, does the exchange actually happen?</p>
NOP instruction
|assembly|x86|
<p>You might be interested in the Dr. Gadget IDAPython script (screenshots <a href="http://www.openrce.org/blog/view/1570/Dr._Gadget_IDAPython_plugin">here</a>, code <a href="https://github.com/patois/DrGadget">here</a>).</p> <blockquote> <p>This little IDAPython plugin helps in writing and analyzing return oriented...
2308
2013-06-21T02:05:30.857
<p>How are <a href="http://cseweb.ucsd.edu/~hovav/talks/blackhat08.html">return-oriented programs</a> decompiled/reverse engineered ?</p> <p>Any pointers to any papers or reports would be appreciated.</p>
Decompiling return-oriented programs
|decompilation|exploit|
<p>Well you have to first Undefine the code using U key and they select the code and right click you will have some options like C (code) and so on. IDA almost give you ability of doing anything wih obfuscated code to help you to understand code correctly.</p> <p><em>Addendum</em> After converting to C (code), do Alt+...
2309
2013-06-21T03:31:25.453
<p>I am working on an obfuscated binary. IDA did pretty good job distinguishing code from junk. However, I had started messing around with a function changing from <code>code</code> to <code>data</code> and vice versa and completely messed the function up and destroyed the way it looked like. I don't want to start new...
How to re-analyse a function in IDA Pro?
|disassembly|ida|
<p>This option has limited value.</p> <hr /> <blockquote> <p>IDA produces executable files only for:</p> <ul> <li>MS DOS .exe</li> <li>MS DOS .com</li> <li>MS DOS .drv</li> <li>MS DOS .sys</li> <li>general binary</li> <li>Intel Hex Object Format</li> <li>MOS Technology Hex Object Format</li> </ul> <p>-- <em>IDA Help fi...
2315
2013-06-24T13:15:36.283
<p>I have come across <code>File -&gt; Create EXE file...</code> option in IDA. I thought one couldn't use IDA for patching. I have tried playing with it. However, it gives me the following error: <strong><code>This type of output files is not supported.</code></strong></p> <p>What is this option for? What is possible...
IDA Pro: What does "Create EXE file..." option do?
|disassembly|ida|patching|
<p>I personally recommend <a href="http://www.ntcore.com/exsuite.php" rel="nofollow noreferrer">CFF Explorer</a> for reversing purposes as it provides a large volume of additional information on a binary.</p> <p><img src="https://i.stack.imgur.com/GkpUa.png" alt="CFF Explorer"></p>
2319
2013-06-25T08:20:30.947
<p>I am using Resource Hacker as a tool to extract out resources like icon, images, etc. from <code>.dll</code> or <code>.exe</code> file. In addition, I am using it to crack some small Windows application. However, it does not work with all Win32 Application, especially with those that are zipped by <code>.exe</code> ...
Freely available resource hacking applications
|tools|windows|dll|executable|pe-resources|
<p>The classic work on the decompilation is Cristina Cifuentes' PhD thesis <a href="http://zyloid.com/recomposer/files/decompilation_thesis.pdf">"Reverse Compilation Techniques"</a>. She describes generation of C code in Chapter 7.</p> <p>The author of the REC decompiler also has a nice summary about the decompilation...
2320
2013-06-25T08:41:28.930
<p>I have been interested in automatic vulnerability assessment and decompilation of code for a while now. And as a result I have been building parsers in Python that reads a bin, disassembles it instruction by instruction while tracing the execution (the way IDA does it).</p> <p>I have been tracing the polluted regis...
How do you optimise AST's or convert them to a real language
|decompilation|decompiler|ast|
<p>What immediately comes to mind is some type of virtualization layer accessing an IAT or IVT. I absolutely agree with the previous answer that this is a call to a function vector in an array of function pointers. I also agree that it does not look like a switch statement. That's what takes me down the interrupt ve...
2326
2013-06-25T15:18:55.567
<p>I have come across the following instructions:</p> <pre><code>mov ecx, [ebp + var_4] imul ecx, 4 call dword_1423d4[ecx] </code></pre> <p>Can someone explain to me what it possibly means or point me in the right direction? Why is the call made to a variable?</p>
Call to variable address
|disassembly|
<p>An alternative answer is that you are looking at hand coded assembly and there is actually no effort to deceive the disassembler.</p> <p>When I hand code assembly, regardless of what good practice is, if it is a small bit of code I will very frequently set the Data Selector to match the Code Selector and simply emb...
2328
2013-06-25T17:01:57.607
<p>I have recently seen the following code obfuscation method: </p> <pre><code>... jump loc_1234 ;------------------------- Bunch of junk ;------------------------- loc_1234: code continued... </code></pre> <p>The logic behind the obfuscation mechanism looks pretty straight forward. Bunch of junk is inserte...
What is this obfuscation method called?
|disassembly|malware|obfuscation|
<p>Developer console.,</p> <p>Once you open your internet go to the settings and to find developer console. What ever is on the page will be provided in the source code. You just have to find it. Some sites block this info from viewers being able to see the things like location, dates, times. But depending on what site...
2331
2013-06-25T18:19:19.183
<p>Some sites like The Free Dictionary, and many other translation and pronunciation services, offers a <a href="http://www.thefreedictionary.com/hacker">little icon next to the word</a> so you could hear its pronunciation.</p> <p>How can I figure out the source for an audio\video embedded file on a webpage? Where do...
How do I get the location of the original audio/video file embedded on a webpage?
|embedded|
<p>CPLDs are frequently used for glue logic. They are quite limited compared to FPGAs and implement a sea of gates design rather than more general LUTS found in FPGAs. Although that probably isn't always the case some CPLDs may be nothing more than a tiny FPGA with a built in ROM. </p> <p>CPLDs usually have a built in...
2338
2013-06-26T11:34:19.687
<p>Sometimes you can find a CPLD (Complex Programmable Logic Device) on a circuit board.</p> <ul> <li>What can you do to find out what it is for?</li> <li>What are the limits and capabilities?</li> <li>What are common applications for a CPLD?</li> </ul>
What can you find out about an unknown CPLD?
|hardware|fpga|
<p>I do not know any real-life opaque predicate. But there is a very constructive predicate obfuscator in the paper <a href="http://rosaec.snu.ac.kr/meet/file/20090204paperc.pdf" rel="nofollow">Limits of Static Analysis for Malware Detection</a>. It is proved to be NP-hard for precise static analysis.</p>
2340
2013-06-26T11:45:31.437
<p>Opaque predicate are used to disrupt automatic analysis of the binary code by reaching the limits of what can do an analyzer.</p> <p>Can somebody give an example (or a few examples) of an opaque predicate found in a real-life case ? And, what are the methods used to build new opaque predicates ?</p>
How to design opaque predicates?
|obfuscation|
<p>I have decided to post my answer not to overthrow Igor's answer, but to have an addition to it. I was not comfortable with editing his post either. I am pretty new to the forum and not sure how it is taken by other members. </p> <p>There is a little theory I have recently learned, which I would like to share. Anywa...
2347
2013-06-26T15:34:43.370
<p>Disassembling binary code is a quite difficult topic, but for now only two (naive) algorithms seems to be broadly used in the tools.</p> <ul> <li><strong>Linear Sweep</strong>: A basic algorithm taking all the section marked as <em>code</em> and disassembling it by reading the instructions one after each other.</li...
What is the algorithm used in Recursive Traversal disassembly?
|disassemblers|
<p>Old question, but as of IDA 6.5, there is a new menu option <code>Edit/Export data...</code> that handles this situation for you. First select the data you wish to export then, via the menu option, choose the output format and file name in which to save the data.</p>
2351
2013-06-27T03:23:36.630
<p>While disassembling a malware binary, I came across several arrays of shorts. The size of each array is 1024 members. I would like to export them to C style arrays, as:</p> <pre><code>short array1[1024] = { 2, 5, 8, ... , 4}; /* This is just an example */ </code></pre> <p>I could definitely do <em>Copy/Paste</em>...
IDA Pro: How to export data to C style array?
|disassembly|ida|ida-plugin|
<p>Cubesuite+ can disassemble hex files.</p> <p>1) Download and install <a href="http://www.renesas.com/products/tools/ide/ide_cubesuite_plus/index.jsp" rel="nofollow noreferrer">Cubesuite+ from Renesas</a>. V2.0.0 was used in this instance.</p> <p>2) Start Cubesuite+</p> <p>3) Go to Project -> Create New Project</p...
2354
2013-06-27T06:33:15.577
<p>Another slightly esoteric microcontroller in a product I'm looking at - the NEC 78K0R microcontroller. This is a 16-bit extension of the 78K0. The 78K0 can be disassembled in IDA Pro, but not the 78K0R.</p> <p>Renesas Cubesuite allows viewing of disassembly of code compiled/assembled through it, as does IAR Workben...
Are there any free disassemblers for the NEC 78K0R family of processors?
|tools|disassembly|nec-78k0r|
<p>You can attach to the process <code>non invasive</code> and use !<code>chkimg !chkallimg !chksym</code> commands.</p> <p>Look for <code>non invasive check box</code> in the attach to process dialog in <code>windbg</code> or use <code>.attach -v "pid"</code></p> <p>Attaching in a non invasive way minimizes debugger...
2355
2013-06-27T15:16:48.137
<p>A common anti-debugging practice is to overwrite functions such as DbgUiRemoteBreakin within ntdll.dll. </p> <p>Since in-memory representation of common libraries is always the same on each platform, it should be possible for an external tool to connect to a process and compare in-memory library code with a referen...
Tool for checking for in-memory code modifications of loaded DLLs
|tools|windows|dll|
<p>Section names don't mean anything to the PE loader and you can set them manually or change them using hex editors. So the only real way of knowing the section's real properties is by checking <code>IMAGE_SECTION_HEADER</code>'s <code>Characteristics</code> field. Use a PE dumping utility like dumpbin and check to se...
2359
2013-06-27T20:05:38.347
<p>I have a file that among other sections has:</p> <ul> <li><code>code</code></li> <li><code>.text</code></li> <li><code>.bss</code></li> </ul> <p>And this file was not crafted manually, so I suspect. </p> <p>The question is what could be the meaning of <code>code</code> and <code>.text</code> sections? As far as I...
Question regarding sections in PE image
|pe|
<p>I haven't done a lot with NFC, but I recommend starting the same way I did. Start at the hardware level and then work up. </p> <p>Hardware: + BladeRF (I think it works with NFV)</p> <ul> <li>Misc Extra tags (get different ones from different vendors)</li> </ul> <p>Software: + nfcinteractor (android)</p> <p>A...
2372
2013-06-28T10:04:32.957
<p>I recently stumbled on a <a href="http://www.reddit.com/r/ReverseEngineering/comments/1ep2ur/reverse_engineering_a_mass_transit_ticketing/" rel="nofollow">talk</a> from Ruxcon 2012 explaining the reverse of a mass transit ticketing system. </p> <p>Basically, they focused on paper tickets reverse engineering with a ...
How to set-up a lab for reversing a mass transit ticketing system?
|hardware|smartcards|
<p>The first law is, "Don't reverse what you don't own". When you pirate software, and then reverse it you do something that will bite you in the ass. </p> <h2>United States</h2> <p>In the United States even if an artifact or process is protected by trade secrets, reverse-engineering the artifact or process is often ...
2373
2013-06-28T10:18:03.607
<p>Following the question about "<a href="https://reverseengineering.stackexchange.com/questions/2372/how-to-set-up-a-lab-for-reversing-a-mass-transit-ticketing-system">How to set-up a lab for reversing a mass transit ticketing system?</a>", I would like to know what are the legal issues about setting up such a lab.</p...
What are the legal issues when trying to reverse a mass transit ticketing system?
|law|
<p>I am using IDA for about 10 years and I have been using Hopper for a few months (on Kubuntu and Windows).</p> <p>It depends what you want to do, what budget you have and whether it's hobby or professional.</p> <p>Clearly, IDA is more powerful in most aspects. It supports a wider ranger of processors, has more load...
2378
2013-06-28T23:19:52.047
<p><a href="http://www.hopperapp.com/" rel="noreferrer">Hopper</a> seems to be focused on Mac, but how does its capabilities on Windows or Linux compares with the free version of IDA for reversing x86/x64 executables? </p> <p><a href="http://www.hopperapp.com/" rel="noreferrer">Hopper</a> seems to have all the major ...
How is Hopper on Windows or Linux?
|tools|
<p>I'm not sure that this is the right place -- StackOverflow would have been a fine place to ask -- but I'll answer anyway. Essentially the issue is that <code>%x</code> treats the argument as an unsigned int. So the value <code>f8ba38ae</code> is the two's complement representation of the original signed int.</p> <p...
2379
2013-06-29T01:55:39.363
<p>Sorry if this is the wrong place to ask this but I'm stumped. I'm looking at iOS code as follows. </p> <pre><code>- (NSString *)currentE6Location { CLLocationCoordinate2D loc = [AppDelegate instance].mapView.centerCoordinate; return [NSString stringWithFormat:@"%08x,%08x", (int)(loc.latitude*1E6), (int)(loc...
Converting hex value to lat/long
|hex|
<p>"Hacker Protection Factor" is a geeky play of words on "Sun Protection Factor" -- how much longer can an application be attacked before being damaged. The numbers are based on empirical evidence ("<em>Based on our experience,...</em>"). I thought it was cute; it is not an industry standard, but it does serve as a si...
2384
2013-06-30T20:50:12.677
<p><a href="http://www.saikoa.com/dexguard" rel="noreferrer">Dexguard</a> claims a "hacker protection factor" of 35 without any explanation of where the number comes from or what it means. I figure the actual statement is meaningless, but I'm very curious to see who is assessing these protection factors. </p> <p>A Goo...
Origin of "Hacker Protection Factor"
|obfuscation|
<p>for vc++ name demangling you can use </p> <p><a href="http://ishiboo.com/~danny/Projects/vc++filt/" rel="nofollow">vc++filt</a></p> <p>it is a small wrapper over dbghelp Function UnDecorateSymbolname() that takes the mangled string and prints out demangled names back to the console see below for a snippet</p> <pr...
2388
2013-07-01T15:03:23.287
<p>When reversing binaries and parsing memory, I often run across strings like <code>"@YAXPAX@"</code> used to reference procedures. Is there a name for this type of convention?</p> <p>I believe theses strings are symbol references.</p>
Artifacts similar to "@YAXPAX@" within memory and IDA sessions
|disassembly|ida|
<p>Any obfuscation technique (or its formalization) targets one or more assumptions made by some class of analyses A -- in essence, the obfuscation transforms a program P0 into a different representation P1 that has the same execution behavior as P0 but which violates the assumptions made by the analyses A. In doing s...
2391
2013-07-01T23:35:25.503
<p>My question is related to <a href="https://reverseengineering.stackexchange.com/questions/1669/what-is-an-opaque-predicate">this question</a> with the excellent answer of @Rolf Rolles. Since <a href="http://profs.sci.univr.it/~dallapre/AMAST06.pdf" rel="nofollow noreferrer">the paper of M.D. Preda et al</a> is quite...
Formal obfuscation
|obfuscation|deobfuscation|
<p>You can do it using Sark (<a href="https://github.com/tmr232/Sark" rel="nofollow">code</a>, <a href="http://sark.readthedocs.org/en/latest/index.html" rel="nofollow">docs</a>):</p> <pre><code>import sark # Get the segment segment = sark.Segment(ea=0x00400000) # Set the permissions segment.permissions.write = True...
2394
2013-07-02T05:53:22.130
<p>Sometimes when you load a binary manually in IDA you wind up with segments that have unknown read write and execute flags. You can see them under the Segments subview (<kbd>Shift</kbd> + <kbd>F7</kbd>). Is there a way to change these flags from within the GUI of IDA without running a script and modifying them? </p> ...
How can I change the Read/Write/Execute flags on a segment in IDA?
|ida|segmentation|
<p>Also, while permissions are more or less standardized and can inform you about the types of data/code found in a segment, remember that if you're talking about malware analysis there is no guarantee that the permissions on a segment are what you would expect.</p> <p>Not to mention that there is often a fair amount ...
2400
2013-07-02T15:53:33.987
<p>As per <a href="https://www.hex-rays.com/products/ida/support/idadoc/517.shtml" rel="nofollow">IDA Online Help</a>:</p> <blockquote> <p>The segment class name identifies the segment with a class name (such as CODE, FAR_DATA, or STACK). The linker places segments with the same class name into a contiguous area of ...
IDA: Segment Class Name
|disassembly|ida|
<p>File-->Produce file-->Create C header file</p> <p>This will export all defined structures and enums. Please note that in all IDA versions before IDA 6.5 you'll possibly need to reorder structures if you want to use created file for compilation of your own source.</p>
2408
2013-07-03T21:36:35.133
<p>It is possible to import structures and enums declarations from C files in IDA. However, is it possible to export structures and enums to C?</p>
Exporting structures and enums in IDA
|ida|
<p>For IDA v7.0 you can use: </p> <pre><code>ida_idp.is_align_insn(ScreenEA()) </code></pre>
2415
2013-07-05T18:05:47.107
<p>Some compilers will add useless bytes in functions or in between functions. In the below block of code at 0040117C we can see the "align" keyword that was inserted by IDA. </p> <pre><code>.text:00401176 mov eax, [edx+4] .text:00401179 call eax .text:0040117B .text:0040117B l...
Accessing Data Marked as Alignment Bytes in IDA
|ida|compilers|idapython|
<p>compiler may insert dumb null_sub randomly between directions, in order to confuse IDA decompiler. So that IDA may generate meaningless variable names, increase reverse engineer's effort to understand the workflow, to connect to dots...</p>
2420
2013-07-06T10:24:56.467
<p>In nearly every dis-assembly created by IDA, there are several functions that are marked <code>nullsub_</code> which according to IDA, return <del><code>null</code></del> nothing (just <code>ret</code> instruction). </p> <p>So, what are those and why are they in the database?</p>
What are nullsub_ functions in IDA?
|disassembly|ida|
<p>There is also <a href="http://www.openrce.org/downloads/" rel="nofollow">http://www.openrce.org/downloads/</a> Though it does not have specific tools you are looking for, it has lots of plugins for IDA and OllyDbg. It is trustworthy source as well.</p>
2427
2013-07-07T20:39:05.067
<p>I am looking for a reliable source to download RE tools such as:</p> <ol> <li>Lordpe</li> <li>Imprec</li> <li>Peid</li> </ol> <p>but it seems all the links in google are not safe, where can I buy or download it from a reliable not malwared source. Can I trust <a href="http://www.woodmann.com/">http://www.woodmann....
Where can I get reliable tools for RE?
|tools|
<p>Yes, the riddle was solved. See <a href="http://www.home.aone.net.au/~byzantium/found/found4.html" rel="noreferrer">http://www.home.aone.net.au/~byzantium/found/found4.html</a></p> <p>As for +ORC himself, there's some more info at <a href="http://www.woodmann.com/crackz/Orc.htm" rel="noreferrer">http://www.woodmann...
2428
2013-07-07T21:07:13.747
<p>I have heard countless stories on the Old Red Cracker, also known as +ORC, being the founding father of reverse engineering tutorials.</p> <p>I also read somewhere that he left some riddles to find his "secret page" and he disappeared into thin air.</p> <p>Did anyone <em>really</em> solve these riddles? Is the ide...
Who was the Old Red Cracker?
|history|
<p><a href="https://reverseengineering.stackexchange.com/users/262/dcoder">@DCoder</a> has certainly answered this, so here is only some notes, or, at least it started out as a short note, and ended up as a <strong>monster</strong>.</p> <hr> <p>OllyDbg uses <code>MASM</code> by default (with some extension). In other...
2432
2013-07-08T16:15:23.567
<p>This is probably a pretty simple question as I'm not too used to how the syntax looks for OllyDBG's disassembler. </p> <p>Does this following assembler statement:</p> <pre><code>MOV EAX, DWORD PTR [ESI + 14] </code></pre> <p>Be roughly translated to this C code:</p> <pre><code>eax = *(esi + 0x14); </code></pre> ...
OllyDBG's disassembled syntax and c-equivalent
|disassembly|assembly|x86|ollydbg|
<p><strong>Ida Free 5</strong></p> <pre><code>Edit -&gt; Segments -&gt;CreateSegment </code></pre> <p>in the dialog</p> <pre><code>segment name = seg001....seg00n start = &lt;start address viz 0x0A end = &lt;end address viz 0x1e base = 0x0 class = some text viz 32one,32two,16thre...
2440
2013-07-09T20:36:51.017
<p>I am trying to reverse engineer a binary blob I expect to transition from 16-bit real mode into 32-bit protected mode (it is boot time code), so I expect the code to contain code of both sorts.</p> <p>When I launch IDA, I am given the option of 16 or 32-bit code, but not mixed.</p> <p>How do I instruct IDA to atte...
Mixed 16/32-bit code reversing using IDA
|ida|x86|
<pre><code>ollydbg radasm.exe view windows (W Icon) sort class and look for Mdi class like mdiEditChild / dialog etc </code></pre> <p>example</p> <pre><code>Windows, item 96 Handle=000704EE Title=C:\testrad\Html\Projects\testrad\testradinc3.html Parent=000203E4 ID=0000FDEA (65002.) Style=56CF0001 WS_CHILD|WS_GRO...
2460
2013-07-13T20:45:04.423
<p>I am trying to modify RadASM so that Ctrl+W will close the tab, instead of Ctrl+F4, and also make it so that if you middle mouse click the tab, it will close. The context menu for a tab is just a copy of the "Windows" menu bar item. The problem is, I can not figure out which library or even function is used to creat...
Change RadASM hotkey and add middle mouse click hotkey
|assembly|ollydbg|
<p>You can try Netzob tool. This is a tool dedicated to reverse engineering protocols.</p> <ul> <li>You can download it here : <a href="http://www.netzob.org/">http://www.netzob.org/</a></li> <li>A great example w/ ZeroAccess C&amp;C protocol : <a href="http://www.netzob.org/documentations/presentations/netzob_29C3_20...
2474
2013-07-14T22:31:51.387
<p>I have a DVR that sends video over Ethernet using its own propriety TCP protocol. I want to write a VLC module to view the video, rather than the supplied DxClient.exe. I have captured traffic in wireshark and attempted to reverse engineer the client with IDA Pro, from what I can tell the client does some kind of ha...
Reversing network protocol
|file-format|sniffing|wireshark|
<p>If you goal is ultimately to control the service, it make more sense to reverse it versus reversing control panel. Who knows, you might find functionality you were not aware of. The key part of reversing windows service is to realize that it runs within the context of the <a href="http://msdn.microsoft.com/en-us/lib...
2475
2013-07-14T22:55:17.453
<p>I'm trying to reverse engineer a driver that consists of 2 components, a windows service and a control panel application. My goal of reverse engineering is to replace the control panel with my own program.</p> <p>Now as far as I can see I have a few possible approaches:</p> <ol> <li>I try to reverse engineer the c...
Reverse engineering windows service
|windows|ida|ollydbg|
<p>this is not entirely true. Dalvik bytecode will also be verified on the device, but this happens during installation time, not runtime. A verified and optimized version of the dex file will be stored on the system, protected by file system permission (you cannot change it afterwards unless you have rooted your devic...
2479
2013-07-15T05:26:23.847
<p>One of the things that makes Java bytecode (.class) so easy to reverse engineer is that the JVM's verifier ensures that bytecode can always be disassembled via linear sweep. Instructions have to be consecutive starting at offset 0, and you can't jump into the middle of an instruction.</p> <p>However <a href="http:/...
Android bytecode verifier
|disassembly|android|byte-code|
<p>IDA Pro offers two tracing options:</p> <ol> <li><strong>Instruction tracing</strong> <kbd>Debugger->Tracing->Instruction Tracing</kbd> It is very slow tracing process, since IDA monitors registers and has to record the address, the instruction, and changes values of registers, that were changed by the instruction....
2486
2013-07-15T22:50:55.317
<p>I have been looking for the equivalent of the "Run Trace" option of OllyDbg in IDA Pro. Can anyone mention if there is one and how to use it ?</p>
Is there an equivalent of 'Run trace' as in OllyDbg for IDA PRO?
|ida|ollydbg|ida-plugin|
<p>I'm not sure whether this is along the lines you're looking for (and quite possibly you've already figured out all of this and more), but here's a crude formalization and then some implementation thoughts. Conceptually, this tries to separate what it <em>means</em> to entangle several values from how entangled valu...
2489
2013-07-16T11:50:18.653
<p>I don't know the exact name of this obfuscation, so I call it <strong>variable entanglement</strong> for now.</p> <p>I already saw this principle in a few binaries but I never found a complete description of what was possible and what was not.</p> <p>The idea is to confuse the reverser by mixing two values togethe...
Where and how is variable entanglement obfuscation used?
|obfuscation|whitebox-crypto|
<p>While in the Text View of the disassembly window, press <kbd>Alt + T</kbd>. In the Text Search window, search for <code>shl</code> and check <code>Find all occurrences</code>:</p> <p><img src="https://i.stack.imgur.com/OR0Mt.png" alt="Text Search window"></p> <p>Press <code>OK</code> and you will get a list of all...
2493
2013-07-17T04:51:41.077
<p>I have a DLL with a large number of functions in IDA Pro. I would like to make a script that can scan the instructions within each of the functions looking for a specific instruction. For my specific case right now, I am looking for functions that shift left (shl). I am not sure which register is being shifted so I ...
IDA Pro List of Functions with Instruction
|ida|idapython|
<p>I also just started to learn more about this topic and managed to write down the following lines of code.</p> <p>I guess all my comments in the code are good enough as answer. I dont know much more then that anyway.</p> <pre><code> ' #!/usr/bin/env python import immlib import struct from immlib import STDC...
2502
2013-07-20T03:23:53.260
<p>I am a newbie in python programming for Debugging . I wrote a code for using the function FastLogHook() in immlib but i am not able to figure out the exact problem with my code as it is not working :(</p> <p><b> Here is My code </b></p> <pre><code>#!/usr/bin/env python import immlib from immlib import FastLogHook...
Use of FastLogHook function in immlib?
|python|immunity-debugger|
<p>ollydbg 2.0 supports AT&amp;T syntax also</p> <pre><code>CPU Disasm Address Command Comments 01002C0C CMPL %ESI, %DS:notepad.fUntitled ; Case 3 of switch notepad.1002BBE 01002C12 MOVL %DS:notepad.g_ftOpenedAs, %EAX 01002C17 MOVL %EAX, %DS:notepad.g_ftSaveAs 01002C...
2505
2013-07-20T14:30:52.657
<p>So I understand that there are many assemblers such as MASM, FASM, NASM, etc.</p> <p>But which version is the disassembler in OllyDbg and Cheat Engine?</p>
Which version of assembly does OllyDbg disassemble binary to?
|disassembly|assembly|disassemblers|
<p>I will assume you are talking about Windows Sockets and IPv4, since you have not mentioned otherwise. <code>sockaddr</code> is very well described in <a href="https://i.stack.imgur.com/8cNC8.png" rel="noreferrer">MSDN</a>. It is defined as for IPv4 as follows:</p> <pre><code>struct sockaddr { ushort sa_fam...
2507
2013-07-20T17:54:16.717
<p>How do I get IP address and port number out of bind function in Server application. Can it be achieved with hooks like bphook in immunity debugger?</p> <p>My problem is that I don't know how to unpack struct psockaddr/sockaddr or how sockaddr is saved on the stack.</p>
Server-side bind() function, immlib
|python|immunity-debugger|
<p>To add to @jvoisin's answer, you can have a look at <a href="https://github.com/kholia/checksec" rel="nofollow">checksec</a> - python implementation of checksec.sh</p> <p>Both these scripts are simple (compared to mona.py) and should help you get started. </p>
2510
2013-07-20T23:31:00.197
<p>How to check if DEP, ASLR and SafeSEH defense mechanism are enabled or not in a program using <code>immlib</code> library of Python in Immunity Debugger ? </p> <p>Actually I am looking for small code snippet for each.</p>
Check DEP , ASLR and SafeSEH enabled or not , immlib
|debuggers|python|immunity-debugger|seh|
<p>There were a lot of saying in replays, but I'd like to stress on some answers from the practical point of view:</p> <ul> <li><strong>network connection</strong> - a while ago I would agree that simply disconnecting the vm from the network will solve the problem of spreading through the network. Today, there are mor...
2513
2013-07-22T00:48:28.517
<p>Once I perform static analysis on a malware sample, I next run it in a virtual machine.</p> <ul> <li>Does this give the malware a chance to spread to the real machine?</li> <li>Does this give the malware a chance to spread across networks?</li> <li>What steps/tips can I follow to prevent the malware from spreading ...
Malware in virtual machines
|malware|virtual-machines|
<p>Your choice of decompiler can greatly affect the outcome. You should try either JODE, or Fernflower (which I believe goes by Androchef).</p> <p>Before decompiling, it might be a good idea to do some simple deobfuscation yourself. For example, you could try</p> <ul> <li><p>Remapping of Java keywords that have been ...
2521
2013-07-22T21:20:59.370
<p>I compiled some [relatively complex] Java code into a .class file, then used jad to decompile it back into java. Of course, the code was obfuscated, which was to be expected. However, given that I had the original code, I thought I'd be able to look through the decompiled code fairly easily. However, I noticed diffe...
Why are there (sometimes major) differences between java source code and its decompiled result?
|decompilation|java|
<p>The answer lays within the comments, read Binary Diffing by Nicolas A. Economou (CoreImpact) 2009 to see why.</p> <p>Good Binary Diffing is in fact a way harder subject that does a lot more than compare bytes or bits. </p> <p>Making a Binary Diff with objdump and meld is really not the way to go. Read the CoreImpa...
2529
2013-07-23T14:13:21.980
<p>Does any of you know of a recent tool to bindiff using ImmunityDebugger? I know about BinDiff by Zynamics and PatchDiff for IDA. But I really want a tool like this in ImmDBG. I also know about Radare's bindiffer and the feature in <code>mona.py</code> (but this is more with memory regions).</p> <p>Now I use a HexEd...
Reversing Patches (Binary Diffing)
|immunity-debugger|patch-reversing|bin-diffing|
<p>It's an undocumented non-exported function. Hex-Rays output is:</p> <pre><code>RPC_STATUS __stdcall BindW(RPC_WSTR *StringBinding, RPC_BINDING_HANDLE *Binding) { RPC_STATUS result; // eax@1 result = RpcStringBindingComposeW(0, L"ncalrpc", 0, L"protected_storage", 0, StringBinding); if ( !result ) result ...
2538
2013-07-26T16:39:41.280
<p>I am looking at a windows library in IDA pro and I came across a function call <pre><code>BindW(ushort **, void **)</code></pre></p> <p>IDA pro adds the comments <em>Binding</em> and <em>StringBinding</em> respectively to the parameters when they are pushed.</p> <p>What is this function?</p>
What is *BindW*?
|windows|
<p>To answer to this question, we have first to rephrase it a bit. The real question can be stated like this: </p> <blockquote> <p><em>What are the symbols that cannot be removed from an ELF binary file ?</em></p> </blockquote> <p>Indeed, <code>strip</code> removes quite a bit of information from the ELF file, but ...
2539
2013-07-26T17:24:18.553
<p>I am currently looking at the ELF format, and especially at stripped ELF executable program files.</p> <p>I know that, when stripped, the symbol table is removed, but some information are always needed to link against dynamic libraries. So, I guess that there are other symbols that are kept whatever the executable ...
What symbol tables stay after a strip In ELF format?
|elf|dynamic-linking|
<p>Here is something directly from Microsoft.</p> <p><a href="https://github.com/Microsoft/microsoft-pdb">https://github.com/Microsoft/microsoft-pdb</a></p>
2548
2013-07-28T00:05:01.357
<p>Where I can find such information? I've already read the undocumented windows 2000 secrets explanation of it but it isn't complete. For example the 3rd stream format isn't explained. I have looked at <a href="https://code.google.com/p/pdbparser/" rel="nofollow">this</a>, where some general info about the streams is ...
PDB v2.0 File Format documentation
|file-format|pdb|
<p>To Unpack a file you must have quite a lot of experience in reversing binaries..</p> <p>Remember there exists no universal method that works for all the packers.</p> <p>These steps will work in unpacking 97% of binaries;</p> <ol> <li>You must be aware of the code that usually lies at the start of entry point in b...
2552
2013-07-28T17:27:08.943
<p>As I am just getting started in RE, I've mostly faced files packed with a single-layer of packing , such as UPX, ASPack, etc.</p> <p>Unpacking these protections is fully documented online. The problem begins when I deal with <strong>multiple layers of packing</strong>, especially concerning malware. I have followed...
How to unpack files packed with multiple packers?
|malware|unpacking|
<p>The output from the file utility, as you've probably guessed, is a false positive. The beginning of the firmware.bin file contains what looks to be a basic header (note the "SIG" string near the beginning of the file), and a bunch of MIPS executable code, which is likely the bootloader:</p> <pre><code>DECIMAL ...
2557
2013-07-29T16:48:39.017
<p>I'm trying to unpack this firmware image but I'm getting some issues understanding the structure.</p> <p>First of all I have one image which I called firmware.bin, and the file command shows me that it's a LIF file:</p> <pre><code>firmware.bin: lif file </code></pre> <p>After that I analyze it with binwalk:</p> ...
Unpack Billion 5102 firmware
|firmware|unpacking|mips|
<p>I still wonder should I add a comment on this because my knowledge on the cryptography is extremely limited. The paper on the jigsaw obfuscation uses a term named <em>functional encryption</em>, that means with the private key in hand the obfuscator can design some functions working on the encrypted data. And someon...
2586
2013-08-05T08:51:07.677
<p>You must have heard about it, it all over the on-line newspapers. Some researchers from UCLA claims to have achieved a <a href="http://newsroom.ucla.edu/portal/ucla/ucla-computer-scientists-develop-247527.aspx">breakthrough in software obfuscation</a> through 'mathematical jigsaw puzzles'. </p> <p>Their <a href="ht...
What is this 'mathematical jigsaw puzzles' obfuscation?
|obfuscation|cryptography|whitebox-crypto|
<p>Expanding on my comment:</p> <p>The Freeware IDA Pro doesn't support MIPS, so you won't be able to use it. If you can't use the paid versions of IDA, there are <a href="https://reverseengineering.stackexchange.com/questions/1817/is-there-any-disassembler-second-to-ida">free alternatives</a>.</p> <p>As an example, ...
2587
2013-08-05T09:58:08.400
<p>I'm trying to load a CGI file to IDA in order to disassemble it and understand it's behaviour but I can't do it.</p> <p>According to the strings command I can see some interesting words like system, sprintf, etc. And I know it's a MIPS file, But I'm not able to get something comprehensible in IDA.</p> <p>Could any...
How to reverse CGI file for MIPS?
|ida|firmware|radare2|mips|
<p>Jump two bytes forward from current position when zero flag == NULL Opcode for this <code>74 00</code> which is two bytes </p> <pre><code>seg000:00000000 74 00 jz short $+2 seg000:00000002 74 00 jz short $+2 </code></pre> <p>so effectively it will jump to next instr...
2590
2013-08-05T15:17:50.767
<p>What does the dollar symbol mean in</p> <pre><code>jz $+2 </code></pre> <p>(This is IDA output.)</p>
What does `jz $+2` do? (jump if zero to dollar plus two)
|disassembly|ida|assembly|
<p>Slightly modified version from pydasm's <a href="https://code.google.com/p/libdasm/source/browse/trunk/pydasm/README.txt?r=2">README.txt</a></p> <pre><code>import pydasm import binascii # Open, and read 200 bytes out of the file, # while converting buffer to hex string with open('file.bin','r') as f: buffer = ...
2596
2013-08-06T21:05:43.440
<p>How to disassemble first 200 bytes of an executable code using <a href="https://code.google.com/p/libdasm/" rel="nofollow">pydasm library</a> in Python? I want to know how to set size of buffer to disassemble it.</p>
Pydasm: Disassembling limited length executable shellcode
|disassembly|python|disassemblers|shellcode|
<p>if you are using <code>IDA FREE</code> then this and several other type libraries are not available </p> <p>and if you intend to </p> <pre><code>create them yourself and export them somehow (would have to figure out how). </code></pre> <p>this walk through provides few hints on how to accomplish it</p> <p>os wi...
2610
2013-08-10T00:42:12.860
<p>When reversing shellcode, we see the PEB walk fairly often at various stages. I am curious however, if there is any pre-defined standard structure for this in IDA? If so, what is it called? After looking and googling around I haven't been able to find anything. I would also be very interested in definitions for PEB_...
Structure Definitions for PEB in IDA
|ida|shellcode|
<p>there are 2 loops in the code:</p> <blockquote> <p>0x40109d mov $0x2,%ecx<br> <strong><em>0x4010a2</em></strong> mov %ecx,%esi<br> 0x4010a4 mov $0x3,%ecx<br> <strong>0x4010a9</strong> mov $0x2,%ebx<br> ...<br> first loop<br> ...<br> 0x4010c4 <strong>loop 0...
2620
2013-08-11T20:43:36.953
<p>I am having trouble understanding how this code knows when to stop looping. I am supposed to figure out what values are put into %edi. But I can't figure out how many times it loops.</p> <pre><code>0x40106e movl $0x2b,0xffffffdc(%ebp) 0x401075 movl $0x31,0xffffffe4(%ebp) 0x40107c movl $0x74,0xf...
Understanding assembly loop
|assembly|
<h2>Initialization of local variables with movabs</h2> <p>Yes this instruction should move absolute hardcoded data embedded into instruction itself into register, or data from absolute address. But I got into this instruction only recently when I wanted to know where constant data for initialization of local variables ...
2627
2013-08-12T16:00:50.820
<p>I just found a strange instruction by assembling (with <code>gas</code>) and disassembling (with <code>objdump</code>) on a <code>amd64</code> architecture.</p> <p>The original <code>amd64</code> assembly code is:</p> <pre><code>mov 0x89abcdef, %al </code></pre> <p>And, after <code>gas</code> compiled it (I am us...
What is the meaning of movabs in gas/x86 AT&T syntax?
|x86|amd64|
<p>You'd be better off using IDC functions like <a href="https://www.hex-rays.com/products/ida/support/idadoc/274.shtml" rel="noreferrer">GetMnem()</a>, <a href="https://www.hex-rays.com/products/ida/support/idadoc/276.shtml" rel="noreferrer">GetOpType()</a>, <a href="https://www.hex-rays.com/products/ida/support/idado...
2632
2013-08-12T21:16:13.600
<p>Does anyone know of projects that parse the disassembly from IDA Pro using a lexer and/or parser generator library? But I would also totally be fine with JSON or XML format. So far, I have been able to produce HTML from the GUI, but I am looking for a command line tool that will parse disassembly files produced by I...
Parsing IDA Pro .asm files
|disassembly|ida|
<p>In fact, they do not claim at all to evade from any virtual machine. But, by using the MMU fault handler mechanism to perform computation, they expect to render the encapsulation of their program unpractical. Indeed, the point is to find unexpected primitives to perform computation, doing so only a few virtual machi...
2640
2013-08-14T14:51:22.127
<p>The <a href="https://github.com/jbangert/trapcc/" rel="noreferrer" title="link">trapcc project</a> on Github by Sergey Bratus and Julian Bangert claims that using the Turing complete capabilities of x86 MMU it is possible for a code to escape the virtual machine using a single instruction (Move, Branch if Zero, Decr...
Virtual Machine escape through page faults
|virtual-machines|
<p>At a <em>very</em> high level...</p> <p>Reverse engineering typically focuses on recovering the functional specifications of code.</p> <p>Digital forensics typically focuses on recovering data.</p>
2652
2013-08-17T14:15:30.363
<p>I am not able to understand exact difference in Digital Forensic and Reverse Engineering. Will Digital Forensic has anything to do with decompilation, assembly code reading or debugging?</p>
What is difference between Digital Forensic and Reverse Engineering
|tools|disassembly|decompilation|debuggers|digital-forensics|
<p>All Hex-Rays macros are defined in <strong>&lt;IDA directory&gt;\plugins\defs.h</strong>. It's also available at <a href="https://github.com/nihilus/hexrays_tools/blob/master/code/defs.h" rel="nofollow noreferrer">https://github.com/nihilus/hexrays_tools/blob/master/code/defs.h</a></p> <p>For <code>BYTE3(x)</code>:...
2657
2013-08-18T10:05:41.350
<p>I've got a program that i'm trying to debug a little bit by trying to make sense of a function or two, there's already some info that i've downloaded via a idb file and it's helped me get somewhere. But i'm kind of stuck on a part where i've got something like this:</p> <pre><code>BYTE3(v1) = 0; </code></pre> <p>T...
BYTE3, does it mean the third or fourth byte of an int? IDB file that's already supplied
|disassembly|ida|c|c++|