Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
625 views
in Technique[技术] by (71.8m points)

binary - How to read Assembly

I have disassembled a binary file using gdb and am trying to understand what the program is doing. I have a basic understanding of what the assembly is telling me, but I don't understand the hex numbers.

How can I tell if a hex number is representing a number or a string? For example, mov $0x40065c,%edi. I can see that a value is being moved into %edi, but is this a number or a string?

Here is the code I am working on:

0x000000000040057d <+0>:     push   %rbp
0x000000000040057e <+1>:     mov    %rsp,%rbp
0x0000000000400581 <+4>:     mov    $0x400634,%edi
0x0000000000400586 <+9>:     callq  0x400450 <puts@plt>
0x000000000040058b <+14>:    mov    $0x400648,%edi
0x0000000000400590 <+19>:    callq  0x400450 <puts@plt>
0x0000000000400595 <+24>:    mov    $0x40065c,%edi
0x000000000040059a <+29>:    callq  0x400450 <puts@plt>
0x000000000040059f <+34>:    mov    $0x0,%edi
0x00000000004005a4 <+39>:    callq  0x400480 <exit@plt>
question from:https://stackoverflow.com/questions/65880888/how-to-read-assembly

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...