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>So, it is totally untested but here is the result of a few Internet browsing.</p> <p>First the stack base address is present in <code>/proc/&lt;pid&gt;/maps</code>, then it must be accessible from user-space at some point.</p> <p>I looked at the code of the <a href="http://www.linuxcommand.org/man_pages/pstack1.ht...
1612
2013-04-05T14:55:52.963
<p>I'm adding a feature to my Linux debugger (I'm using Ptrace to manipulate the traced process as well as libbfd/libopcodes) to unwind the stack and determine if discrepancies exist between each CALL's allocated stack space and a statically derived local variable size, printing the address and local stack size of each...
How can I check I've moved outside the stack without triggering a protection fault?
|debuggers|linux|x86|callstack|segmentation|
<p>When examining the VirtualAddress property of the IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR within the Data Directory of a running process, one may observe the manifestation of native code as .NET. This occurrence is attributed to the dynamic execution of .NET modules during runtime. However, it is imperative to consider...
1614
2013-04-05T17:54:15.087
<p>How can I quickly tell if a EXE or DLL I have is managed code or not?</p> <p>I spent some time recently trying to disassemble a file and then later learned through some traces in the code that I could have skipped all that work and just used ILspy. How can I avoid repeating that experience in the future?</p>
Determining if a file is managed code or not
|windows|tools|dll|pe|
<h1>Sniffing traffic only ... is easy</h1> <p>If you merely wanted to sniff the traffic you could <a href="http://wiki.wireshark.org/Protocols/tds" rel="nofollow noreferrer">use the TDS protocol sniffer</a> that comes with <a href="http://www.wireshark.org/" rel="nofollow noreferrer">WireShark</a>.</p> <h1>Let the la...
1617
2013-04-05T19:45:11.907
<p>I'm researching into intercepting queries that arrive at the SQL Server 2008 process.</p> <p>SQLOS architecture is divided in the following system DLLs:</p> <ul> <li><strong>sqlmin.dll</strong>: Storage, replication, security features,etc.</li> <li><strong>sqllang.dll</strong>: TransactSQL query execution engine, ...
Server-side Query interception with MS SQL Server
|windows|dll|mssql|
<p>Another option that's pointed out in the comments above by @CallMeV is to use hooking. On Windows you may look at using <a href="http://easyhook.codeplex.com/" rel="nofollow">EasyHook</a>.</p>
1628
2013-04-06T13:45:41.450
<p>Always wondered how it would be possible to see what data is being transmitted back and forth with an application that calls home.</p> <p>Let's say we emulate the server via host file redirect. Would it be possible to see what requests are being made by the application?</p> <p>Also is it possible at all to interce...
How to see what data is being transmitted when an application calls home?
|tools|windows|security|php|serial-communication|
<p>Hi,the most important reason is: debugging / reversing is quite abstruse and difficult, when you see a full screen assembly codes, and then suddently, they carsh/ fatals / freeze ... You just have no any idea to go on. So you have to search the answer in Internet, but most informations are all about Ollydbg 1.1, and...
1636
2013-04-06T15:18:09.063
<p>I see that most RE tutorials around the web that give RE examples use OllyDbg 1, even if the tutorial was written after the release of OllyDbg 2.</p> <p>Is there any particular reason for that? Is version 2 too buggy, or were some of the features dropped?</p>
Advantages of OllyDbg 1 over OllyDbg 2
|ollydbg|
<p>Yes, they work as @broadway already pointed out. However, PIN under OSX have many-many restrictions, some of them documented and others not. The most noticeable feature it lacks is support for creating threads in a PIN tool.</p>
1641
2013-04-06T23:38:55.913
<p>I see that PinTool works for Windows and Linux. Does it also happen to work for OSX? Or is there a similar tool that I can use to easily record code coverage for a closed-source app?</p>
Pintool For OSX
|dynamic-analysis|osx|
<p>As suggested by DCoder, I use the following helper class to efficiently resolve addresses to basic blocks:</p> <pre><code># Wrapper to operate on sorted basic blocks. class BBWrapper(object): def __init__(self, ea, bb): self.ea_ = ea self.bb_ = bb def get_bb(self): return self.bb_ def __lt__(sel...
1646
2013-04-07T12:24:01.923
<p>Say I have an arbitrary address and I want to find out which basic block (i.e. area_t structure) corresponds to it. How would I do that?</p> <p>Edit: more specifically, I want to know the beginning / end of the basic block to which a given address belongs.</p>
How to map an arbitrary address to its corresponding basic block in IDA?
|idapython|ida|
<p>BAP is mostly a rewrite of BitBlaze, so feature-wise there are many common features. However, many of these have been re-written or re-designed for BAP.</p> <p><strong>Common features:</strong></p> <ul> <li>Lifting of usermode, x86 instructions</li> <li>Datafow analysis module</li> <li>Dominator analysis</li> <li...
1653
2013-04-08T12:03:57.463
<p><a href="http://bitblaze.cs.berkeley.edu/">BitBlaze</a> and <a href="http://bap.ece.cmu.edu/">BAP</a> are two platforms to perform binary analysis. And, if I understand well, they are sharing lots of common features. What are their respective main features and in what do they differ from each other ?</p>
What are the differences between BitBlaze and BAP?
|tools|static-analysis|dynamic-analysis|binary-analysis|
<p>As others have said, this is for getting current instruction's address. But it's not recommended as it'll hurt performance because it won't return anywhere, causing disagreement of return addresses in data stack and in the CPU's internal calling stack</p> <p>The recommended way is</p> <pre><code>GetCurrentAddress: ...
1654
2013-04-08T12:42:47.817
<p>While reversing a 32bit Mach-O binary with Hopper, I noticed this peculiar method. The instruction on 0x0000e506 seems to be calling an address right below the instruction.</p> <p>What would be the reason for this? Is it some kind of register cleaning trickery?</p> <p><a href="https://i.stack.imgur.com/OBxX3.png" re...
Why would a program contain a call instruction targetting the address immediately following that instruction?
|assembly|x86|
<p>The answers already in this thread are good ones. In a nutshell, an opaque predicate is "something that a program analysis might miss, if the program analysis is not sophisticated enough". Denis' example was based on the inverse of constant propagation, and served as an anti-checksum mechanism. Joxean's <code>Set...
1669
2013-04-09T07:48:31.540
<p>I saw the term of <em>opaque predicates</em> several times in obfuscation papers. As far as I understand it, it refers to predicates that are hard to evaluate in an automated manner. Placing it at strategical points of the program (<code>jmp</code>, <code>test</code>, ...) can mislead the analysis of a program by au...
What is an "opaque predicate"?
|obfuscation|
<p>Samurai's answer is correct , but put more clearly , your mistake is that you enter the literal string </p> <pre><code>123456789abc\x7c\x84\x04\x08 </code></pre> <p>where as what you probably want is something like:</p> <pre><code>perl -e 'print "123456789abc\x7c\x84\x04\x08"' | ./yourbinary </code></pre> <p>In ...
1672
2013-04-09T08:21:37.047
<p>I was trying to understand buffer overflow attacks using the following C program </p> <pre><code>#include"stdio.h" #include"string.h" void iwontprint() { printf("i wont be printed!"); } void callme() { char buffer[8]; gets(buffer); puts(buffer); } int main(int argc,int** a...
Why is this string on the stack not exactly the one I entered?
|disassembly|gdb|buffer-overflow|
<p>This is also commonly known as an <strong>encryption wrapper</strong>. I'm sure there are several other similar names used in the industry. </p> <p>The actual code isn't as important as the concept. The plaintext code is prepended (in executive order) by a decryption stub responsible for decoding the body of the co...
1673
2013-04-09T08:27:22.040
<p>I have an obfuscated binary which only print a simple <code>Hello World!</code> and exit like this:</p> <pre><code>Hello World! </code></pre> <p>But, when I am looking at the assembly with <code>objdump</code>, I cannot find any call to <code>printf</code> or <code>write</code>, nor find the string <code>Hello Wor...
What is "instruction camouflage" obfuscation?
|obfuscation|
<p>In general what you do is that you make a new segment in the executable, change the entry point to your new segment. Your new segment has the decryption code for the original code and the changed entry point now means that the first code to execute when the executable is loaded is your decryption code. </p> <p>Your...
1676
2013-04-09T08:41:45.237
<p>I would like to know what is the simplest way to produce code binaries with instruction camouflage (see <a href="https://reverseengineering.stackexchange.com/questions/1673/what-is-a-instruction-camouflage-obfuscation">this question</a>). </p> <p>The problem here is that you first have to produce a correct assembly...
How to produce binaries with "instruction camouflage" obfuscation?
|tools|obfuscation|
<p>There is an H8 port of GNU binutils (the target is called 'h8300' I believe) which includes <code>objdump</code>. It seems it's even available in Debian in the package <a href="http://packages.debian.org/sid/binutils-h8300-hms"><code>binutils-h8300-hms</code></a> (might be outdated).</p> <p>Alternative GNU-based to...
1684
2013-04-09T21:28:14.397
<p>IDA Pro can deal with the Renesas H8 processors, but not the free version.</p> <p>Are there any free or low cost (&lt;£100) disassemblers for the Renesas H8 family or processors?</p>
Are there any free or low cost disassemblers for the Renesas H8 family of processors?
|tools|disassembly|renesas-h8|
<p>Here is a collection of anti-sandbox/vm/debugger techniques implemented in a open source program which will give you a clear idea how to detect virtualization: <a href="https://github.com/LordNoteworthy/al-khaser" rel="nofollow noreferrer">https://github.com/LordNoteworthy/al-khaser</a>.</p> <p>Here are the list of...
1686
2013-04-09T22:12:45.620
<p>What are the different ways for a program to detect that it executes inside a virtualized environment ? And, would it be possible to detect what kind of virtualization is used ?</p>
How to detect a virtualized environment?
|anti-debugging|virtual-machines|
<p>In order of increasing complexity: oligomorphic, polymorphic, metamorphic.</p> <p>The first two terms are generally applied to decryptors. We (anti-virus industry) define them this way: oligomorphic - decryptor with few variable elements, which does not affect the size or shape of the code. It means that the varia...
1696
2013-04-10T08:34:49.783
<p>Malware use several methods to evade anti-virus software, one is to change their code when they are replicating. I saw mainly three type of techniques in the wild which are: <em>metamorphic malware</em>, <em>oligomorphic malware</em> and <em>polymorphic malware</em> (I might have missed one). What are the main diffe...
What are the differences between metamorphic, oligomorphic and polymorphic malware?
|obfuscation|malware|
<p>I recommend <code>uncompyle6</code>. it can decompile pyc/pyo files and it is compatible with python 3</p> <ol> <li><p><code>pip install uncompyle6</code></p> </li> <li><p><code>uncompyle6 FILE.pyc</code></p> </li> </ol>
1701
2013-04-10T14:02:31.443
<p>Does anybody have a suggestion for (non commercial) software to decompile "byte-code" Python (.pyc) files?</p> <p>Everything I've found seems to break...</p>
Decompiling .pyc files
|tools|decompilation|python|
<p>ELF itself doesn't specify any kind of checksum. Your link error is likely due to an incorrect edit which changed some offsets within the file. If you don't adjust the offsets, you have to replace a string with a string that is no longer than the original, and you cannot add new fields unless you have a known amount...
1703
2013-04-10T17:38:55.013
<p>I've hex-edited a string in an Android ELF binary.<br> Now, it won't run, and gives the error message <em>CANNOT LINK EXECUTABLE</em>, presumably due to a bad checksum.</p> <p>Does anybody have a tool to fix the checksum? </p>
Fixing the checksum of a modified Android ELF
|tools|android|elf|
<p><a href="http://www.eclipse.org/aspectj/" rel="nofollow">AspectJ</a> can be used to do this on the JVM, via load-time weaving. It's built on Asm but there's more abstraction (no bytecode). Tracing method calls is fairly straight-forward: first define a filter to match "pointcuts" you're interested in, then specify t...
1714
2013-04-11T09:37:10.487
<p>This is not strictly 'reverse engineering', it's mostly related to dynamic instrumentation.</p> <p>So, in the same fashion as <code>strace</code> which allows you to see syscalls made by a process, or <code>ftrace</code> to see function calls, is there anything similar for Java?</p> <p>What I am interested in is h...
Dynamic java instrumentation?
|dynamic-analysis|java|android|
<p>While this answer is certainly not true in all situations, the answer for which your teacher is probably looking:</p> <ul> <li>Local variables are in the form <code>[EBP - ...]</code></li> <li>Passed arguments are in the form <code>[EBP + ...]</code></li> </ul>
1722
2013-04-11T15:48:28.053
<p>How can you determine if a variable is a local variable of the function or an argument passed to the function?</p>
Determining if a variable is local or an argument passed to a function
|disassembly|c|c++|
<p>Recently, two new kernel instrumentation systems have been released, of which I am the creator of one:</p> <ol> <li><a href="https://github.com/Granary/granary">Granary</a>, which is primarily focused on module instrumentation. This is the instrumentation created by me. Granary internally uses parts of DynamoRIO, b...
1724
2013-04-11T18:05:07.347
<p>I've found some universities that are porting <a href="http://www.dynamorio.org/" rel="noreferrer">DynamoRIO</a> (or something very similar) to Linux kernel space, but the code doesn't seem to be available. Is there a resource I am unaware of?</p> <p><a href="http://www.cs.toronto.edu/~peter/feiner_asplos_2012.pdf"...
How can I use DynamoRIO or something similar in Linux kernel space?
|tools|dynamic-analysis|dynamorio|
<p>As it turns out, somebody asked roughly the same question on reddit about a year ago and I <a href="http://www.reddit.com/r/ReverseEngineering/comments/smf4u/reverser_wanting_to_develop_mathematically/c4fa6yl" rel="nofollow noreferrer">posted a rather extensive answer to it</a>, and I have continued to edit it in th...
1727
2013-04-11T18:39:57.193
<p>I would like more information about the mathematical foundations of vulnerability and exploit development.online sources or books in the right direction will be helpful.</p>
mathematical background behind exploit development and vulnerabilities
|vulnerability-analysis|
<p>Select the first byte, Edit -> Strings -> Unicode.</p>
1734
2013-04-12T03:37:45.860
<p>In IDA 5.0 Freeware how do you convert a block of data into a unicode string, the only thing I can find is to convert it into an ascii string.</p> <pre><code>db 'a' db 0 db 'b' db 0 db 'c' db 0 db 'd' db 0 db 0 db 0 </code></pre> <p>into</p> <pre><code>unicode &lt;abcd&gt;, 0 </code></pre>
IDA Convert to Unicode
|ida|encodings|
<h1>Explanation</h1> <p>The break on attach is due to the <code>ntdll</code> <code>DbgUiRemoteBreakin</code> and <code>DbgBreakPoint</code> functions being called. If you check the <code>kernel32</code> <code>DebugActiveProcess</code> function called by the debugger, OllyDbg or ImmunityDebugger, you will see a call to ...
1738
2013-04-12T09:40:39.973
<p>When I attach OllyDbg or ImmunityDebugger to a process, it automatically breaks execution. I'm attaching to a user-mode service running as SYSTEM and only need to catch exceptions, so this is not ideal. Is there a way to disable the break-on-attach behaviour?</p>
How can I prevent Immunity Debugger / OllyDbg from breaking on attach?
|tools|debuggers|ollydbg|immunity-debugger|
<h1>Books:</h1> <ul> <li><strong><a href="https://rads.stackoverflow.com/amzn/click/com/0764574817" rel="nofollow noreferrer" rel="nofollow noreferrer">Reversing: Secrets of Reverse Engineering</a></strong>, Eldad Eilam</li> <li><a href="http://nostarch.com/idapro2.htm" rel="nofollow noreferrer"><strong>IDA Pro Book, 2...
1754
2013-04-13T16:32:58.253
<p>This post is for collecting all the best books and tutorials that exist dealing with <a href="/questions/tagged/windows" class="post-tag" title="show questions tagged &#39;windows&#39;" rel="tag">windows</a> specific reverse engineering techniques and concepts. The content will be added to the <a href="https://rever...
Windows Wiki : Books and Tutorials
|windows|
<p>I am not aware of a currently active generic "firmware reversing" forum.</p> <p>A few years ago there was a pretty ambitious attempt with <a href="http://wayback.archive.org/web/20100514210317/http://lostscrews.com/">lostscrews.com</a> but unfortunately it languished due to lack of attention, got overwhelmed with s...
1757
2013-04-13T21:14:00.353
<p>The question pretty much says it. Beyond knowing people that are interested in the same things, is there a collaborative reversing dumping ground for documenting specifically disassembly of closed source firmware?</p>
Is there a collaborative reversing forum for people that deal with firmware?
|decompilation|disassembly|firmware|
<p>As others have mentioned the first thing you should do is dump the memory with MoonSols. This will allow you to do memory analysis using Volatility later. When it comes to malware analysis I find IDA the most useful. In order for it be useful you will need a process dump and a way to rebuild the import table. If th...
1761
2013-04-14T09:41:56.633
<p>I have an infected MS-Windows 7 machine with an <em>in-memory</em> malware, shutting it down will probably make it disappear and I would like to get the malware in a more convenient format to perform some analysis on it.</p> <p>What are the different in-memory malware and what kind of methods do you recommend for e...
How to capture an "in-memory" malware in MS-Windows?
|malware|digital-forensics|
<p>The webdecomp tool didn't work for me on the latest builds of DD-WRT, managed to extract the firmware though.</p> <pre><code>root@ubuntu:~/Desktop/firmware-mod-kit/src/webcomp-tools$ ./webdecomp --httpd="/home/root/Desktop/firmware-mod-kit/fmk/rootfs/usr/sbin/httpd" -www="/home/root/Desktop/firmware-mod-kit/fmk/roo...
1763
2013-04-14T12:43:55.180
<p>When reversing a router firmware based on DD-WRT I came across a mention of "webcomp". It seems it's used for storing internal HTML files for the web interface. What exactly it is and how can I extract those files from the firmware image?</p> <p>NOTE: This is a self-asked and answered question to add to the knowled...
What is "webcomp" and how does it work?
|linux|firmware|webcomp|
<p>Data Interleaving is a term I made up to reflect an idea I've been contemplating lately; interleaving the bits of a set of variables into a single binary blob. Any number and types of variables could be interleaved together. Access to variables in the interleaved blob can even be on-demand, with a controller class e...
1766
2013-04-14T17:16:43.087
<p>What is data interleaving? Is this something I can use to obfuscate collections of variables?</p>
What is Data Interleaving?
|obfuscation|
<h2>Definition</h2> <p>We'll define a packer as an executable compressor. </p> <p>Packers reduce the physical size of an executable by compressing it. A decompression stub is usually then attached, parasitically, to the executable. At runtime, the decompression stub expands the original application and transfers cont...
1779
2013-04-15T11:36:23.980
<p>I know the basic principle of a packer. Basically, it is a small routine launched at the beginning of the program that decompress the actual program and jump to it once achieved.</p> <p>Yet, it seems that there are quite a lot of variations around this principles. I recently learned about "<em>virtualized packers</...
What are the different types of packers?
|obfuscation|malware|packers|
<p>If you aren't afraid to get your hands dirty, on Windows you could always write a filter driver on top of or below the device object for the dongle. The <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff548294.aspx" rel="nofollow"><code>IoAttachDevice()</code></a> function and the three other funct...
1786
2013-04-15T18:29:01.353
<p>How can I monitor a usb dongle's traffic? I would like to see how a program and its usb dongle talk to each other, if it is possible replay this traffic?</p> <p>Since I am new to this type of thing, any tutorial or tool suggestion is welcome.</p>
USB Dongle Traffic Monitoring
|tools|executable|usb|dongle|
<p>A more up-to-date answer to this question would be to suggest <a href="http://www.capstone-engine.org/" rel="nofollow">Capstone</a> library. I've used it for ARM disassembly and it's quite reliable. IMHO, It's the best open source library available. </p> <p>The library is based on LLVM's TabelGen instruction descr...
1791
2013-04-15T22:04:52.597
<p>Are there any ARM (or other non-x86) disassemblers that decompose an instruction into its component parts in a machine-friendly structure? Ideally it would be something like <a href="http://www.cs.virginia.edu/kim/publicity/pin/docs/20751/Xed/html/" rel="noreferrer">XED</a> or <a href="https://code.google.com/p/dist...
Are there any ARM disassemblers that provide structured output?
|tools|disassembly|arm|
<p>You might be better off looking at a generic data packer first, such as <a href="http://code.google.com/p/lz4/">LZ4</a>. It's a very simple packer written in C. There are various unpackers in several languages, too, on the same site. Jumping right into a runtime packer means lots of file format details that, real...
1792
2013-04-15T22:13:42.270
<p>There are great questions here about different types of packers and that is very interesting to me. I would like to try my hand at reverse engineering one. Since I am very new to this, I would like the source code as well.</p> <p>I am hoping that by continuously compiling and recompiling the source, I can learn t...
Is there any simple open source Windows packer?
|windows|packers|
<p>Tools like Qemu or Bochs are IMO pretty similar to DBI frameworks conceptually and they work on the entire system, including the kernel. Research efforts like <a href="http://bitblaze.cs.berkeley.edu/" rel="nofollow">BitBlaze</a> and <a href="http://dslab.epfl.ch/proj/s2e" rel="nofollow">S2E</a> have used modified v...
1797
2013-04-15T22:27:57.460
<p>Is there anything like PIN or DynamoRIO to instrument at Kernel level? The platforms I'm more interested on are Windows and OSX.</p>
Kernel level Dynamic Binary Instrumentation
|windows|dynamic-analysis|osx|kernel-mode|instrumentation|
<p>Like many others have stated, there are many different types of professional RCE positions. I think the first step for you is to determine which aspect of RCE you would like to pursue. Getting started professionally is a lot easier if you are able to specialize in a particular area: malware, vuln research, DRM, fi...
1812
2013-04-16T23:13:49.257
<p>I'm currently a high school sophomore. I haven't really done much on the RCE of malware, I've unpacked <code>zbot</code> and <code>rbot</code>, and looked at how they work, but I can manipulate practically any game to my liking by reverse engineering it and finding out which functions I need to detour, or what addre...
How do I move from RCE being a hobby to RCE being a profession?
|career-advice|
<p>Just for completeness: one more disassembler, <a href="https://binary.ninja/">Binary Ninja</a>:</p> <p>As for now (9/26/2016) it has the following properties:</p> <ul> <li>Commercial ($99 as introductory price for personal use license)</li> <li>Handles x86, x64, ARMv7-8, MIPS and 6502 architectures</li> <li>Works ...
1817
2013-04-17T00:59:59.900
<p>Is there any disassembler (not only a live debugger) second to IDA in capabilities? IDA is wonderful, and somewhat amazing in how robust and useful it is for reversing. However, it is quite expensive to properly license. Is there <em>any</em> viable alternative, or does IDA hold the monopoly on this market?</p> <p>...
Is there any disassembler to rival IDA Pro?
|tools|ida|disassemblers|
<h1>By Architecture</h1> <p><em>Generic helpers for reverse engineering of a specific architecture.</em></p> <h2>ia32</h2> <h2>amd64</h2> <h2>ARM</h2> <hr /> <h1>By Operating System</h1> <p><em>Generic helpers for reverse engineering of a specific operating system.</em></p> <h2>Windows</h2> <h2>Linux</h2> <hr /> <h1>By...
1829
2013-04-17T10:02:42.920
<p>I am just starting to use <a href="https://www.hex-rays.com/products/ida/">IDA Pro</a>. After discussing a bit with the community, it seems that IDA Pro plugins and scripts are quite important to reach a good level of productivity while analyzing a program.</p> <p>What are some <em>must have</em> plugins for IDApro...
Could you list some useful plugins and scripts for IDA Pro?
|ida|ida-plugin|
<p>I usually rebase it in IDA to <code>0</code>. Then using <code>Adv Ctr + G</code> option of StrongOD, you can just put the address from IDA as RVA to needed module.</p>
1833
2013-04-17T14:17:46.000
<p>I'm currently trying to gain some practice in RE and I need some help for patching a DLL. Here are my steps: I first analyze the main program and the dll in IDA trying to understand the logic. I then switch to OllyDBG for patching. Well, the problem is, since Olly dynamically loads the dll (in contrast to the static...
How to find offsets in OllyDBG from IDA
|ida|ollydbg|
<p>from its <a href="http://radare.org/y/?p=features">feature</a> page:</p> <ul> <li>Multi-architecture and multi-platform <ul> <li>GNU/Linux, Android, *BSD, OSX, iPhoneOS, Windows{32,64} and Solaris</li> <li>x86{16,32,64}, dalvik, avr, arm, java, powerpc, sparc, mips, bf, csr, m86k, msil, sh</li> <li>pe{32,64}, [fat]...
1842
2013-04-18T09:34:49.823
<p><a href="http://radare.org/y/">Radare2</a> is a framework for reverse-engineering gathering several tools (see this <a href="http://www.phrack.org/issues.html?issue=66&amp;id=14#article">Phrack article</a> about radare1 to know a bit more about the framework).</p> <p>I would like to know if someone could point out ...
What are the main features of radare2?
|tools|binary-analysis|radare2|
<h2 id="e9patch-et3b"><a href="https://github.com/GJDuck/e9patch" rel="nofollow noreferrer">e9patch</a></h2> <blockquote> <p>E9Patch is different to other tools in that it can statically rewrite x86_64 Linux ELF binaries without modifying the set of jump targets. To do so, E9Patch uses a set of novel low-level binary r...
1843
2013-04-18T09:43:07.177
<p>I would like to be able to rewrite or reorganize an ELF binary program directly from the executable format (not at compile-time). </p> <p>The only library I know to do this is <a href="http://hg.secdev.org/elfesteem/">elfesteem</a> (used in <a href="http://code.google.com/p/smiasm/">Miasm</a>). But, there must be o...
What are the available libraries to statically modify ELF executables?
|tools|obfuscation|deobfuscation|elf|
<p>I was just sent <a href="https://www.dropbox.com/s/yj30fqj2dxxlmnj/mIDA-1.0.10.zip">mIDA-1.0.10</a>, from 2008.</p> <pre><code>mIDA is an IDA plugin which extracts RPC interfaces and recreates the associated IDL file. mIDA supports inline, interpreted and fully interpreted server stubs. </code></pre>
1849
2013-04-18T14:14:04.363
<p><a href="https://reverseengineering.stackexchange.com/questions/59/what-are-the-essential-ida-plugins-or-ida-python-scripts-that-you-use/62#62">Some posts</a> reference the <a href="http://www.openrce.org/downloads/details/186/mIDA" rel="nofollow noreferrer">mIDA</a> plugin, but the download site seems unavailable. ...
where can I get mIDA
|ida|ida-plugin|
<p>My answer is a little late; newcomer to this site. The Decompiler project was initiated in order to decompile MS-DOS EXE and COM binaries. The project has both a command-line and a GUI tool:</p> <p><a href="https://sourceforge.net/projects/decompiler/" rel="nofollow">https://sourceforge.net/projects/decompiler/</a>...
1854
2013-04-18T20:07:52.410
<p>What can I do to reverse engineer a DOS .COM file? As far as debugging goes, I've looked DEBUG and DEBUGX from the creators of FreeDOS, as well as the default DEBUG command that comes with Windows. Sure, I can probably work with them and eventually figure out what I'm doing, but I feel like the process would end up ...
Working with DOS .COM files
|tools|windows|dos-com|
<p>If you think the encoding is wrong then you can try these 2 things:</p> <ul> <li>Try using <code>x/hs</code> <a href="http://sourceware.org/gdb/onlinedocs/gdb/Memory.html">as described here</a></li> </ul> <blockquote> <p>Each time you specify a unit size with x, that size becomes the default unit the next time y...
1860
2013-04-19T04:02:20.333
<p>Are there any useful snippets or Gdb functions that you guys normally use to print out Unicode strings? I'm trying to debug Mach-O binaries and <code>x/s</code> seems to be printing out junk. I believe the default encoding for Objective C strings is UTF-16.</p>
Printing Unicode strings in Gdb in OSX
|osx|gdb|encodings|mach-o|strings|
<p><a href="http://rammichael.com/multimate-assembler" rel="nofollow noreferrer"><strong>Multiline Ultimate Assembler</strong></a> is a multiline (and ultimate) assembler (and disassembler) plugin for OllyDbg. It’s a perfect tool for modifying and extending a compiled executable functionality, writing code caves, etc.<...
1869
2013-04-19T18:45:39.290
<p>I'm working with some x86 assembly code and I need to rip from one executable and paste that code into another.</p> <p>Originally, I had an executable that was meant to accept two command line parameters and run a handwritten function on them. However, I ran into annoyances with using <code>GetCommandLine</code> et ...
Ripping/pasting code into an executable using Olly
|disassembly|pe|ollydbg|patching|
<p>I had the same problem at first when trying to connect <code>IDAPro</code> to <code>windbg</code>. What I did was the following:</p> <ol> <li>Manually edit the <code>ida.cfg</code> file located inside <code>.\IDA 6.4\cfg\ directory</code>.</li> <li><p>Change the <code>DBGTOOLS</code> path with WinDbg tools director...
1873
2013-04-20T06:01:15.870
<p>Environment:</p> <ul> <li>Host: Win7 SP1 x64: VMWare Workstation 9.02, VirtualKD, IDA Pro 6.4.13 (x64) and WinDbg</li> <li>Guest: Win7 SP1 x64</li> </ul> <p>I have VirtualKD setup correctly in my guest and host. I say this because attaching WinDbg to the guest VM through VirtualKD works flawlessly.</p> <p>But whe...
WinDbg fails to connect to IDA Pro debugger server
|windows|ida|debuggers|kernel-mode|windbg|
<p>After a little bit more work and some more careful re-reading, I figured out my mistake: the files in <code>/data/app-asec/</code> are the encrypted <em>containers</em>. They're actually dm-crypt volumes, which then get mounted at <code>/mnt/asec/[app_id]</code>. The <code>pkg.apk</code> in that directory is the une...
1876
2013-04-21T03:48:04.687
<p>I've been trying to reverse engineer a paid android app that writes out some binary data so that I can export that data into other programs (it's a run/walk timer app, if anyone's curious, and I'm trying to get its GPS traces out). However, it looks like the apk is encrypted and stored in <code>/data/app-asec/[app_i...
Analyzing encrypted Android apps (.asec)?
|android|encryption|
<p>As an open source alternative there's <a href="https://github.com/noseglasses/elf_diff" rel="nofollow noreferrer">elf_diff</a> which compares elf-files and generates html or pdf reports. It's available as a Python package.</p>
1879
2013-04-21T13:57:12.093
<p>I'm looking for a tool like <code>Beyond Compare</code>, <code>meld</code>, <code>kdiff</code>, etc. which can be used to compare two disassembled binaries. I know that there's binary (hex) comparison, which shows difference by hex values, but I'm looking for something that shows op-codes and arguments.</p> <p>Anyo...
how can I diff two x86 binaries at assembly code level?
|tools|binary-analysis|bin-diffing|
<p><a href="http://www.openwatcom.org/">OpenWatcom</a> has full support for Win16 including debugging, though I personally haven't tried it. It even has remote debugging support over TCP/IP, serial and a couple other protocols.</p> <p>Older SoftICE versions also supported Win16, you may try your luck with that.</p>
1891
2013-04-22T09:49:45.830
<p>I'm trying to debug a 16-bit Windows executable (format: New Executable). The problem is that all the standard tools (W32DASM, IDA, Olly) don't seem to support 16-bit debugging.</p> <p>Can you suggest any win16-debuggers?</p>
Debugging NewExecutable binaries
|tools|debuggers|ne|
<p>A '<em>side-channel attack</em>' define any technique that will consider unintended and/or indirect information channels to reach his goal. It has been first defined in smart-card cryptography to describe attacks which are using unintentional information leak from the embedded chip on the card and that can be used i...
1897
2013-04-22T19:24:31.780
<p>When reversing smart-cards, the <a href="http://en.wikipedia.org/wiki/Side_channel_attack" rel="nofollow">side-channel attacks</a> are known to be quite effective on hardware. But, what is it, and can it be used in software reverse-engineering and how?</p>
What is SCARE (Side-Channel Attacks Reverse-Engineering)?
|hardware|physical-attacks|smartcards|
<h3>Fault Injection Attacks</h3> <p>Basically, we assume here that we have a black-box that produces an output using a known algorithm but with some unknown parameters. In the case of cryptography, the black-box could be a chip on a smart-card, the know algorithm could be a cryptographic algorithm and the unknown param...
1898
2013-04-22T19:32:17.807
<p>Trying to extract data from the hardware is often quite difficult (especially when dealing with smartcards). Fault-injection attacks allow to guess cryptographic keys based on the propagation of errors through the encryption/decryption algorithm. I know some of the types of fault-injections possible, but not all.</p...
What is fault-injection reverse engineering? What are the techniques involved?
|hardware|physical-attacks|smartcards|
<p>None of the answers so far answer the actual question so here goes.</p> <p>A debugger plugin differs from a "normal" one in two points:</p> <ol> <li>it has <code>PLUGIN_DBG</code> in the plugin's flags.</li> <li>in init(), it must set the global variable <code>dbg</code> to a pointer to an implementation of <code>...
1899
2013-04-22T19:50:47.310
<p>Are there any good resources for developing debugger plugins in IDA Pro using the SDK that describe the IDA debugger API? An example of this is the <a href="http://sourceforge.net/projects/idaproarmdebug/">IDA Pro ARM debugger plugin</a> on Sourceforge. There seem to be few projects that have accomplished this. Spec...
Creating IDA Pro debugger plugins - API documentation and examples?
|ida|debuggers|ida-plugin|
<p>One of things I do is to read the machine code and translate it back into IR pseudo opcodes sans any addressing address values, and then perform differences between those two pseudo-IR binaries after using this reduction method on each. </p>
1902
2013-04-22T21:30:23.277
<p>How comes that text diffing tools like <code>diff</code>, <code>kdiff3</code> or even more complex ones usually fail at highlighting the differences between two disassemblies in textual form - in particular two <em>related</em> binary executable files such as different versions of the same program?</p> <p>This is t...
Why are special tools required to ascertain the differences between two related binary code files?
|tools|disassembly|assembly|bin-diffing|
<p>From <a href="https://www.hex-rays.com/products/ida/6.4/index.shtml">IDA 6.4 news</a>:</p> <pre><code>+ SDK: added extra_cmt_changed IDB event for the anterior/posterior comment changes; also renamed the SDK functions related to these comments </code></pre>
1906
2013-04-22T23:19:41.360
<p>IDA Pro allows plugins to receive notifications for a number of events. These are defined in the <code>hook_type_t</code> enumeration inside <code>loader.hpp</code> in the SDK from what I saw. If I subscribe to <code>HT_IDB</code> events, I have a host of options for notifications I can subscribe to (<code>event_cod...
How can my plugin get notified of anterior or posterior comments (and more) changes to an IDA database?
|ida|ida-plugin|idapro-sdk|
<p>You can also position your cursor in one of the code, hex-view, or stack view windows, and press 'g' to bring up the "jump to address" dialog.</p>
1909
2013-04-23T07:21:57.103
<p>This is a very naive question about IDA Pro. Once the IDA debugger started, I would like to be able to type a memory address (or a memory zone) and look easily at the content of it (in various format). With <code>gdb</code> you would do <code>print /x *0x80456ef</code> or, if you want a wider zone, <code>x /6x 0x804...
How to display memory zones content on IDA Pro?
|tools|ida|
<h1>TL;DR</h1> <ol> <li><p>the first 3 lines set an exception handler (an 'error catcher')</p></li> <li><p>the <code>int3</code> generates an exception</p></li> <li><p>execution resumes at <code>next</code></p></li> </ol> <hr> <h1>Explanation</h1> <p>this trick is (ab)using <a href="http://www.microsoft.com/msj/019...
1911
2013-04-23T12:31:29.360
<p>In a 32 bits Windows binary, I see this code:</p> <pre><code> push next push fs:[0] mov fs:[0], esp int3 ... next: </code></pre> <p>I see that something happens on the <code>int3</code> (an error), but I don't understand why, and how to follow execution while keeping control.</p>
What's 'fs:[0]' doing and how can I execute it step by step?
|windows|x86|seh|
<p>It expects the (beginning of the) actual type description (like <code>Portable executable for 80386 (PE)</code>), not the name of the loader plugin (like <code>pe.ldw</code>), because a loader plugin can generate different types.</p> <p>So in the case of a Windows PE, any of these should work:</p> <ul> <li><code>-...
1918
2013-04-24T09:28:24.673
<p>I would like IDA to remember my default load file settings instead of presenting the <a href="https://www.hex-rays.com/products/ida/support/idadoc/242.shtml" rel="noreferrer">load file</a> dialog on every start. <a href="https://www.hex-rays.com/products/ida/support/idadoc/417.shtml" rel="noreferrer">The documentat...
How to avoid the load file dialog in IDA GUI
|ida|
<p>After decompressing and loading the kernel, you need to find a couple of tables that encode the compressed symbol table. These are (in the usual order they are placed in binary):</p> <ul> <li><code>kallsyms_addresses</code> - a table of addresses to all public symbols in the kernel</li> <li><code>kallsyms_num_syms<...
1922
2013-04-24T16:47:09.463
<p>Igor posted a great <a href="https://stackoverflow.com/a/14811668/139463">answer</a> previously on SO about the format of the Linux kernel image on ARM.</p> <p>Assuming I can't boot my kernel image, can someone give me pointers on finding this compressed symbol table in the binary? </p>
Locating Linux Kernel Symbols on ARM
|linux|arm|
<p>[Back in 2013] the decompiler did not have a scripting API. So you had these choices:</p> <ul> <li><a href="http://www.hexblog.com/?p=126" rel="nofollow">Add necessary functions to IDC</a> using a native plugin that calls the decompiler API.</li> <li>Use <code>ctypes</code> or similar to call the C++ API directly f...
1929
2013-04-25T06:30:29.873
<p>I want to use IDA with the Hex-Rays decompiler plugin as part of automated static analysis, possibly on a large number of files without opening each one and telling it to produce a C file individually. </p> <p>Ideally, I'd like to run IDA from the command line, and get the decompilation based on initial autoanalys...
How can I control the Hex-Rays decompiler plugin from IDA with scripts?
|ida|ida-plugin|idapython|
<p>It is possible the ways the other commenters suggested. However, all of them are interceptable, if you read a file, it can be intercepted and your program will be given different result, if you check if LD_PRELOAD is set, it can be unset before you can reach out to it, etc. Suid is another story, though, but there m...
1930
2013-04-25T08:07:47.923
<p>Under Linux it's possible to trace exactly the kernel system calls with <code>strace</code>. <code>ltrace</code> can be used also to trace library calls. I wonder if it's possible to detect if my executable is running under <code>strace</code> or <code>ltrace</code> ?</p> <p>Here's an example of the output of <code...
Detecting tracing in Linux
|linux|anti-debugging|
<p>perror's answer I think is the correct way to do it. I wanted to post the way I ended up doing this for other's sake just in case the issue I mentioned in my comment to perror's answer is correct. I don't have all my notes with me right now and will update if necessary.</p> <p>Basically I ran the program in gdb, se...
1934
2013-04-26T18:36:54.600
<p>I posted this a while back on <a href="https://stackoverflow.com/questions/12513901/is-it-possible-to-get-python-bytecode-without-using-co-code">stackoverflow</a> (too old to migrate though).</p> <p>Say I am in the python interpreter and define a function as follows:</p> <pre><code>def h(a): return a </code></pr...
Is it possible to get python bytecode without using co_code?
|python|
<p>I used to use <a href="https://github.com/gdbinit/Gdbinit" rel="nofollow noreferrer">https://github.com/gdbinit/Gdbinit</a> for tuning GDB but it's getting a bit dated, so I'd recommend <a href="https://github.com/hugsy/gef" rel="nofollow noreferrer">https://github.com/hugsy/gef</a> now as a modern alternative.</p>
1935
2013-04-27T03:13:34.493
<p>I have GDB but the binary I want to reverse engineer dynamically has no symbols. That is, when I run the <a href="https://www.man7.org/linux/man-pages/man1/file.1.html" rel="nofollow noreferrer"><code>file</code></a> utility it shows me <strong>stripped</strong>:</p> <pre><code>ELF 64-bit LSB executable, x86-64, ver...
How to handle stripped binaries with GDB? No source, no symbols and GDB only shows addresses?
|tools|dynamic-analysis|linux|debuggers|gdb|
<p>Currently I'm using TreeDBNotes, they have a free and pro version available. I haven't compared it to any of the methods mentioned in other answers, but find it quite useful for keeping track of my project notes/data.</p> <p><a href="http://www.mytreedb.com" rel="nofollow">http://www.mytreedb.com</a></p>
1937
2013-04-27T09:29:13.530
<p>Since now, when I am analyzing a binary, I'm using a "pen and paper" method to locate the different location of the function, the different type of obfuscations, and all my discoveries. It is quite inefficient and do not scale at all when I try to analyze big binaries.</p> <p>I know that IDAPro is having a data-bas...
How do you store your data about a binary while performing analysis?
|tools|binary-analysis|
<p>You have some options. </p> <p>You can create your own obfuscation method comprised of existing encryption tools...i.e. openssl. But, beware, it will likely take you a considerable amount of time to complete this type of project. </p> <p>It'll require you to map out how you're going to enclosed the "passwords/pa...
1943
2013-04-27T20:06:56.917
<p>This question is related to this <a href="https://reverseengineering.stackexchange.com/questions/1934/is-it-possible-to-get-python-bytecode-without-using-co-code">other one</a>. I just wonder what are the techniques applicable and which can be found in the real world to obfuscate Python program (similar questions c...
What are the techniques and tools to obfuscate Python programs?
|tools|obfuscation|python|
<p>Crisis is trying to locate dyld location in that piece of code: 32bits dyld is usually located at 8FE00000 - it uses that to solve symbols, if I'm not mistaken.</p> <p>Check my Crisis <a href="http://reverse.put.as/2012/08/06/tales-from-crisis-chapter-1-the-droppers-box-of-tricks/">analysis</a> if you haven't alrea...
1946
2013-04-28T11:36:50.347
<p>I was reverse engineering a piece of code in "Crisis" for fun and I encountered the following :-</p> <pre><code>__INIT_STUB_hidden:00004B8F mov eax, 8FE00000h __INIT_STUB_hidden:00004B94 __INIT_STUB_hidden:00004B94 loc_4B94: __INIT_STUB_hidden:00004B94 ...
FEEDFACE in OSX malware
|malware|osx|
<p>When I needed to do a similar task I ended up hooking the IDB save event and then scanned the IDB for modifications using the IDA API before each user save. it took about a few seconds to scan the entire function list, aggregating most information for both functions and data elements.</p> <p>To me, that sounds like...
1956
2013-04-29T01:12:29.017
<p>In my <a href="https://reverseengineering.stackexchange.com/questions/1906/how-can-my-plugin-get-notified-of-anterior-or-posterior-comments-and-more-chan">previous question</a> I had originally asked for this, but since this aspect of the question was completely disregarded, I feel compelled to ask it separately.</p...
How to get notified about IDA database events not covered in the IDA SDK?
|ida|ida-plugin|idapro-sdk|
<p>When single-stepping through code, the <code>T</code> flag is set so that the CPU can break after the instruction completes execution. When an interrupt occurs, the state of the <code>T</code> flag is placed on the stack, and used when the <code>iret</code> instruction is executed by the handler. However, the <cod...
1958
2013-04-29T16:28:50.237
<p>I'm reversing some malware on an OSX VM when I noticed something peculiar. While stepping through the instructions, the instruction just after a <code>int 0x80</code> gets skipped <em>i.e.</em> gets executed without me stepping through this.</p> <p><strong>Example:</strong></p> <pre><code> int 0x80 inc eax ; &lt;...
Strange GDB behavior in OSX
|malware|gdb|osx|x86|mach-o|
<p><strong>I edited the whole example a little so that it would better match the question.</strong></p> <p>My SPARC assembly fu is weak, but what I did was write a little "Hello world" with a twist (or one could say with jumps/<code>goto</code>s) in C and use <code>gcc -S</code> to translate it to assembly. I have a S...
1962
2013-04-29T17:49:06.700
<p>Our team recently had to look at <a href="http://www.sparc.com/standards/V8.pdf" rel="nofollow">SPARC assembly specifications</a>, the problem is that I do not have a SPARC processor to try things on it (I should set up a simulator or get one of these old Sparc station on my desk... I know).</p> <p>Somehow, the <co...
On SPARC, what happens when a branch is placed in the branch-delay slot of another branch?
|obfuscation|binary-analysis|sparc|
<p>Newer versions of Android actually include a mechanism like this. It uses jdwp to send a signal to tell the app that you've connected up. See the ndk-gdb script from the NDK =)</p>
1965
2013-04-29T18:57:17.257
<p>I have an android application that uses a shared library which I would like to step through with a debugger. I've had success using IDA 6.3 to debug executables with the <code>android_server</code> debug server included with IDA but haven't gotten it to work with shared objects yet. </p> <p>For a specific example...
How to break on an Android JNI function with IDA Pro Debugger
|ida|android|
<p>The best option for Windows that I have found in 2023 is using WinShark, which is not that well known:</p> <p><a href="https://github.com/airbus-cert/Winshark" rel="nofollow noreferrer">https://github.com/airbus-cert/Winshark</a></p> <p>It uses ETW to capture PID related to each packet, you just have to use somethin...
1970
2013-04-30T19:44:25.337
<p>Is it possible to sniff TCP traffic for a specific process using Wireshark, even through a plugin to filter TCP traffic based on process ID?</p> <p>I'm working on Windows 7, but I would like to hear about solution for Linux as well.</p>
Sniffing TCP traffic for specific process using Wireshark
|sniffing|wireshark|
<p>Here's an explanation for what I think the individual symbols mean. I'm basing this around the presumption that a little selector is going through the cells, one by one.</p> <ul> <li><code>\xFF</code> = Null cell</li> <li><code>\x05</code> = A string is following, with <code>\xNumber</code> coming after the string ...
1971
2013-04-30T19:57:56.433
<p>I have binary data representing a table.</p> <p>Here's the data when I print it with Python's <a href="http://docs.python.org/2/library/repr.html#module-repr">repr()</a>: <code>\xff\xff\x05\x04test\x02A\x05test1@\x04\x03@@\x04\x05@0\x00\x00@\x05\x05test2\x03\x05\x05test1\x06@0\x00\x01@\x00</code></p> <p>Here's wha...
Any idea how to decode this binary data?
|unpacking|file-format|
<p>According to devttys0's answer.</p> <p>This script is for IDA version higher than 7.4.</p> <pre><code> def convert_data(): align_size = ida_kernwin.ask_long(4, &quot;align size&quot;) if align_size == None: return start = idc.read_selection_start() end = idc.read_selectio...
1973
2013-05-01T12:12:02.280
<p>I have a large section in IDA that is a data lookup table of word length data. I want to change them all to word length rather than byte length. I know you can make an array but when I do it becomes an array of bytes.</p>
How to change a large section of bytes to words in IDA Pro
|ida|
<h2>With source</h2> <p>You could use something like <a href="http://research.sensepost.com/tools/mobile/xapspy">XAPSpy</a> and <a href="https://github.com/andreycha/tangerine">Tangerine</a> on Github which is updated to work with WP8. It may work without source not sure.</p> <p>XAPSpy Source: <a href="https://github...
1977
2013-05-01T16:57:56.057
<p>I'm interested in debugging and monitoring a Windows Phone 8 application for which I do not have the source code. Android and iOS can both be rooted/jailbroken, which allows me to use tools like GDB (and others) to debug and monitor a running application, but I'm not aware of anything similar for Windows Phone 8.</p...
How can I debug or monitor a Windows Phone 8 application?
|windowsphone|
<p>Although it doesn't support breakpoints, <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="nofollow noreferrer">Process Monito</a>r is an excellent tool to monitor registry access. Using Filters you can easily choose which keys you want to include, exclude, highlight etc. It also allows yo...
1979
2013-05-01T20:49:47.897
<p>I have WinDbg attached to a process I don't have the source code for. I've set a breakpoint with <code>bm ADVAPI32!_RegOpenKeyExW@20</code>. The output of dv is:</p> <pre><code>Unable to enumerate locals, HRESULT 0x80004005 Private symbols (symbols.pri) are required for locals. Type ".hh dbgerr005" for details. </c...
How do I see the parameters passed to RegOpenKeyEx, and set a conditional breakpoint?
|debugging-symbols|windbg|
<p><code>%fs:028h</code> is actually using the form <code>segment:offset</code>, which means it is reaching the memory address at offset <code>28h</code> in the segment selected by the Far Segment <code>FS</code>.</p> <p>Any memory reference has an implicit segment (most of the time, <code>CS</code> for execution, <co...
1990
2013-05-03T07:13:20.343
<p>When I disassemble a function, I encounter from time to time an expression of the form <code>%reg:value</code>. Typically, I encounter this syntax when I activate the canaries in GCC (<code>-fstack-protector</code>), as in the following example:</p> <pre><code>(gdb) disas Dump of assembler code for function foo: ...
What does %reg:value mean in ATT assembly?
|disassembly|x86|assembly|
<p>Let me summarize the links given at <a href="https://reverseengineering.stackexchange.com/a/1993/12321">https://reverseengineering.stackexchange.com/a/1993/12321</a> without going into serious disasembly analysis for now. </p> <p>When the Linux kernel + dynamic linker is going to run a binary with <code>exec</code>...
1992
2013-05-03T08:39:11.810
<p>From time to time, when disassembling x86 binaries, I stumble on reference to <code>PLT</code> and <code>GOT</code>, especially when calling procedures from a dynamic library.</p> <p>For example, when running a program in <code>gdb</code>:</p> <pre><code>(gdb) info file Symbols from "/home/user/hello". Local exec ...
What is PLT/GOT?
|x86|binary-analysis|elf|amd64|
<p>Yes, the base address of <code>libc.so.6</code> should be <code>0xb7e5c000</code> for that binary. You can verify this by catting <code>/proc/&lt;pid&gt;/maps</code> while your application is running.</p>
1994
2013-05-03T15:26:58.313
<p>I'm on a Linux machine with ASLR disabled. Running <code>ldd</code> on a binary gives me the following result :</p> <pre><code>linux-gate.so.1 =&gt; (0xb7fe1000) libc.so.6 =&gt; /lib/i386-linux-gnu/libc.so.6 (0xb7e5c000) /lib/ld-linux.so.2 (0xb7fe2000) </code></pre> <p>Does this mean that <code>libc.so.6</code> w...
Base address of shared objects from ldd output
|linux|libraries|dynamic-linking|
<p>A challenge in writing a tool to extract the control flow of python bytecode is that there are so many Python bytecodes versions to choose from, about 25 or so by now (if you include pypy variants).</p> <p>The bytecode in the example graph with its <code>JUMP_IF_FALSE</code> followed by some <code>POP_TOP</code>s a...
1999
2013-05-03T17:06:20.423
<p>Recently on <a href="http://www.reddit.com/r/ReverseEngineering" rel="noreferrer">Reddit ReverseEngineering</a> I stumbled on a <a href="http://www.reddit.com/r/ReverseEngineering/comments/1da222/selfmodifying_python_bytecode/" rel="noreferrer">self-modifying code in Python</a>. Looking at the <a href="https://githu...
What are the tools to analyze Python (obfuscated) bytecode?
|tools|python|
<p>A great resource for old tools is the <a href="http://www.sac.sk/" rel="noreferrer">SAC server</a>. From a quick search <a href="ftp://ftp.sac.sk/pub/sac/utilprog/resgrabr.exe" rel="noreferrer">Resource Grabber</a> seems to support NE resources, though the UI is annoying to use.</p> <p>Another options is <a href="h...
2000
2013-05-03T20:49:37.897
<p>I'm trying to extract menus and other stuff from a <a href="https://en.wikipedia.org/wiki/New_Executable" rel="noreferrer">New Executable (NE)</a>, i.e. the ones from Windows' 16-bit times. The tools I find (e. g. ResourceTuner) work for <a href="https://en.wikipedia.org/wiki/Portable_Executable" rel="noreferrer">PE...
How can one extract resources from a New Executable?
|tools|ne|
<p>i wrote a windows specific answer to a question that was marked as duplicate and closed and the close flag referred to this thread so i post an answer here </p> <p><strong>os win7 sp1 32 bit machine<br> kernel dump using livekd from sysinternals</strong></p> <p>a 16 bit segment register contains<br> 13 bits of se...
2006
2013-05-04T06:18:49.163
<p>I try to understand the process of memory segmentation for the i386 and amd64 architectures on Linux. It seems that this is heavily related to the segment registers <code>%fs</code>, <code>%gs</code>, <code>%cs</code>, <code>%ss</code>, <code>%ds</code>, <code>%es</code>. </p> <p>Can somebody explain how these regi...
How are the segment registers (fs, gs, cs, ss, ds, es) used in Linux?
|linux|x86|assembly|amd64|
<p>Several great answers here, and the one posted by Igor is perfect for debugging the service before it actually starts. One piece of insight I would like to contribute is looking into the malware to see if there are any threads that are created that hold the functionality you wish to review. </p> <p>Oftentimes in my...
2019
2013-05-07T21:04:43.703
<p>I'm trying to debug a malware sample that installs to a system as service and then will only start if it starts as a service. Other functions are still available without the service start, like configuring or install under a different name. </p> <p>I'm trying to catch the network communications the malware is sendi...
Debugging malware that will only run as a service
|windows|malware|debuggers|networking|
<p>All ATMs that I am aware of and have worked on in a past life have a way to get into 'admin' mode either from the front or a rear keypad. Methods vary. Sniffing a network probably won't help as the communication is encrypted. That said, buy one: <a href="http://www.atmexperts.com/used_atm_machines.html">http://www...
2023
2013-05-08T13:31:05.560
<p>This question is using ATMs as an example, but it could apply to any number of 'secure' devices such as poker machines, E-voting machines, payphones etc. </p> <p>Given that ATMs are relatively hardened (in comparison to say, most consumer electronics for example), what would be the process of reverse engineering a ...
How to reverse engineer an ATM?
|hardware|security|physical-attacks|
<p>I do not know of a disassembler that will do this, but I have written a Java decompiler that has a bytecode output mode. It is open source, and it would be easy enough to modify to suit your needs. Feel free to check it out <a href="https://bitbucket.org/mstrobel/procyon/overview" rel="nofollow">here</a>.</p>
2036
2013-05-10T23:22:18.610
<p>I am after a java bytecode disassembler whose output includes the bytecodes themselves, their operands, and their addresses in the .class file, and which displays numbers in hex, not decimal.</p> <p>To show what I mean, here are a few lines taken from the output of javap:</p> <pre><code>private java.text.SimpleDat...
Wanted: Java bytecode disassembler that shows addresses, opcodes, operands, in hex
|java|hex|disassemblers|
<p>Even stripped libraries still must retain the symbols necessary for dynamic linking. These are usually placed in a section named <code>.dynsym</code> and are also pointed to by the entries in the dynamic section.</p> <p>For example, here's the output of <code>readelf</code> on a stripped Android library:</p> <pre>...
2038
2013-05-11T10:09:14.170
<p>Lately I've been reversing the Android framework for the Nexus S mobile phone. 99% of the source code is of course open, but there are few propriety shared libraries which needs to be downloaded in order to compile the operating system. These shared libraries are stripped from symbols and suddenly I came to understa...
How are stripped shared libraries linked against?
|linux|elf|libraries|
<p>Hard to say with so little info, but I suspect that you edited the data after it has already been parsed by the game code. You probably need to intercept the moment it arrives from the remote server and change it then.</p>
2039
2013-05-11T11:16:55.810
<p>I was trying to change the values of a Flash game which loads the SWF and some JSON over a HTTPS site. So changing the values of JSON was not possible using browser cache.</p> <p>I changed the values of that JSON by editing the memory of the Adobe Flash process by loading it in <a href="http://mh-nexus.de/en/hxd/" ...
No apparent effect after editing some JSON in the memory of a Flash process
|flash|
<p>If your application is compiled to a binary you might still be able to use normal debuggers like IDA. However, Lua has its own tools for decompiling from machine code and byte code. These links should be kept up to date by the Lua community. </p> <p><strong>Lua Wiki:</strong> <a href="http://lua-users.org/wiki/LuaT...
2049
2013-05-16T16:17:12.610
<p>Since <code>Lua</code> is an interpreted/compiled language that its own compilers and isn't usually translated/compiled with a C compiler. What tools should be used to reverse engineer an application written in <code>Lua</code>?</p>
Where can I find tools for reverse engineering Lua
|disassembly|tools|decompile|byte-code|
<p>You can use <code>#pragma pack(1)</code> before the declaration.</p>
2051
2013-05-17T13:29:00.033
<p>I defined a struct in a header file, similar to this one:</p> <pre><code>struct STRUCT { char a; int b; }; </code></pre> <p>This is parsed successfully by IDA, however it adds padding bytes after the <code>char</code>:</p> <pre><code>00000000 STRUCT struc ; (sizeof=0x4) 00000000 a d...
How to prevent automatic padding by IDA?
|ida|
<p>Usually you only get addresses and raw bytes, but some tools/compilers may use custom record types or add extra information. For example, Tasking VX toolchain for Tricore uses an S0 record for identification:</p> <blockquote> <p><strong>S0-record</strong></p> <pre><code>'S' '0' &lt;length_byte&gt; &lt;2 bytes 0&...
2056
2013-05-19T06:10:18.827
<p>When working with embedded systems, it is often easiest to use a downloadable firmware file rather than recover the firmware from the device.</p> <p>Mostly these are ROM images in the form of a .bin file. Sometimes, they are Motorola SREC files (often called .s19 files or .mot files). </p> <p>These are easily conv...
Does a Motorola SREC file give me any additional information over a binary ROM image?
|firmware|embedded|
<p>BinNavi was just <a href="https://github.com/google/binnavi" rel="nofollow">released as open source</a> today by Google, so you can get it for free.</p> <p>About using it with something else than REIL, if you're fearless, you can give a try to <a href="http://radare.org" rel="nofollow">radare2</a>, since it <a href...
2058
2013-05-19T18:45:53.677
<p><a href="https://www.zynamics.com/binnavi.html" rel="nofollow noreferrer">BinNavi</a> is originally a <a href="https://www.zynamics.com/" rel="nofollow noreferrer">Zynamics</a> product. But, since the company has been bought by Google, it seems to be difficult to get the library.</p> <p>I tried to look in the <a hr...
Is BinNavi available? If not, can I get the source from anywhere?
|tools|binary-analysis|
<p>Parsing PE files correctly is hard and there are almost always ways to make tools crash or refuse to work, while the Windows loader still executes the program normally. See e.g. <a href="https://www.virusbtn.com/pdf/conference_slides/2007/CaseySheehanVB2007.pdf" rel="nofollow">Pimp My PE</a>, <a href="https://media....
2060
2013-05-19T22:33:29.790
<p>I use <a href="http://www.angusj.com/resourcehacker/" rel="nofollow">Resource Hacker</a> Application for Reverse Engineering purposes, I've cracked 3 softwares by using this software, but it doesn't grab all <code>.EXE</code>, <code>.DLL</code> files.<br> sometimes It says, This is not a valid Win32 executable file,...
Why my Resource Hacker doesn't work with some .EXE files
|windows|unpacking|executable|decompiler|
<p>Just to add to the list. SANS posted a blog about a week ago on different tools for XOR encryption. The list is very good and it provides several tools, all which are good in my opinion. </p> <p>Here is the link : <a href="http://computer-forensics.sans.org/blog/2013/05/14/tools-for-examining-xor-obfuscation-for-ma...
2062
2013-05-20T16:44:55.427
<p>I know that modern cryptographic algorithms are as close as they can to fully random data (<a href="http://en.wikipedia.org/wiki/Ciphertext_indistinguishability">ciphertext indistinguishability</a>) and that trying to detect it is quite useless. But, what can we do on weak-crypto such as <strong>xor encryption</stro...
What is the most efficient way to detect and to break xor encryption?
|cryptography|cryptanalysis|
<p>No, a debugger views code sequentially whereas a cpu may reorder code on the fly before it gets executed and even execute more than one instruction at a time. This is the case even for Simulators like Bochs. Simics on the other hand might implement something more in line with reality but I doubt it.</p> <p>Essentia...
2067
2013-05-21T21:03:33.103
<p>Instruction pipelining is used to execute instructions in a parallel fashion by dividing them into several steps .When I pause the execution in a debugger I am only able to see the location of the eip register but not the current pipeline state. Is there a way to find out ? </p>
How to view the instruction pipeline?
|machine-code|
<p>Other people have mentioned the downsides of this, but if you're still interested in this path, then <a href="https://github.com/jthuraisamy/SysWhispers2" rel="nofollow noreferrer">here's a lib</a> that converts the ntdll API names into syscalls.</p>
2070
2013-05-22T08:29:47.090
<p>I have compiled following C source code in VS2010 console project.</p> <pre><code>#include &lt;stdio.h&gt; int main(int argc, char* argv[]){ printf("hello world\n"); return 0; } </code></pre> <p>then I used <code>/MT</code> option for release mode to statically link the C-runtime library. However, as far a...
Can I statically link (not import) the Windows system DLLs?
|windows|dll|compilers|symbols|dynamic-linking|
<p>I like Robert explanation, it has a very good example, but.. I think it misses the point of which is the real purpose of this instruction. </p> <blockquote> <p>is done as a debugging aid and in some cases for exception handling</p> </blockquote> <p>Well.. not really, not only. It is part of the standard functio...
2073
2013-05-22T14:42:12.397
<p>When execution enters a new function by performing call I do often see this code template (asm list generated by Gnu Debugger when in debugging mode):</p> <pre><code>0x00401170 push %ebp 0x00401171 mov %esp,%ebp 0x00401173 pop %ebp </code></pre> <p>So what's the purpose of moving esp to ebp?</p>
What purpose of mov %esp,%ebp?
|disassembly|
<p>When loading time is involved the entry point is DllMain.<br> (Ex. COM in-process server DLL).<br> When running time is involved the entry point is DllEntryPoint.<br> (Ex. LoadLibrary get called). </p>
2079
2013-05-22T19:33:34.490
<p>I have a piece a malware to analyze. It is a DLL according to the <code>IMAGE_FILE_HEADER-&gt;Characteristics</code>. I was trying to do some dynamic analysis on it. I have done the following:</p> <ul> <li>Run it with <code>rundll32.exe</code>, by calling its exports. Nothing.</li> <li>Changed the binary's character...
Difference between DllMain and DllEntryPoint
|windows|malware|dll|
<p>You can use <a href="https://github.com/x64dbg/ScyllaHide" rel="noreferrer">ScyllaHide</a>. There are plugins for many debuggers, but it is also possible to use <code>InjectorCLI.exe</code> to inject ScyllaHide into any process. Here are the steps (for a 32 bit process, if you want a 64 bit process, replace every <c...
2082
2013-05-23T04:11:09.953
<p>Are there any good WinDbg hiding plugins like OllyDbg's? Or a plugin that's open source and still in development for this purpose?</p>
Debugger hiding plugin for WinDbg?
|debuggers|anti-debugging|windbg|
<p>Yes. </p> <ol> <li>Find the address of kernel32 using anyone of the known tricks (PEB or any other way) </li> <li>Implement a simple export section parser and find the address of <code>LoadLibrary</code> and <code>GetProcAddress</code>. </li> <li>Use those to load any other API you want.</li> </ol>
2092
2013-05-24T20:33:55.447
<p>while reading the answers to <a href="https://reverseengineering.stackexchange.com/q/2070/245">Can I statically link (not import) the Windows system DLLs?</a> I came up with another question. So: </p> <ol> <li>Is there a way to write a program that has no dependencies (nothing is statically compiled too - it has <s...
Program with no dependencies
|windows|malware|development|winapi|
<p>You can use <a href="https://github.com/radareorg/r2dec-js" rel="nofollow noreferrer">r2dec</a> plugin on <a href="https://rada.re" rel="nofollow noreferrer">radare2</a> with command <code>pdda</code></p> <pre><code>[0x08048060]&gt; pdda ; assembly | /* r2dec pseudo code output */ ...
2096
2013-05-25T19:15:24.437
<p>How could this 32-bit x86 assembly be written in C?</p> <pre><code>loc_536FB0: mov cl, [eax] cmp cl, ' ' jb short loc_536FBC cmp cl, ',' jnz short loc_536FBF loc_536FBC: mov byte ptr [eax], ' ' loc_536FBF mov cl, [eax+1] inc eax test cl, cl jnz short loc_536FB0 </code></pre> <p>I have already figured out that it...
convert this x86 ASM to C?
|assembly|x86|c|
<p>Igor is right on, here are a few additional tips I have to offer. </p> <p>Make sure when declaring variables within your structure, that you are accurately accommodating for the size of the variable. For example, is it a DWORD or some other multibyte buffer (maybe a memset/memcpy can give you a clue on its size her...
2098
2013-05-25T20:10:23.460
<p>For example, in the following disassembly:</p> <pre><code>.text:007C6834 014 mov eax, [esi+4] .text:007C6837 014 mov dword ptr [esi], offset ??_7CAvatar@@6B@ ; const CAvatar::`vftable' </code></pre> <p>How would I be able to set the type of the esi register to a struct, so t...
How do you set registers as structs within a function in IDA?
|ida|disassembly|struct|
<p>The trick is to find the object's constructor. Let's suppose the code looks like this:</p> <pre><code>a = new CFoo(); a-&gt;bar(); </code></pre> <p>The compiler (I assume MSVC, 32bits) might produce something like this:</p> <pre><code>push 12h ; size_t call ??2@YXYXY@Z ; operator new(uint) mov [ebp+var_8], eax m...
2119
2013-05-28T12:17:15.000
<p>For learning (<em>and fun</em>) I have been analyzing a text editor application using IDA Pro. While looking at the disassembly, I notice many function calls are made by explicitly calling the name of the function. For example, I notice IDA translates most function calls into the following two formats.</p> <pre><co...
What to do when IDA cannot provide a function name?
|ida|disassembly|
<p><code>ollydbg 1.10</code> automatically refreshes the memory window when protection attributes are changed if the address that is passed on to VirtualProtect lies in the first allocated page</p> <p>if subsequent page's attributes were changed using Virtualprotect ollydbg's memory window wont reflect them as it show...
2123
2013-05-28T14:52:22.493
<p>I'm looking for a way to view memory permissions on a specific section of memory using OllyDbg (technically I'm using Immunity but I'm assuming if it exists in Olly it'll be the same there).</p> <p>The program I'm looking at is calling VirtualProtect to make a block of code go RW->RWE, but the result looks like the...
Viewing memory permissions in Ollydbg for memory segments
|windows|ollydbg|