<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Haxelion</id>
	<title>YobiWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Haxelion"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Special:Contributions/Haxelion"/>
	<updated>2026-05-25T08:09:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8315</id>
		<title>Reverse-Engineering</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8315"/>
		<updated>2013-10-10T14:48:42Z</updated>

		<summary type="html">&lt;p&gt;Haxelion: /* Packers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Books=&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272890.do The IDA Pro Book, 2nd Edition by Chris Eagle]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781597492379.do Reverse Engineering Code with IDA Pro by Dan Kaminsky et al]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272906.do Practical Malware Analysis by Michael Sikorski]&lt;br /&gt;
* [http://www.amazon.com/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817 Reversing: Secrets of Reverse Engineering by Eldad Eilam]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781886411791.do Crackproof Your Software by Pavol Cerven]&lt;br /&gt;
* [http://www.amazon.com/Surreptitious-Software-Obfuscation-Watermarking-Tamperproofing/dp/0321549252 Surreptitious Software: Obfuscation, Watermarking, and Tamperproofing for Software Protection]&lt;br /&gt;
* Wikibooks [https://en.wikibooks.org/wiki/Subject:Software_reverse_engineering Subject:Software_reverse_engineering]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/X86_Disassembly X86 Disassembly]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/Reverse_Engineering Reverse Engineering]&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
* [http://reverseengineering.stackexchange.com/ Reverse-Engineering on StackExchange]&lt;br /&gt;
* [http://www.openrce.org/ OpenRCE]&lt;br /&gt;
* [http://www.hexblog.com/ Hex Blog]&lt;br /&gt;
* http://www.reverse-engineering.info&lt;br /&gt;
* [http://brundlelab.files.wordpress.com/2013/09/automating-re-with-python.pdf Automating RE with Python (slides)] by Carlos Prado&lt;br /&gt;
* [http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html Intel® 64 and IA-32 Architectures Software Developer Manuals]&lt;br /&gt;
&lt;br /&gt;
=Static Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
&#039;&#039;IDA Pro combines an interactive, programmable, multi-processor disassembler coupled to a local and remote debugger and augmented by a complete plugin programming environment.&#039;&#039;&lt;br /&gt;
* [https://www.hex-rays.com/products/ida/index.shtml Official page]&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* x86-32, x86-64, ARM and many others&lt;br /&gt;
* ELF, Java bytecode, Dalvik, ARM,...&lt;br /&gt;
* disassembler, some debugger&lt;br /&gt;
* extensible through plugins &amp;amp; python (anti-debugger, findcrypt,...)&lt;br /&gt;
** [http://thunkers.net/~deft/code/toolbag/docs.html#Installation IDA toolbag]&lt;br /&gt;
** [https://bitbucket.org/daniel_plohmann/simplifire.idascope/ IDAscope]&lt;br /&gt;
** [https://code.google.com/p/patchdiff2/ patchdiff2]&lt;br /&gt;
** [http://www.zynamics.com/bindiff.html Zynamics bindiff]&lt;br /&gt;
** [http://www.darungrim.org/ DarunGrim], another binary diff tool, opensource but discontinued?&lt;br /&gt;
** [http://www.idabook.com/x86emu/ x86emu], x86 Emulator plugin. Windows, Linux, OS X&lt;br /&gt;
** Plugin contests [https://www.hex-rays.com/contests/2012/index.shtml 2012], [https://www.hex-rays.com/contests/2011/index.shtml 2011], [https://www.hex-rays.com/contests/2010/index.shtml 2010], [https://www.hex-rays.com/contests/2009/index.shtml 2009]&lt;br /&gt;
&lt;br /&gt;
==Hex-Rays==&lt;br /&gt;
The most &amp;lt;strike&amp;gt;expensive&amp;lt;/strike&amp;gt;powerful IDA Pro plugin is the [https://www.hex-rays.com/products/decompiler/index.shtml Hex-Rays decompiler]&lt;br /&gt;
* x86 and ARM&lt;br /&gt;
* decompiler&lt;br /&gt;
Limitations specific to ARM:&lt;br /&gt;
*floating point instructions are not supported&lt;br /&gt;
*VFP/SIMD/Neon/... instructions are not supported&lt;br /&gt;
*functions having an argument that is passed partially on registers and partially on the stack are not supported (e.g. int64 passed in R3 and on the stack)&lt;br /&gt;
==[http://www.backerstreet.com/rec/rec.htm REC Studio]==&lt;br /&gt;
* x86, x64&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* HLA disassembler&lt;br /&gt;
Useful commands:&lt;br /&gt;
 help&lt;br /&gt;
 strings&lt;br /&gt;
 calltree&lt;br /&gt;
 showprocs&lt;br /&gt;
 decompile /tmp/myprog.c&lt;br /&gt;
click on a function in the &amp;quot;Project&amp;quot; function list to HLA disass it&lt;br /&gt;
&lt;br /&gt;
==[http://radare.nopcode.org/y/ Radare]==&lt;br /&gt;
The reverse engineering framework&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
===[https://code.google.com/p/distorm/ Distorm]===&lt;br /&gt;
diStorm3 is really a decomposer, which means it takes an instruction and returns a binary structure which describes it rather than static text, this is great for advanced binary code analysis&lt;br /&gt;
===[http://sourceforge.net/apps/trac/pypeelf PyPEELF]===&lt;br /&gt;
PyPEELF is a multi-platform binary editor written in Python, wxPython and BOA Constructor. It allows you to manage binary data in PE32, PE32+ (x64) and ELF binary files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF uses pefile to manage PE32 and PE32+ files and pyelf to manage ELF files. Besides, it uses winappdbg and pydasm in some others features like Task Running Viewer and Disassembling files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF was designed for Reverse Engineers who want to edit or visualize binary file data in multi-platforms. That is why PyPEELF runs under Windows and Unix/BSD operating systems&lt;br /&gt;
&lt;br /&gt;
==Poor man&#039;s tools==&lt;br /&gt;
File, -z to uncompress, -s to inspect non-files, e.g. /dev/sda1&lt;br /&gt;
 file -k [-z] [-s] mybin &lt;br /&gt;
Strings&lt;br /&gt;
 strings [-n min_length] -a -e [s|S|b|l|B|L] mybin&lt;br /&gt;
==ELF==&lt;br /&gt;
 man elf&lt;br /&gt;
===readelf===&lt;br /&gt;
 readelf -a -g -t --dyn-syms -W mybin&lt;br /&gt;
===elfedit===&lt;br /&gt;
===objdump===&lt;br /&gt;
 objdump -C -g -F -x -T --special-syms mybin&lt;br /&gt;
 objdump -d -l -r -R -S mybin&lt;br /&gt;
 objdump -D -l -r -R -S mybin&lt;br /&gt;
===nm===&lt;br /&gt;
 nm -a -C -S -s --special-syms mybin&lt;br /&gt;
===ldd===&lt;br /&gt;
Shared library dependencies:&lt;br /&gt;
 ldd -v mybin&lt;br /&gt;
&lt;br /&gt;
==PE==&lt;br /&gt;
===[https://code.google.com/p/pefile/ Pefile]===&lt;br /&gt;
A Python module to read and work with PE (Portable Executable) files, see [https://code.google.com/p/pefile/wiki/UsageExamples usage examples]&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import sys, pefile&lt;br /&gt;
pe = pefile.PE(sys.argv[1])&lt;br /&gt;
pe.dump_info()&lt;br /&gt;
open(&#039;out.txt&#039;, &#039;w&#039;).write(pe.dump_info())&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Can run under Linux&lt;br /&gt;
===PEiD===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://pe-tools.sourceforge.net/ PETools]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.angusj.com/resourcehacker/ Resource Hacker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.dependencywalker.com Dependency Walker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://wjradburn.com/software/ PEview]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.nirsoft.net DLL Export Viewer]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
&amp;lt;br&amp;gt;Under Wine, require absolute path to DLL so: click on gears, &amp;quot;load functions from the following DLL file&amp;quot;, Browse&lt;br /&gt;
===[http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html PEBrowse Pro]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.ntcore.com/exsuite.php Explorer Suite]===&lt;br /&gt;
* CFF Explorer: Allows also to modify a PE&lt;br /&gt;
* Signature Explorer&lt;br /&gt;
* PE Detective&lt;br /&gt;
* Task Explorer (32 &amp;amp; 64)&lt;br /&gt;
&lt;br /&gt;
===[http://icerbero.com/peinsider/ PE Insider]===&lt;br /&gt;
==Static protections==&lt;br /&gt;
===Packers===&lt;br /&gt;
* http://www.openrce.org/reference_library/packer_database&lt;br /&gt;
* [http://upx.sourceforge.net/ UPX]&lt;br /&gt;
 upx -d myfile&lt;br /&gt;
* [http://www.crinkler.net/ Crinkler]: some insane PE packing tool coming from the demoscene world.&lt;br /&gt;
&lt;br /&gt;
=Dynamic Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
IDA Pro has some debugging capabilities too.&lt;br /&gt;
&amp;lt;br&amp;gt;Local debugging: win32, windbg&lt;br /&gt;
Remote debugging:&lt;br /&gt;
 gdbserver --multi &amp;lt;client_ip&amp;gt;:&amp;lt;port&amp;gt; # default IDA port: 23946&lt;br /&gt;
Then on IDA: select Remote GDB debugger, paths should be paths on the gdbserver host.&lt;br /&gt;
&amp;lt;br&amp;gt;Tuning:&lt;br /&gt;
* Debugger / options / Stop on process entry point&lt;br /&gt;
* Compatible with lib preloading, cf below&lt;br /&gt;
* from 6.4, can make use of Intel PIN tools for diff debugging, see [https://www.hex-rays.com/products/ida/support/tutorials/pin/pin_tutorial.pdf tutorial (pdf)]&lt;br /&gt;
&lt;br /&gt;
== OllyDBG ==&lt;br /&gt;
&lt;br /&gt;
PE32 only dynamic disassembler and debugger: http://ollydbg.de/.&lt;br /&gt;
&lt;br /&gt;
Support sofwtare and hardware breakpoint, binary patching and repacking, symbol analysis, advanced instruction pattern search, trace with conditional breaking, etc.&lt;br /&gt;
&lt;br /&gt;
There is also a patched version with advanced python scripting ability called Immunity Debugger: http://www.immunityinc.com/products-immdbg.shtml&lt;br /&gt;
&lt;br /&gt;
==Intel PIN tools==&lt;br /&gt;
* [http://software.intel.com/en-us/articles/pintool Official page]&lt;br /&gt;
** [http://software.intel.com/sites/landingpage/pintool/docs/61206/Pin/html/ User guide]&lt;br /&gt;
* Windows, Linux, Mac OS X, Android&lt;br /&gt;
* x86-32, x86-64 (only Intel platforms obviously)&lt;br /&gt;
* binary instrumentation&lt;br /&gt;
&#039;&#039;The best way to think about Pin is as a &amp;quot;just in time&amp;quot; (JIT) compiler. The input to this compiler is not bytecode, however, but a regular executable. Pin intercepts the execution of the first instruction of the executable and generates (&amp;quot;compiles&amp;quot;) new code for the straight line code sequence starting at this instruction. It then transfers control to the generated sequence. The generated code sequence is almost identical to the original one, but Pin ensures that it regains control when a branch exits the sequence. After regaining control, Pin generates more code for the branch target and continues execution. Pin makes this efficient by keeping all of the generated code in memory so it can be reused and directly branching from one sequence to another.&#039;&#039;&lt;br /&gt;
&#039;&#039;In JIT mode, the only code ever executed is the generated code. The original code is only used for reference. When generating code, Pin gives the user an opportunity to inject their own code (instrumentation).&#039;&#039;&lt;br /&gt;
==Binary Instrumentation Framework for Android==&lt;br /&gt;
From http://mulliner.org/android/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [http://mulliner.org/android/feed/android_dbi_mulliner_breakpoint2012.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
==DroidScope==&lt;br /&gt;
From https://code.google.com/p/decaf-platform/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [https://www.usenix.org/sites/default/files/conference/protected-files/yan_usenixsecurity12_slides.pdf here] and article [https://www.usenix.org/system/files/conference/usenixsecurity12/sec12-final107.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
&lt;br /&gt;
==injectso==&lt;br /&gt;
From http://stealth.openwall.net/local/&lt;br /&gt;
* x86-32, x86-64, ARM (since v0.52)&lt;br /&gt;
==Soot==&lt;br /&gt;
From http://www.sable.mcgill.ca/soot/&lt;br /&gt;
* Java, Dalvik (see [http://www.bodden.de/2013/01/08/soot-android-instrumentation/ here] and [http://www.abartel.net/dexpler/ here])&lt;br /&gt;
&lt;br /&gt;
==[http://visi.kenshoto.com/viki/Vdb Vdb/Vtrace] / [http://visi.kenshoto.com/viki/Vivisect Vivisect]==&lt;br /&gt;
* debugger, static analysis&lt;br /&gt;
* Windows, Linux, Android&lt;br /&gt;
* Intel, ARM&lt;br /&gt;
&#039;&#039;vtrace is a cross-platform process debugging API implemented in python, and vdb is a debugger which uses it&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;vivisect is a Python based static analysis and emulation framework&#039;&#039;&lt;br /&gt;
* [https://github.com/pdasilva/vtrace_scripts vtrace script examples]&lt;br /&gt;
&lt;br /&gt;
==[http://www.cuckoosandbox.org/ Cuckoo Sandboxing]==&lt;br /&gt;
Currently only supporting Windows binaries.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;Cuckoo Sandbox is a malware analysis system. You can throw any suspicious file at it and in a matter of seconds Cuckoo will provide you back some detailed results outlining what such file did when executed inside an isolated environment.&#039;&#039;&lt;br /&gt;
&#039;&#039;Cuckoo generates a handful of different raw data which include:&#039;&#039;&lt;br /&gt;
* &#039;&#039;Native functions and Windows API calls traces&#039;&#039;&lt;br /&gt;
* &#039;&#039;Copies of files created and deleted from the filesystem&#039;&#039;&lt;br /&gt;
* &#039;&#039;Dump of the memory of the selected process&#039;&#039;&lt;br /&gt;
* &#039;&#039;Full memory dump of the analysis machine&#039;&#039;&lt;br /&gt;
* &#039;&#039;Screenshots of the desktop during the execution of the malware analysis&#039;&#039;&lt;br /&gt;
* &#039;&#039;Network dump generated by the machine used for the analysis&#039;&#039;&lt;br /&gt;
==ELF==&lt;br /&gt;
===ltrace/strace===&lt;br /&gt;
Tracing library calls and system calls.&lt;br /&gt;
&amp;lt;br&amp;gt;Getting a summary:&lt;br /&gt;
 ltrace -f -S mybin 2&amp;gt;&amp;amp;1|grep &#039;(.*)&#039;|sed &#039;s/(.*//&#039;|sort|uniq -c&lt;br /&gt;
