Questions tagged [disassembly]

Involves turning "compiled" code (such as machine code, byte code or IR code) back in higher-level assembly mnemonics.

Disassembly is the process for turning a binary form back into its higher-level counterpart so that it can be inspected or altered in a human-readable form.

This is normally done with the aid of a disassembler, some notable examples being:

1640 questions
16
votes
5 answers

Linux Mach-O Disassembler

Are there any Linux programs that can disassemble an OSX universal x86/x86_64 fat Mach-O binary like objdump? GNU binutils' objdump supports ELF and Windows PE files but not Mach-O.
Jeff
  • 358
  • 1
  • 3
  • 10
16
votes
8 answers

Atmel AVR Disassembler

Can somebody suggest me any disassembler for Atmel AVR 8-bit microcontrollers? There are opensource projects for this? Thanx.
Eugene Burtsev
  • 1,465
  • 4
  • 24
  • 45
16
votes
8 answers

Determine source language from a binary?

I responded to another question about developing for the iPhone in non-Objective-C languages, and I made the assertion that using, say, C# to write for the iPhone would strike an Apple reviewer wrong. I was speaking largely about UI elements…
Tim
  • 59,527
  • 19
  • 156
  • 165
15
votes
5 answers

How to print disassembly registers in the Xcode console

I'm looking at some disassembly code and see something like 0x01c8f09b <+0015> mov 0x8(%edx),%edi and I am wondering what the value of %edx or %edi is. Is there a way to print the value of %edx or other assembly variables? Is there a way to…
Nate
  • 12,963
  • 4
  • 59
  • 80
15
votes
1 answer

movw and movt in arm assembly

I'm having trouble deciphering this block of assembly code. What would the value of r1 be by the end and how would I get there? 3242ba66 f6454118 movw r1, 0x5c18 3242ba6a 466f mov r7, sp 3242ba6c f6c0415a movt r1,…
user1000039
  • 785
  • 1
  • 7
  • 19
15
votes
3 answers

Compilers: Understanding assembly code generated from small programs

I'm self-studying how compilers works. I'm learning by reading the disassembly of GCC generated code from small 64-bit Linux programs. I wrote this C program: #include int main() { for(int i=0;i<10;i++){ int k=0; …
Ofey
  • 167
  • 7
15
votes
1 answer

Can radare2 print local variables by name?

When radare2 analyzes a function, it gives local variables names such as local_4h for ebp - 0x4. It also offers the ability to give these variables more meaningful names when their purpose becomes clear. However, after the variables are renamed it…
devneal17
  • 281
  • 1
  • 4
  • 14
15
votes
4 answers

Understand the assembly code generated by a simple C program

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 void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; } void…
Adi
  • 1,589
  • 3
  • 19
  • 27
15
votes
1 answer

Visual studio. How to use search in disassembly window?

I want to find function in disassembly window using Ctrl+F by it's name (from symbols). How can I search through disassembly? Is there any extension?
Oleh Nechytailo
  • 2,155
  • 17
  • 26
14
votes
3 answers

Why can assembly instructions contain multiplications in the "lea" instruction?

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…
Patrick
  • 23,217
  • 12
  • 67
  • 130
13
votes
4 answers

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

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 : …
masterwok
  • 4,868
  • 4
  • 34
  • 41
13
votes
1 answer

MOVABS opcode in the assembly code

While debugging one of the assembly code examples, I found following piece of information: (gdb) x /10i 0x4005c4 0x4005c4: push %rbp 0x4005c5: mov %rsp,%rbp 0x4005c8: sub $0xa0,%rsp 0x4005cf: mov %fs:0x28,%rax …
Mangoman_123
  • 131
  • 1
  • 1
  • 3
13
votes
2 answers

How to fully disassemble Python source

I have been playing with the dis library to disassemble some Python source code, but I see that this does not recurse into functions or classes: import dis source_py = "test.py" with open(source_py) as f_source: source_code =…
Martin Evans
  • 45,791
  • 17
  • 81
  • 97
13
votes
1 answer

Increase of access time with large array indexes

Problem I currently write a program with large arrays and I am very confused about the processing time of the different arrays. On the one hand I have 7 "smaller" arrays (<=65536 elements) and on the other hand I have 7 large arrays (65536 <…
Kite
  • 651
  • 6
  • 16
13
votes
1 answer

Why does a class definition always produce the same bytecode?

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…
usual me
  • 8,338
  • 10
  • 52
  • 95