Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Just finished learning x86 assembly language. What can I do with it? [closed]

Tags:

assembly

I just finished learning assembly language. But I couldn't understand what could I implement (for practice/like small project). Would be great if its something useful for anyone.

like image 560
claws Avatar asked Nov 27 '09 17:11

claws


People also ask

What can I do with assembly language?

Today, assembly language is still used for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems (see § Current usage).

Is it worth to learn assembly language in 2021?

Originally Answered: Is assembly language still useful to learn in 2021? yes. most embedded applications require some amount of assembly (low level code) to directly interface with hardware devices.

What is x86 assembly used for?

x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.

Why do programmers still use assembly language?

Assembly languages are also often used by programmers wanting greater control over their computers as assembly languages allow you to directly manipulate your hardware. Because of its speed and importance, some programs are specifically written using assembly language as the code can usually remain smaller.


2 Answers

One of my favorite hobbies is Reverse Engineering.

It requires a solid knowledge of assembly and the use of disassemblers/debuggers to walk through compiled code. This allows you to alter, understand and reverse compiled programs. Each new program is like a puzzle waiting to be solved!

For example, a lot of people reverse games like Minesweeper when they are first starting out.

Here is a screenshot of a key section of code in Minesweeper I reversed awhile back (comments on right-hand side): alt text

This was located by placing a breakpoint on calls to the rand() function and stepping backwards in the callstack. After some digging it becomes obvious that:

  1. Minefield Height is located in 0x1005338
  2. Minefield Width is located in 0x1005334
  3. Minefield Baseaddress is located at 0x1005340

With this knowledge it becomes easy to determine the location of any given mine in the minefield by:

cellAddress = mapBaseAddress + (32 * (y+1)) + (x+1); 

Then, with a simple loop and some calls to ReadProcessMemory() you've got the ultimate Minesweeper hack!

Reading hand-written assembly is far easier than reading machine generated assembly. Modern compilers do some magical and crazy things to the code for optimization that can sometimes be difficult to follow. So, this will definitely push your assembly knowledge!

There are tons of activities that can branch off from this:

  1. Reverse hidden API's in libraries
  2. Write advanced game hacks using DLL Injection, Code Caves, Function Hooking and more!
  3. Understand the limitations of various protection schemes employed by software
  4. Reverse a fileformat that isn't published or known and write code to read this format for interoperability purposes.
  5. Write emulators for various systems (including older game systems!)
  6. Understand how a well-known program does a particular task.
  7. Reverse malware and viruses to see how and what they do.

And more!

If you are interested, I highly suggest the book: Reversing: Secrets of Reverse Engineering

like image 124
mmcdole Avatar answered Sep 18 '22 17:09

mmcdole


You can learn how OS work at low level (interrupts, virtual memory and so on). First write a bootloader which will give you full access to the hardware, then you can start playing with protected mode, VGA programming and so on.

Two good resources:
http://wiki.osdev.org/Main_Page
http://www.osdever.net/FreeVGA/home.htm

[Edit]

If you want to learn about optimizations, check out Agner Fog's website: http://agner.org/optimize/.

[Edit]

Copied from Simucal's comment:

You might want to add a link to MikeOS also. It is a small operating system written in Assembly that is designed as a learning tool to see how simple operating systems work. It has well commented code and documentation: http://mikeos.berlios.de

like image 38
Bastien Léonard Avatar answered Sep 21 '22 17:09

Bastien Léonard