disassembly

x86 BSWAP instruction REX doesn't follow Intel specs?

风格不统一 提交于 2021-02-20 06:27:43
问题 I've been assembling (and disassembling) the BSWAP x64 instruction with both NASM and GAS, and both assemble the instruction BSWAP r15 as 490FCF in hex. Disassemblers also disassemble this to the same instruction. The REX prefix for the instruction ( 49 ) thus has the REX.W bit (bit 3) and the REX.B bit (bit 0) set. This is directly in contrast to the Intel documentation, which states: In 64-bit mode, the instruction’s default operation size is 32 bits. Using a REX prefix in the form of REX.R

x86 BSWAP instruction REX doesn't follow Intel specs?

≯℡__Kan透↙ 提交于 2021-02-20 06:25:41
问题 I've been assembling (and disassembling) the BSWAP x64 instruction with both NASM and GAS, and both assemble the instruction BSWAP r15 as 490FCF in hex. Disassemblers also disassemble this to the same instruction. The REX prefix for the instruction ( 49 ) thus has the REX.W bit (bit 3) and the REX.B bit (bit 0) set. This is directly in contrast to the Intel documentation, which states: In 64-bit mode, the instruction’s default operation size is 32 bits. Using a REX prefix in the form of REX.R

What's the difference between binary and executable files mentioned in ndisasm's manual?

纵然是瞬间 提交于 2021-02-10 20:01:34
问题 I want to compile my C file with clang and then decompile it with with ndisasm (for educational purposes). However, ndisasm says in it's manual that it only works with binary and not executable files: ndisasm only disassembles binary files: it has no understanding of the header information present in object or executable files. If you want to disassemble an object file, you should probably be using objdump(1). What's the difference, exactly? And what does clang output when I run it with a

What's the difference between binary and executable files mentioned in ndisasm's manual?

随声附和 提交于 2021-02-10 20:01:10
问题 I want to compile my C file with clang and then decompile it with with ndisasm (for educational purposes). However, ndisasm says in it's manual that it only works with binary and not executable files: ndisasm only disassembles binary files: it has no understanding of the header information present in object or executable files. If you want to disassemble an object file, you should probably be using objdump(1). What's the difference, exactly? And what does clang output when I run it with a

Understanding disassembled binary from Objdump - What are the fields from the output

我们两清 提交于 2021-02-09 09:21:22
问题 I get the following output when I disassembled a simple ARM binary file using the command "arm-linux-gnueabihf-objdump -d a.out" 00008480 <_start>: 8480: f04f 0b00 mov.w fp, #0 8484: f04f 0e00 mov.w lr, #0 8488: bc02 pop {r1} 848a: 466a mov r2, sp What do different columns represent here? For example, 8480 and f04f 0b00 (from the 2nd line of code) 回答1: The first column is the address of the code in memory. 0x8480 means the memory address of this piece of code is 0x8480 . The second column is

Understanding disassembled binary from Objdump - What are the fields from the output

*爱你&永不变心* 提交于 2021-02-09 09:19:21
问题 I get the following output when I disassembled a simple ARM binary file using the command "arm-linux-gnueabihf-objdump -d a.out" 00008480 <_start>: 8480: f04f 0b00 mov.w fp, #0 8484: f04f 0e00 mov.w lr, #0 8488: bc02 pop {r1} 848a: 466a mov r2, sp What do different columns represent here? For example, 8480 and f04f 0b00 (from the 2nd line of code) 回答1: The first column is the address of the code in memory. 0x8480 means the memory address of this piece of code is 0x8480 . The second column is

Understanding disassembled binary from Objdump - What are the fields from the output

倾然丶 夕夏残阳落幕 提交于 2021-02-09 09:19:03
问题 I get the following output when I disassembled a simple ARM binary file using the command "arm-linux-gnueabihf-objdump -d a.out" 00008480 <_start>: 8480: f04f 0b00 mov.w fp, #0 8484: f04f 0e00 mov.w lr, #0 8488: bc02 pop {r1} 848a: 466a mov r2, sp What do different columns represent here? For example, 8480 and f04f 0b00 (from the 2nd line of code) 回答1: The first column is the address of the code in memory. 0x8480 means the memory address of this piece of code is 0x8480 . The second column is

Differences between call, push+ret and push+jump in assembly

丶灬走出姿态 提交于 2021-02-07 06:52:47
问题 I have a trace instruction and want to extract function calls and returns. I found that except call instruction, push + jmp and push + ret can be used for function call? At first I want to be sure is that correct? and if yes what are the differences between them? Also if push + ret is kind of call so what would be the end or return of a function? Seeing only ret without push instruction before it? 回答1: Yes, you are correct. When a call is issued, the return address pushed onto the stack is

Differences between call, push+ret and push+jump in assembly

我的梦境 提交于 2021-02-07 06:52:42
问题 I have a trace instruction and want to extract function calls and returns. I found that except call instruction, push + jmp and push + ret can be used for function call? At first I want to be sure is that correct? and if yes what are the differences between them? Also if push + ret is kind of call so what would be the end or return of a function? Seeing only ret without push instruction before it? 回答1: Yes, you are correct. When a call is issued, the return address pushed onto the stack is