Getting more:&lt;br /&gt;
 ltrace -f -i -S -n 4 -s 1024 mybin&lt;br /&gt;
===Lib preloading===&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#define _GNU_SOURCE&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;dlfcn.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Kill nanosleep()&lt;br /&gt;
int nanosleep(const struct timespec *req, struct timespec *rem){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own nanosleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Kill usleep()&lt;br /&gt;
int usleep(useconds_t usec){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own usleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix time()&lt;br /&gt;
time_t time(time_t *t){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own time(), will return 1380120175\n&amp;quot;);&lt;br /&gt;
    return 1380120175;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix srand()&lt;br /&gt;
void srand(unsigned int seed){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own srand(), will do srand(0)\n&amp;quot;);&lt;br /&gt;
    void (*original_srand)(unsigned int seed);&lt;br /&gt;
    original_srand = dlsym(RTLD_NEXT, &amp;quot;srand&amp;quot;);&lt;br /&gt;
    unsigned int myseed = 0;&lt;br /&gt;
    return (*original_srand)(myseed);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#if 0&lt;br /&gt;
// Kill rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return 0\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
#else&lt;br /&gt;
// Intercept rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    int (*original_rand)(void);&lt;br /&gt;
    original_rand = dlsym(RTLD_NEXT, &amp;quot;rand&amp;quot;);&lt;br /&gt;
    int r = (*original_rand)();&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return %04X\n&amp;quot;, r);&lt;br /&gt;
    return r;&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 gcc -fPIC -shared -Wl,-soname,patch -o patch.so patch.c -ldl&lt;br /&gt;
 export LD_PRELOAD=patch.so&lt;br /&gt;
 export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH&lt;br /&gt;
==PE==&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896645 Process Monitor]===&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896653 Process Explorer]===&lt;br /&gt;
===[http://sourceforge.net/projects/regshot/ RegShot]===&lt;br /&gt;
Computes diff between two registry snapshots&lt;br /&gt;
===[http://www.nirsoft.net HeapMemView]===&lt;br /&gt;
===[http://winappdbg.sourceforge.net/ WinAppDbg]===&lt;br /&gt;
The WinAppDbg python module allows developers to quickly code instrumentation scripts in Python under a Windows environment.&lt;br /&gt;
====[https://brundlelab.wordpress.com/2012/08/19/small-and-cute-execution-tracer/ Tracer.py]====&lt;br /&gt;
Based on WinAppDbg, finds interesting bits in trace by dichotomy signal/noise&lt;br /&gt;
* run first time and try everything but not the interesting stuff -&amp;gt; use noise option&lt;br /&gt;
* then run again and try interesting stuff -&amp;gt; use signal option&lt;br /&gt;
&lt;br /&gt;
====[https://github.com/carlosgprado/Python-to-the-rescue/blob/master/WTFDLL.py WTFDLL.py]====&lt;br /&gt;
Find libraries loaded at runtime and the functions called&lt;br /&gt;
==Dynamic protections==&lt;br /&gt;
* http://www.openrce.org/reference_library/anti_reversing&lt;/div&gt;</summary>
		<author><name>Haxelion</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8314</id>
		<title>Reverse-Engineering</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8314"/>
		<updated>2013-10-10T14:46:44Z</updated>

		<summary type="html">&lt;p&gt;Haxelion: /* OllyDBG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Books=&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272890.do The IDA Pro Book, 2nd Edition by Chris Eagle]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781597492379.do Reverse Engineering Code with IDA Pro by Dan Kaminsky et al]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272906.do Practical Malware Analysis by Michael Sikorski]&lt;br /&gt;
* [http://www.amazon.com/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817 Reversing: Secrets of Reverse Engineering by Eldad Eilam]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781886411791.do Crackproof Your Software by Pavol Cerven]&lt;br /&gt;
* [http://www.amazon.com/Surreptitious-Software-Obfuscation-Watermarking-Tamperproofing/dp/0321549252 Surreptitious Software: Obfuscation, Watermarking, and Tamperproofing for Software Protection]&lt;br /&gt;
* Wikibooks [https://en.wikibooks.org/wiki/Subject:Software_reverse_engineering Subject:Software_reverse_engineering]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/X86_Disassembly X86 Disassembly]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/Reverse_Engineering Reverse Engineering]&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
* [http://reverseengineering.stackexchange.com/ Reverse-Engineering on StackExchange]&lt;br /&gt;
* [http://www.openrce.org/ OpenRCE]&lt;br /&gt;
* [http://www.hexblog.com/ Hex Blog]&lt;br /&gt;
* http://www.reverse-engineering.info&lt;br /&gt;
* [http://brundlelab.files.wordpress.com/2013/09/automating-re-with-python.pdf Automating RE with Python (slides)] by Carlos Prado&lt;br /&gt;
* [http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html Intel® 64 and IA-32 Architectures Software Developer Manuals]&lt;br /&gt;
&lt;br /&gt;
=Static Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
&#039;&#039;IDA Pro combines an interactive, programmable, multi-processor disassembler coupled to a local and remote debugger and augmented by a complete plugin programming environment.&#039;&#039;&lt;br /&gt;
* [https://www.hex-rays.com/products/ida/index.shtml Official page]&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* x86-32, x86-64, ARM and many others&lt;br /&gt;
* ELF, Java bytecode, Dalvik, ARM,...&lt;br /&gt;
* disassembler, some debugger&lt;br /&gt;
* extensible through plugins &amp;amp; python (anti-debugger, findcrypt,...)&lt;br /&gt;
** [http://thunkers.net/~deft/code/toolbag/docs.html#Installation IDA toolbag]&lt;br /&gt;
** [https://bitbucket.org/daniel_plohmann/simplifire.idascope/ IDAscope]&lt;br /&gt;
** [https://code.google.com/p/patchdiff2/ patchdiff2]&lt;br /&gt;
** [http://www.zynamics.com/bindiff.html Zynamics bindiff]&lt;br /&gt;
** [http://www.darungrim.org/ DarunGrim], another binary diff tool, opensource but discontinued?&lt;br /&gt;
** [http://www.idabook.com/x86emu/ x86emu], x86 Emulator plugin. Windows, Linux, OS X&lt;br /&gt;
** Plugin contests [https://www.hex-rays.com/contests/2012/index.shtml 2012], [https://www.hex-rays.com/contests/2011/index.shtml 2011], [https://www.hex-rays.com/contests/2010/index.shtml 2010], [https://www.hex-rays.com/contests/2009/index.shtml 2009]&lt;br /&gt;
&lt;br /&gt;
==Hex-Rays==&lt;br /&gt;
The most &amp;lt;strike&amp;gt;expensive&amp;lt;/strike&amp;gt;powerful IDA Pro plugin is the [https://www.hex-rays.com/products/decompiler/index.shtml Hex-Rays decompiler]&lt;br /&gt;
* x86 and ARM&lt;br /&gt;
* decompiler&lt;br /&gt;
Limitations specific to ARM:&lt;br /&gt;
*floating point instructions are not supported&lt;br /&gt;
*VFP/SIMD/Neon/... instructions are not supported&lt;br /&gt;
*functions having an argument that is passed partially on registers and partially on the stack are not supported (e.g. int64 passed in R3 and on the stack)&lt;br /&gt;
==[http://www.backerstreet.com/rec/rec.htm REC Studio]==&lt;br /&gt;
* x86, x64&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* HLA disassembler&lt;br /&gt;
Useful commands:&lt;br /&gt;
 help&lt;br /&gt;
 strings&lt;br /&gt;
 calltree&lt;br /&gt;
 showprocs&lt;br /&gt;
 decompile /tmp/myprog.c&lt;br /&gt;
click on a function in the &amp;quot;Project&amp;quot; function list to HLA disass it&lt;br /&gt;
&lt;br /&gt;
==[http://radare.nopcode.org/y/ Radare]==&lt;br /&gt;
The reverse engineering framework&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
===[https://code.google.com/p/distorm/ Distorm]===&lt;br /&gt;
diStorm3 is really a decomposer, which means it takes an instruction and returns a binary structure which describes it rather than static text, this is great for advanced binary code analysis&lt;br /&gt;
===[http://sourceforge.net/apps/trac/pypeelf PyPEELF]===&lt;br /&gt;
PyPEELF is a multi-platform binary editor written in Python, wxPython and BOA Constructor. It allows you to manage binary data in PE32, PE32+ (x64) and ELF binary files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF uses pefile to manage PE32 and PE32+ files and pyelf to manage ELF files. Besides, it uses winappdbg and pydasm in some others features like Task Running Viewer and Disassembling files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF was designed for Reverse Engineers who want to edit or visualize binary file data in multi-platforms. That is why PyPEELF runs under Windows and Unix/BSD operating systems&lt;br /&gt;
&lt;br /&gt;
==Poor man&#039;s tools==&lt;br /&gt;
File, -z to uncompress, -s to inspect non-files, e.g. /dev/sda1&lt;br /&gt;
 file -k [-z] [-s] mybin &lt;br /&gt;
Strings&lt;br /&gt;
 strings [-n min_length] -a -e [s|S|b|l|B|L] mybin&lt;br /&gt;
==ELF==&lt;br /&gt;
 man elf&lt;br /&gt;
===readelf===&lt;br /&gt;
 readelf -a -g -t --dyn-syms -W mybin&lt;br /&gt;
===elfedit===&lt;br /&gt;
===objdump===&lt;br /&gt;
 objdump -C -g -F -x -T --special-syms mybin&lt;br /&gt;
 objdump -d -l -r -R -S mybin&lt;br /&gt;
 objdump -D -l -r -R -S mybin&lt;br /&gt;
===nm===&lt;br /&gt;
 nm -a -C -S -s --special-syms mybin&lt;br /&gt;
===ldd===&lt;br /&gt;
Shared library dependencies:&lt;br /&gt;
 ldd -v mybin&lt;br /&gt;
&lt;br /&gt;
==PE==&lt;br /&gt;
===[https://code.google.com/p/pefile/ Pefile]===&lt;br /&gt;
A Python module to read and work with PE (Portable Executable) files, see [https://code.google.com/p/pefile/wiki/UsageExamples usage examples]&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import sys, pefile&lt;br /&gt;
pe = pefile.PE(sys.argv[1])&lt;br /&gt;
pe.dump_info()&lt;br /&gt;
open(&#039;out.txt&#039;, &#039;w&#039;).write(pe.dump_info())&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Can run under Linux&lt;br /&gt;
===PEiD===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://pe-tools.sourceforge.net/ PETools]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.angusj.com/resourcehacker/ Resource Hacker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.dependencywalker.com Dependency Walker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://wjradburn.com/software/ PEview]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.nirsoft.net DLL Export Viewer]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
&amp;lt;br&amp;gt;Under Wine, require absolute path to DLL so: click on gears, &amp;quot;load functions from the following DLL file&amp;quot;, Browse&lt;br /&gt;
===[http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html PEBrowse Pro]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.ntcore.com/exsuite.php Explorer Suite]===&lt;br /&gt;
* CFF Explorer: Allows also to modify a PE&lt;br /&gt;
* Signature Explorer&lt;br /&gt;
* PE Detective&lt;br /&gt;
* Task Explorer (32 &amp;amp; 64)&lt;br /&gt;
&lt;br /&gt;
===[http://icerbero.com/peinsider/ PE Insider]===&lt;br /&gt;
==Static protections==&lt;br /&gt;
===Packers===&lt;br /&gt;
* http://www.openrce.org/reference_library/packer_database&lt;br /&gt;
* [http://upx.sourceforge.net/ UPX]&lt;br /&gt;
 upx -d myfile&lt;br /&gt;
&lt;br /&gt;
=Dynamic Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
IDA Pro has some debugging capabilities too.&lt;br /&gt;
&amp;lt;br&amp;gt;Local debugging: win32, windbg&lt;br /&gt;
Remote debugging:&lt;br /&gt;
 gdbserver --multi &amp;lt;client_ip&amp;gt;:&amp;lt;port&amp;gt; # default IDA port: 23946&lt;br /&gt;
Then on IDA: select Remote GDB debugger, paths should be paths on the gdbserver host.&lt;br /&gt;
&amp;lt;br&amp;gt;Tuning:&lt;br /&gt;
* Debugger / options / Stop on process entry point&lt;br /&gt;
* Compatible with lib preloading, cf below&lt;br /&gt;
* from 6.4, can make use of Intel PIN tools for diff debugging, see [https://www.hex-rays.com/products/ida/support/tutorials/pin/pin_tutorial.pdf tutorial (pdf)]&lt;br /&gt;
&lt;br /&gt;
== OllyDBG ==&lt;br /&gt;
&lt;br /&gt;
PE32 only dynamic disassembler and debugger: http://ollydbg.de/.&lt;br /&gt;
&lt;br /&gt;
Support sofwtare and hardware breakpoint, binary patching and repacking, symbol analysis, advanced instruction pattern search, trace with conditional breaking, etc.&lt;br /&gt;
&lt;br /&gt;
There is also a patched version with advanced python scripting ability called Immunity Debugger: http://www.immunityinc.com/products-immdbg.shtml&lt;br /&gt;
&lt;br /&gt;
==Intel PIN tools==&lt;br /&gt;
* [http://software.intel.com/en-us/articles/pintool Official page]&lt;br /&gt;
** [http://software.intel.com/sites/landingpage/pintool/docs/61206/Pin/html/ User guide]&lt;br /&gt;
* Windows, Linux, Mac OS X, Android&lt;br /&gt;
* x86-32, x86-64 (only Intel platforms obviously)&lt;br /&gt;
* binary instrumentation&lt;br /&gt;
&#039;&#039;The best way to think about Pin is as a &amp;quot;just in time&amp;quot; (JIT) compiler. The input to this compiler is not bytecode, however, but a regular executable. Pin intercepts the execution of the first instruction of the executable and generates (&amp;quot;compiles&amp;quot;) new code for the straight line code sequence starting at this instruction. It then transfers control to the generated sequence. The generated code sequence is almost identical to the original one, but Pin ensures that it regains control when a branch exits the sequence. After regaining control, Pin generates more code for the branch target and continues execution. Pin makes this efficient by keeping all of the generated code in memory so it can be reused and directly branching from one sequence to another.&#039;&#039;&lt;br /&gt;
&#039;&#039;In JIT mode, the only code ever executed is the generated code. The original code is only used for reference. When generating code, Pin gives the user an opportunity to inject their own code (instrumentation).&#039;&#039;&lt;br /&gt;
==Binary Instrumentation Framework for Android==&lt;br /&gt;
From http://mulliner.org/android/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [http://mulliner.org/android/feed/android_dbi_mulliner_breakpoint2012.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
==DroidScope==&lt;br /&gt;
From https://code.google.com/p/decaf-platform/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [https://www.usenix.org/sites/default/files/conference/protected-files/yan_usenixsecurity12_slides.pdf here] and article [https://www.usenix.org/system/files/conference/usenixsecurity12/sec12-final107.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
&lt;br /&gt;
==injectso==&lt;br /&gt;
From http://stealth.openwall.net/local/&lt;br /&gt;
* x86-32, x86-64, ARM (since v0.52)&lt;br /&gt;
==Soot==&lt;br /&gt;
From http://www.sable.mcgill.ca/soot/&lt;br /&gt;
* Java, Dalvik (see [http://www.bodden.de/2013/01/08/soot-android-instrumentation/ here] and [http://www.abartel.net/dexpler/ here])&lt;br /&gt;
&lt;br /&gt;
==[http://visi.kenshoto.com/viki/Vdb Vdb/Vtrace] / [http://visi.kenshoto.com/viki/Vivisect Vivisect]==&lt;br /&gt;
* debugger, static analysis&lt;br /&gt;
* Windows, Linux, Android&lt;br /&gt;
* Intel, ARM&lt;br /&gt;
&#039;&#039;vtrace is a cross-platform process debugging API implemented in python, and vdb is a debugger which uses it&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;vivisect is a Python based static analysis and emulation framework&#039;&#039;&lt;br /&gt;
* [https://github.com/pdasilva/vtrace_scripts vtrace script examples]&lt;br /&gt;
&lt;br /&gt;
==[http://www.cuckoosandbox.org/ Cuckoo Sandboxing]==&lt;br /&gt;
Currently only supporting Windows binaries.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;Cuckoo Sandbox is a malware analysis system. You can throw any suspicious file at it and in a matter of seconds Cuckoo will provide you back some detailed results outlining what such file did when executed inside an isolated environment.&#039;&#039;&lt;br /&gt;
&#039;&#039;Cuckoo generates a handful of different raw data which include:&#039;&#039;&lt;br /&gt;
* &#039;&#039;Native functions and Windows API calls traces&#039;&#039;&lt;br /&gt;
* &#039;&#039;Copies of files created and deleted from the filesystem&#039;&#039;&lt;br /&gt;
* &#039;&#039;Dump of the memory of the selected process&#039;&#039;&lt;br /&gt;
* &#039;&#039;Full memory dump of the analysis machine&#039;&#039;&lt;br /&gt;
* &#039;&#039;Screenshots of the desktop during the execution of the malware analysis&#039;&#039;&lt;br /&gt;
* &#039;&#039;Network dump generated by the machine used for the analysis&#039;&#039;&lt;br /&gt;
==ELF==&lt;br /&gt;
===ltrace/strace===&lt;br /&gt;
Tracing library calls and system calls.&lt;br /&gt;
&amp;lt;br&amp;gt;Getting a summary:&lt;br /&gt;
 ltrace -f -S mybin 2&amp;gt;&amp;amp;1|grep &#039;(.*)&#039;|sed &#039;s/(.*//&#039;|sort|uniq -c&lt;br /&gt;
Getting more:&lt;br /&gt;
 ltrace -f -i -S -n 4 -s 1024 mybin&lt;br /&gt;
===Lib preloading===&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#define _GNU_SOURCE&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;dlfcn.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Kill nanosleep()&lt;br /&gt;
int nanosleep(const struct timespec *req, struct timespec *rem){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own nanosleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Kill usleep()&lt;br /&gt;
int usleep(useconds_t usec){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own usleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix time()&lt;br /&gt;
time_t time(time_t *t){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own time(), will return 1380120175\n&amp;quot;);&lt;br /&gt;
    return 1380120175;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix srand()&lt;br /&gt;
void srand(unsigned int seed){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own srand(), will do srand(0)\n&amp;quot;);&lt;br /&gt;
    void (*original_srand)(unsigned int seed);&lt;br /&gt;
    original_srand = dlsym(RTLD_NEXT, &amp;quot;srand&amp;quot;);&lt;br /&gt;
    unsigned int myseed = 0;&lt;br /&gt;
    return (*original_srand)(myseed);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#if 0&lt;br /&gt;
// Kill rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return 0\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
#else&lt;br /&gt;
// Intercept rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    int (*original_rand)(void);&lt;br /&gt;
    original_rand = dlsym(RTLD_NEXT, &amp;quot;rand&amp;quot;);&lt;br /&gt;
    int r = (*original_rand)();&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return %04X\n&amp;quot;, r);&lt;br /&gt;
    return r;&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 gcc -fPIC -shared -Wl,-soname,patch -o patch.so patch.c -ldl&lt;br /&gt;
 export LD_PRELOAD=patch.so&lt;br /&gt;
 export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH&lt;br /&gt;
==PE==&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896645 Process Monitor]===&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896653 Process Explorer]===&lt;br /&gt;
===[http://sourceforge.net/projects/regshot/ RegShot]===&lt;br /&gt;
Computes diff between two registry snapshots&lt;br /&gt;
===[http://www.nirsoft.net HeapMemView]===&lt;br /&gt;
===[http://winappdbg.sourceforge.net/ WinAppDbg]===&lt;br /&gt;
The WinAppDbg python module allows developers to quickly code instrumentation scripts in Python under a Windows environment.&lt;br /&gt;
====[https://brundlelab.wordpress.com/2012/08/19/small-and-cute-execution-tracer/ Tracer.py]====&lt;br /&gt;
Based on WinAppDbg, finds interesting bits in trace by dichotomy signal/noise&lt;br /&gt;
* run first time and try everything but not the interesting stuff -&amp;gt; use noise option&lt;br /&gt;
* then run again and try interesting stuff -&amp;gt; use signal option&lt;br /&gt;
&lt;br /&gt;
====[https://github.com/carlosgprado/Python-to-the-rescue/blob/master/WTFDLL.py WTFDLL.py]====&lt;br /&gt;
Find libraries loaded at runtime and the functions called&lt;br /&gt;
==Dynamic protections==&lt;br /&gt;
* http://www.openrce.org/reference_library/anti_reversing&lt;/div&gt;</summary>
		<author><name>Haxelion</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8313</id>
		<title>Reverse-Engineering</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Reverse-Engineering&amp;diff=8313"/>
		<updated>2013-10-10T14:45:53Z</updated>

		<summary type="html">&lt;p&gt;Haxelion: /* Dynamic Analysis Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Books=&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272890.do The IDA Pro Book, 2nd Edition by Chris Eagle]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781597492379.do Reverse Engineering Code with IDA Pro by Dan Kaminsky et al]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781593272906.do Practical Malware Analysis by Michael Sikorski]&lt;br /&gt;
* [http://www.amazon.com/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817 Reversing: Secrets of Reverse Engineering by Eldad Eilam]&lt;br /&gt;
* [http://shop.oreilly.com/product/9781886411791.do Crackproof Your Software by Pavol Cerven]&lt;br /&gt;
* [http://www.amazon.com/Surreptitious-Software-Obfuscation-Watermarking-Tamperproofing/dp/0321549252 Surreptitious Software: Obfuscation, Watermarking, and Tamperproofing for Software Protection]&lt;br /&gt;
* Wikibooks [https://en.wikibooks.org/wiki/Subject:Software_reverse_engineering Subject:Software_reverse_engineering]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/X86_Disassembly X86 Disassembly]&lt;br /&gt;
** [https://en.wikibooks.org/wiki/Reverse_Engineering Reverse Engineering]&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
* [http://reverseengineering.stackexchange.com/ Reverse-Engineering on StackExchange]&lt;br /&gt;
* [http://www.openrce.org/ OpenRCE]&lt;br /&gt;
* [http://www.hexblog.com/ Hex Blog]&lt;br /&gt;
* http://www.reverse-engineering.info&lt;br /&gt;
* [http://brundlelab.files.wordpress.com/2013/09/automating-re-with-python.pdf Automating RE with Python (slides)] by Carlos Prado&lt;br /&gt;
* [http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html Intel® 64 and IA-32 Architectures Software Developer Manuals]&lt;br /&gt;
&lt;br /&gt;
=Static Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
&#039;&#039;IDA Pro combines an interactive, programmable, multi-processor disassembler coupled to a local and remote debugger and augmented by a complete plugin programming environment.&#039;&#039;&lt;br /&gt;
* [https://www.hex-rays.com/products/ida/index.shtml Official page]&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* x86-32, x86-64, ARM and many others&lt;br /&gt;
* ELF, Java bytecode, Dalvik, ARM,...&lt;br /&gt;
* disassembler, some debugger&lt;br /&gt;
* extensible through plugins &amp;amp; python (anti-debugger, findcrypt,...)&lt;br /&gt;
** [http://thunkers.net/~deft/code/toolbag/docs.html#Installation IDA toolbag]&lt;br /&gt;
** [https://bitbucket.org/daniel_plohmann/simplifire.idascope/ IDAscope]&lt;br /&gt;
** [https://code.google.com/p/patchdiff2/ patchdiff2]&lt;br /&gt;
** [http://www.zynamics.com/bindiff.html Zynamics bindiff]&lt;br /&gt;
** [http://www.darungrim.org/ DarunGrim], another binary diff tool, opensource but discontinued?&lt;br /&gt;
** [http://www.idabook.com/x86emu/ x86emu], x86 Emulator plugin. Windows, Linux, OS X&lt;br /&gt;
** Plugin contests [https://www.hex-rays.com/contests/2012/index.shtml 2012], [https://www.hex-rays.com/contests/2011/index.shtml 2011], [https://www.hex-rays.com/contests/2010/index.shtml 2010], [https://www.hex-rays.com/contests/2009/index.shtml 2009]&lt;br /&gt;
&lt;br /&gt;
==Hex-Rays==&lt;br /&gt;
The most &amp;lt;strike&amp;gt;expensive&amp;lt;/strike&amp;gt;powerful IDA Pro plugin is the [https://www.hex-rays.com/products/decompiler/index.shtml Hex-Rays decompiler]&lt;br /&gt;
* x86 and ARM&lt;br /&gt;
* decompiler&lt;br /&gt;
Limitations specific to ARM:&lt;br /&gt;
*floating point instructions are not supported&lt;br /&gt;
*VFP/SIMD/Neon/... instructions are not supported&lt;br /&gt;
*functions having an argument that is passed partially on registers and partially on the stack are not supported (e.g. int64 passed in R3 and on the stack)&lt;br /&gt;
==[http://www.backerstreet.com/rec/rec.htm REC Studio]==&lt;br /&gt;
* x86, x64&lt;br /&gt;
* Windows, Linux, Mac OS X&lt;br /&gt;
* HLA disassembler&lt;br /&gt;
Useful commands:&lt;br /&gt;
 help&lt;br /&gt;
 strings&lt;br /&gt;
 calltree&lt;br /&gt;
 showprocs&lt;br /&gt;
 decompile /tmp/myprog.c&lt;br /&gt;
click on a function in the &amp;quot;Project&amp;quot; function list to HLA disass it&lt;br /&gt;
&lt;br /&gt;
==[http://radare.nopcode.org/y/ Radare]==&lt;br /&gt;
The reverse engineering framework&lt;br /&gt;
&lt;br /&gt;
==Misc==&lt;br /&gt;
===[https://code.google.com/p/distorm/ Distorm]===&lt;br /&gt;
diStorm3 is really a decomposer, which means it takes an instruction and returns a binary structure which describes it rather than static text, this is great for advanced binary code analysis&lt;br /&gt;
===[http://sourceforge.net/apps/trac/pypeelf PyPEELF]===&lt;br /&gt;
PyPEELF is a multi-platform binary editor written in Python, wxPython and BOA Constructor. It allows you to manage binary data in PE32, PE32+ (x64) and ELF binary files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF uses pefile to manage PE32 and PE32+ files and pyelf to manage ELF files. Besides, it uses winappdbg and pydasm in some others features like Task Running Viewer and Disassembling files.&lt;br /&gt;
&lt;br /&gt;
PyPEELF was designed for Reverse Engineers who want to edit or visualize binary file data in multi-platforms. That is why PyPEELF runs under Windows and Unix/BSD operating systems&lt;br /&gt;
&lt;br /&gt;
==Poor man&#039;s tools==&lt;br /&gt;
File, -z to uncompress, -s to inspect non-files, e.g. /dev/sda1&lt;br /&gt;
 file -k [-z] [-s] mybin &lt;br /&gt;
Strings&lt;br /&gt;
 strings [-n min_length] -a -e [s|S|b|l|B|L] mybin&lt;br /&gt;
==ELF==&lt;br /&gt;
 man elf&lt;br /&gt;
===readelf===&lt;br /&gt;
 readelf -a -g -t --dyn-syms -W mybin&lt;br /&gt;
===elfedit===&lt;br /&gt;
===objdump===&lt;br /&gt;
 objdump -C -g -F -x -T --special-syms mybin&lt;br /&gt;
 objdump -d -l -r -R -S mybin&lt;br /&gt;
 objdump -D -l -r -R -S mybin&lt;br /&gt;
===nm===&lt;br /&gt;
 nm -a -C -S -s --special-syms mybin&lt;br /&gt;
===ldd===&lt;br /&gt;
Shared library dependencies:&lt;br /&gt;
 ldd -v mybin&lt;br /&gt;
&lt;br /&gt;
==PE==&lt;br /&gt;
===[https://code.google.com/p/pefile/ Pefile]===&lt;br /&gt;
A Python module to read and work with PE (Portable Executable) files, see [https://code.google.com/p/pefile/wiki/UsageExamples usage examples]&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import sys, pefile&lt;br /&gt;
pe = pefile.PE(sys.argv[1])&lt;br /&gt;
pe.dump_info()&lt;br /&gt;
open(&#039;out.txt&#039;, &#039;w&#039;).write(pe.dump_info())&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Can run under Linux&lt;br /&gt;
===PEiD===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://pe-tools.sourceforge.net/ PETools]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.angusj.com/resourcehacker/ Resource Hacker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.dependencywalker.com Dependency Walker]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://wjradburn.com/software/ PEview]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.nirsoft.net DLL Export Viewer]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
&amp;lt;br&amp;gt;Under Wine, require absolute path to DLL so: click on gears, &amp;quot;load functions from the following DLL file&amp;quot;, Browse&lt;br /&gt;
===[http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html PEBrowse Pro]===&lt;br /&gt;
Can run with Wine&lt;br /&gt;
===[http://www.ntcore.com/exsuite.php Explorer Suite]===&lt;br /&gt;
* CFF Explorer: Allows also to modify a PE&lt;br /&gt;
* Signature Explorer&lt;br /&gt;
* PE Detective&lt;br /&gt;
* Task Explorer (32 &amp;amp; 64)&lt;br /&gt;
&lt;br /&gt;
===[http://icerbero.com/peinsider/ PE Insider]===&lt;br /&gt;
==Static protections==&lt;br /&gt;
===Packers===&lt;br /&gt;
* http://www.openrce.org/reference_library/packer_database&lt;br /&gt;
* [http://upx.sourceforge.net/ UPX]&lt;br /&gt;
 upx -d myfile&lt;br /&gt;
&lt;br /&gt;
=Dynamic Analysis Tools=&lt;br /&gt;
==IDA Pro==&lt;br /&gt;
IDA Pro has some debugging capabilities too.&lt;br /&gt;
&amp;lt;br&amp;gt;Local debugging: win32, windbg&lt;br /&gt;
Remote debugging:&lt;br /&gt;
 gdbserver --multi &amp;lt;client_ip&amp;gt;:&amp;lt;port&amp;gt; # default IDA port: 23946&lt;br /&gt;
Then on IDA: select Remote GDB debugger, paths should be paths on the gdbserver host.&lt;br /&gt;
&amp;lt;br&amp;gt;Tuning:&lt;br /&gt;
* Debugger / options / Stop on process entry point&lt;br /&gt;
* Compatible with lib preloading, cf below&lt;br /&gt;
* from 6.4, can make use of Intel PIN tools for diff debugging, see [https://www.hex-rays.com/products/ida/support/tutorials/pin/pin_tutorial.pdf tutorial (pdf)]&lt;br /&gt;
&lt;br /&gt;
== OllyDBG ==&lt;br /&gt;
&lt;br /&gt;
PE32 only dynamic disassembler and debugger: [http://ollydbg.de/].&lt;br /&gt;
&lt;br /&gt;
Support sofwtare and hardware breakpoint, binary patching and repacking, symbol analysis, advanced instruction pattern search, trace with conditional breaking, etc.&lt;br /&gt;
&lt;br /&gt;
There is also a patched version with advanced python scripting ability called Immunity Debugger: [http://www.immunityinc.com/products-immdbg.shtml]&lt;br /&gt;
&lt;br /&gt;
==Intel PIN tools==&lt;br /&gt;
* [http://software.intel.com/en-us/articles/pintool Official page]&lt;br /&gt;
** [http://software.intel.com/sites/landingpage/pintool/docs/61206/Pin/html/ User guide]&lt;br /&gt;
* Windows, Linux, Mac OS X, Android&lt;br /&gt;
* x86-32, x86-64 (only Intel platforms obviously)&lt;br /&gt;
* binary instrumentation&lt;br /&gt;
&#039;&#039;The best way to think about Pin is as a &amp;quot;just in time&amp;quot; (JIT) compiler. The input to this compiler is not bytecode, however, but a regular executable. Pin intercepts the execution of the first instruction of the executable and generates (&amp;quot;compiles&amp;quot;) new code for the straight line code sequence starting at this instruction. It then transfers control to the generated sequence. The generated code sequence is almost identical to the original one, but Pin ensures that it regains control when a branch exits the sequence. After regaining control, Pin generates more code for the branch target and continues execution. Pin makes this efficient by keeping all of the generated code in memory so it can be reused and directly branching from one sequence to another.&#039;&#039;&lt;br /&gt;
&#039;&#039;In JIT mode, the only code ever executed is the generated code. The original code is only used for reference. When generating code, Pin gives the user an opportunity to inject their own code (instrumentation).&#039;&#039;&lt;br /&gt;
==Binary Instrumentation Framework for Android==&lt;br /&gt;
From http://mulliner.org/android/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [http://mulliner.org/android/feed/android_dbi_mulliner_breakpoint2012.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
==DroidScope==&lt;br /&gt;
From https://code.google.com/p/decaf-platform/&lt;br /&gt;
&amp;lt;br&amp;gt;Slides [https://www.usenix.org/sites/default/files/conference/protected-files/yan_usenixsecurity12_slides.pdf here] and article [https://www.usenix.org/system/files/conference/usenixsecurity12/sec12-final107.pdf here]&lt;br /&gt;
* ARM&lt;br /&gt;
&lt;br /&gt;
==injectso==&lt;br /&gt;
From http://stealth.openwall.net/local/&lt;br /&gt;
* x86-32, x86-64, ARM (since v0.52)&lt;br /&gt;
==Soot==&lt;br /&gt;
From http://www.sable.mcgill.ca/soot/&lt;br /&gt;
* Java, Dalvik (see [http://www.bodden.de/2013/01/08/soot-android-instrumentation/ here] and [http://www.abartel.net/dexpler/ here])&lt;br /&gt;
&lt;br /&gt;
==[http://visi.kenshoto.com/viki/Vdb Vdb/Vtrace] / [http://visi.kenshoto.com/viki/Vivisect Vivisect]==&lt;br /&gt;
* debugger, static analysis&lt;br /&gt;
* Windows, Linux, Android&lt;br /&gt;
* Intel, ARM&lt;br /&gt;
&#039;&#039;vtrace is a cross-platform process debugging API implemented in python, and vdb is a debugger which uses it&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;vivisect is a Python based static analysis and emulation framework&#039;&#039;&lt;br /&gt;
* [https://github.com/pdasilva/vtrace_scripts vtrace script examples]&lt;br /&gt;
&lt;br /&gt;
==[http://www.cuckoosandbox.org/ Cuckoo Sandboxing]==&lt;br /&gt;
Currently only supporting Windows binaries.&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;Cuckoo Sandbox is a malware analysis system. You can throw any suspicious file at it and in a matter of seconds Cuckoo will provide you back some detailed results outlining what such file did when executed inside an isolated environment.&#039;&#039;&lt;br /&gt;
&#039;&#039;Cuckoo generates a handful of different raw data which include:&#039;&#039;&lt;br /&gt;
* &#039;&#039;Native functions and Windows API calls traces&#039;&#039;&lt;br /&gt;
* &#039;&#039;Copies of files created and deleted from the filesystem&#039;&#039;&lt;br /&gt;
* &#039;&#039;Dump of the memory of the selected process&#039;&#039;&lt;br /&gt;
* &#039;&#039;Full memory dump of the analysis machine&#039;&#039;&lt;br /&gt;
* &#039;&#039;Screenshots of the desktop during the execution of the malware analysis&#039;&#039;&lt;br /&gt;
* &#039;&#039;Network dump generated by the machine used for the analysis&#039;&#039;&lt;br /&gt;
==ELF==&lt;br /&gt;
===ltrace/strace===&lt;br /&gt;
Tracing library calls and system calls.&lt;br /&gt;
&amp;lt;br&amp;gt;Getting a summary:&lt;br /&gt;
 ltrace -f -S mybin 2&amp;gt;&amp;amp;1|grep &#039;(.*)&#039;|sed &#039;s/(.*//&#039;|sort|uniq -c&lt;br /&gt;
Getting more:&lt;br /&gt;
 ltrace -f -i -S -n 4 -s 1024 mybin&lt;br /&gt;
===Lib preloading===&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
#define _GNU_SOURCE&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;dlfcn.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Kill nanosleep()&lt;br /&gt;
int nanosleep(const struct timespec *req, struct timespec *rem){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own nanosleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Kill usleep()&lt;br /&gt;
int usleep(useconds_t usec){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own usleep(), I dunnah want sleep\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix time()&lt;br /&gt;
time_t time(time_t *t){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own time(), will return 1380120175\n&amp;quot;);&lt;br /&gt;
    return 1380120175;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Fix srand()&lt;br /&gt;
void srand(unsigned int seed){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own srand(), will do srand(0)\n&amp;quot;);&lt;br /&gt;
    void (*original_srand)(unsigned int seed);&lt;br /&gt;
    original_srand = dlsym(RTLD_NEXT, &amp;quot;srand&amp;quot;);&lt;br /&gt;
    unsigned int myseed = 0;&lt;br /&gt;
    return (*original_srand)(myseed);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#if 0&lt;br /&gt;
// Kill rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return 0\n&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
#else&lt;br /&gt;
// Intercept rand()&lt;br /&gt;
int rand(void){&lt;br /&gt;
    int (*original_rand)(void);&lt;br /&gt;
    original_rand = dlsym(RTLD_NEXT, &amp;quot;rand&amp;quot;);&lt;br /&gt;
    int r = (*original_rand)();&lt;br /&gt;
    printf(&amp;quot;\n==== In our own rand(), will return %04X\n&amp;quot;, r);&lt;br /&gt;
    return r;&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 gcc -fPIC -shared -Wl,-soname,patch -o patch.so patch.c -ldl&lt;br /&gt;
 export LD_PRELOAD=patch.so&lt;br /&gt;
 export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH&lt;br /&gt;
==PE==&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896645 Process Monitor]===&lt;br /&gt;
===[http://technet.microsoft.com/en-us/sysinternals/bb896653 Process Explorer]===&lt;br /&gt;
===[http://sourceforge.net/projects/regshot/ RegShot]===&lt;br /&gt;
Computes diff between two registry snapshots&lt;br /&gt;
===[http://www.nirsoft.net HeapMemView]===&lt;br /&gt;
===[http://winappdbg.sourceforge.net/ WinAppDbg]===&lt;br /&gt;
The WinAppDbg python module allows developers to quickly code instrumentation scripts in Python under a Windows environment.&lt;br /&gt;
====[https://brundlelab.wordpress.com/2012/08/19/small-and-cute-execution-tracer/ Tracer.py]====&lt;br /&gt;
Based on WinAppDbg, finds interesting bits in trace by dichotomy signal/noise&lt;br /&gt;
* run first time and try everything but not the interesting stuff -&amp;gt; use noise option&lt;br /&gt;
* then run again and try interesting stuff -&amp;gt; use signal option&lt;br /&gt;
&lt;br /&gt;
====[https://github.com/carlosgprado/Python-to-the-rescue/blob/master/WTFDLL.py WTFDLL.py]====&lt;br /&gt;
Find libraries loaded at runtime and the functions called&lt;br /&gt;
==Dynamic protections==&lt;br /&gt;
* http://www.openrce.org/reference_library/anti_reversing&lt;/div&gt;</summary>
		<author><name>Haxelion</name></author>
	</entry>
</feed>