如何将IDA界面显示的指令从ARM架构切换为X86架构
How to Get x86/x86-64 Instructions (movq, movl, etc.) Instead of ARM
Got it, let's walk through the common ways to switch over to x86/x86-64 assembly instructions, depending on what tool you're working with:
Compiler (GCC/Clang)
If you're generating assembly from source code, you just need to tell the compiler to target x86/x86-64 instead of ARM:
- For x86-64 (64-bit, uses
movq,cmpq): Use the-m64flag. Example:
The outputgcc -m64 -S your_program.cyour_program.sfile will have x86-64 assembly instructions. - For 32-bit x86 (uses
movl,addl): Replace-m64with-m32. - If you're on an ARM machine, you'll need the x86 cross-compiler first. On Debian/Ubuntu, install it with:
Then compile using the cross-compiler binary:sudo apt install gcc-x86-64-linux-gnux86_64-linux-gnu-gcc -S your_program.c
Disassemblers (objdump, GDB)
If you're examining existing binaries, explicitly tell the disassembler to use the x86 architecture:
- objdump: Add the
-M x86-64flag for 64-bit, or-M i386for 32-bit. Example:objdump -d -M x86-64 your_binary_file - GDB: Once inside GDB, set the target architecture first before disassembling:
This will render x86-64 instructions instead of ARM.set architecture i386:x86-64 disassemble main
Online Assembly/Disassembly Tools
If you're using web-based tools, look for an architecture dropdown menu and select x86 or x86-64 (sometimes labeled as AMD64). Most tools let you switch this setting before generating or disassembling code.
内容的提问来源于stack exchange,提问作者zhouzou
相关产品推荐
相关产品推荐

