disassembly

x86 asm disassembler library

徘徊边缘 提交于 2019-12-03 21:14:52
Are there any libraries, callable from .NET, where I can pass in binary data and have it disassembled to x86 assembly code? If you don't mind binding to an unmanaged dll using P/Invoke, have a look at beaengine , its the best disassembler library your likely to find. libdisasm The libdisasm library provides basic disassembly of Intel x86 instructions from a binary stream. The intent is to provide an easy to use disassembler which can be called from any application; the disassembly can be produced in AT&T syntax and Intel syntax, as well as in an intermediate format which includes detailed

Debugging disassembled libraries with gdb

偶尔善良 提交于 2019-12-03 17:09:29
问题 in Linux and Mac OS X I can use stepi and nexti to debug an application without debugging information. On Mac OS X gdb shows the functions that are called inside the library, although sometimes advancing several assembler instructions in each stepi instruction. On Linux, when I step into a dynamic library gdb gets lost. For instance, with puts() there are three assembler instructions inside puts(), once gdb reaches the jump at 0x080482bf, it fails with the message "No function contains

Can I debug an Exe

拜拜、爱过 提交于 2019-12-03 15:24:55
I need to compare few function calls and signature between my application and an working application. Here I don't mean any way to reverse engineer or access the source code of the other application , but truly need to know what are the methods , Interfaces used by the working application. I tried attaching my application to Visual Studio and then , Start>Debug , but this doesn't provide any useful information. Any help. Reflector Pro Visual Studio plug in can debug not only exe you write, but any other assembly ;) you can debug code, but once its compiled, its machine language and a debugger

Using objdump for ARM architecture: Disassembling to ARM

对着背影说爱祢 提交于 2019-12-03 11:15:27
I have an object file and am trying to disassemble it. When I use: objdump -d example.o I get an assembly in code in the file format of elf64-x86-64 . I am trying to disassemble this into ARM, how do I go about doing this? If you want to do disassemble of ARM code, you'd better have an ARM tool chain, this is what I got: http://bb.osmocom.org/trac/wiki/toolchain After you have this, you can use arm-elf-objdump instead of objdump. The command I used is arm-elf-objdump -D -b binary -marm binaryfile.dat If you look the manpage, you will find "-b" is followed by the file type. Sorry I don't know

Disassemble default iOS apps with otool

泪湿孤枕 提交于 2019-12-03 08:46:02
问题 When I try to disassemble the stock iOS apps (not app store ones) with otool it isn't split into different methods. It's just one massive section. Here's the command I'm using: otool -tV theApp.app/theApp >~/Desktop/output.txt Is there a way to get the disassembly split into methods? 回答1: No, there isn't. Those applications have been stripped, which means they contain no information about where functions begin or end. However, since objective-c is dynamic, any objective-c methods will have

Help with understanding a very basic main() disassembly in GDB

痴心易碎 提交于 2019-12-03 07:26:28
问题 Heyo, I have written this very basic main function to experiment with disassembly and also to see and hopefully understand what is going on at the lower level: int main() { return 6; } Using gdb to disas main produces this: 0x08048374 <main+0>: lea 0x4(%esp),%ecx 0x08048378 <main+4>: and $0xfffffff0,%esp 0x0804837b <main+7>: pushl -0x4(%ecx) 0x0804837e <main+10>: push %ebp 0x0804837f <main+11>: mov %esp,%ebp 0x08048381 <main+13>: push %ecx 0x08048382 <main+14>: mov $0x6,%eax 0x08048387 <main

Why can assembly instructions contain multiplications in the “lea” instruction?

让人想犯罪 __ 提交于 2019-12-03 06:58:01
I am working on a very low level part of the application in which performance is critical. While investigating the generated assembly, I noticed the following instruction: lea eax,[edx*8+8] I am used to seeing additions when using memory references (e.g. [edx+4]), but this is the first time I see a multiplication. Does this mean that the x86 processor can perform simple multiplications in the lea instruction? Does this multiplication have an impact on the number of cycles needed to execute the instruction? Is the multiplication limited to powers of 2 (I would assume this is the case)? Thanks

How can I view the disassembly of optimised jitted .NET code?

[亡魂溺海] 提交于 2019-12-03 06:42:28
问题 For one reason or another, I sometimes find it useful or just interesting to look at the optimised compiler output for a function. For unmanaged C/C++ code, my favourite way to do this has been to compile in Release mode, stick a breakpoint in the function of interest, run, and view the disassembly in Visual Studio when it hits the breakpoint. I recently tried this with a C# project and discovered that that technique doesn't work. Even in Release mode, the disassembly I see is obviously not

Why does a class definition always produce the same bytecode?

 ̄綄美尐妖づ 提交于 2019-12-03 05:44:53
Say I do: #!/usr/bin/env python # encoding: utf-8 class A(object): pass Now I disassemble it: python -m dis test0.py 4 0 LOAD_CONST 0 ('A') 3 LOAD_NAME 0 (object) 6 BUILD_TUPLE 1 9 LOAD_CONST 1 (<code object A at 0x1004ebb30, file "test0.py", line 4>) 12 MAKE_FUNCTION 0 15 CALL_FUNCTION 0 18 BUILD_CLASS 19 STORE_NAME 1 (A) 22 LOAD_CONST 2 (None) 25 RETURN_VALUE Now I add some statements in the class definition: #!/usr/bin/env python # encoding: utf-8 class A(object): print 'hello' 1+1 pass And I disassemble again: 4 0 LOAD_CONST 0 ('A') 3 LOAD_NAME 0 (object) 6 BUILD_TUPLE 1 9 LOAD_CONST 1 (

Understand the assembly code generated by a simple C program

*爱你&永不变心* 提交于 2019-12-03 03:54:17
问题 I am trying to understand the assembly level code for a simple C program by inspecting it with gdb's disassembler. Following is the C code: #include <stdio.h> void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; } void main() { function(1,2,3); } Following is the disassembly code for both main and function gdb) disass main Dump of assembler code for function main: 0x08048428 <main+0>: push %ebp 0x08048429 <main+1>: mov %esp,%ebp 0x0804842b <main+3>: and $0xfffffff0,%esp