elf文件反编译C语言,ELF文件解析和反汇编

首先来看一段Unix/Linux下的汇编代码:

#PURPOSE: This program finds the maximum number of a

# set of data items.

##VARIABLES: The registers have the following uses:

## %edi - Holds the index of the data item being examined

# %ebx - Largest data item found

# %eax - Current data item

## The following memory locations are used:

## data_items - contains the item data. A 0 is used

# to terminate the data

#

.section .data

data_items:

.long 3,67,34,222,45,75,54,34,44,33,22,11,66,0

.section .text

.globl _start

_start:

movl $0, %edi

movl data_items(,%edi,4), %eax

movl %eax, %ebx

start_loop:

cmpl $0, %eax

je loop_exit

incl %edi

movl data_items(,%edi,4), %eax

cmpl %ebx, %eax

jle start_loop

movl %eax, %ebx

jmp start_loop

你可能感兴趣的:(elf文件反编译C语言)