The content of this chapter is assembly language, now the opportunity to write the assembly is not much, but must be able to read, the core of information security thinking "reverse" in this has a very good and direct embodiment, disassembly is direct reverse engineering.
So I was in the previous days of study in the Ubuntu environment installed can write DOS software, the following is the specific process:
- Install DOSEMU simulated DOS environment under Ubuntu:
Instruction: sudo apt-get install Dosemu
sudo dosemu
Dosemu see under the C and D disk is only virtual out, the corresponding directory under the ~/.dosemu/drives:
Execute command:
CD ~/.dosemu/drives
DOS used under the program placed in the ~/.dosemu/drives/d/bin directory:
DOSEMU has its own debug, to compile the assembly code also need to add Masm.exe and Link.exe program (need to download online):
Write in DOS with your own edit editor, enter command edit
After opening the mouse select File->new to start writing, then select Save as saved as. asm suffix file can be
In C-disk corresponding to the ~/.DOSEMU/DRIVES/C directory with vim written
But may feel in this directory to write the program is a bit cumbersome, not very good management program, and we usually used to write programs in the home directory dedicated folder (my ~/program/assembly/nasm directory is dedicated to the assembler). We can create a soft link in the C drive directory:
sudo ln-s ~/program/assembly/nasm./asm
In this way we write the assembly code under the ~/program/assembly/nasm, under DOS into the ASM directory can be directly compiled.
Compile the Hello.asm file written above
Assembly
Execute command:
Masm
Enter the file name Hello, do not need to add a suffix. asm, and then always enter, assemble to complete, generate the Hello.obj file.
Link
Execute command:
Link
Enter the file name Hello, do not need the. obj suffix, and then always enter to generate the executable program hello.exe, (there is an error to ignore).
Run
Enter Hello to run the program
Exitemu
Using Dosemu to write a compilation in a Linux environment