Difference between revisions of "16-bit Assembly"

From SkullSecurity
Jump to navigation Jump to search
Line 1: Line 1:
{{Construction}}
{{Construction}}
{{Infobox assembly}}
{{Infobox assembly}}
Older software, before 32-bit was common, was written in 16-bit x86 assembly. Although it is rare to come across, it does happen. This section will talk about some of the challenges to cracking a 16-bit program.
Thankfully, IDA supports 16-bit programs as well as 32-bit programs. That means that, if nothing else, a friendly disassembler is available to assist with reverse engineering.
W32Dasm also works well on 16-bit programs.
== Challenges ==


There are many challenges with cracking a 16-bit game that aren't present in modern 32-bit programs. Some examples of issues are:
There are many challenges with cracking a 16-bit game that aren't present in modern 32-bit programs. Some examples of issues are:
* Debuggers don't work
* Debuggers don't work unless they're specially designed, since 16-bit programs run in a virtual machine.
* Small segments means code is more spread out
* Small segments means code is more spread out.
* Different uses for registers/instructions
* Different uses for registers/instructions.


This section will address the final point, since that's the only really necessary tool.  
This section will address the final point, since that's the only really necessary tool.  


[[Registers]]
== Registers ==
The general purpose registers are similar, with one exception: the 32-bit registers no longer exist. That means that the registers available are:
The general purpose registers are similar, with one exception: the 32-bit registers no longer exist. That means that the registers available are:
* ax
* ax
Line 24: Line 32:
The reason for this change is because a 16-bit register only has a 65536-value range, and most programs are more than 64k big.  
The reason for this change is because a 16-bit register only has a 65536-value range, and most programs are more than 64k big.  


[[Different Instructions]]
== Instructions ==
The main differences in instructions is that the instructions that operate on 64-bit registers (such as div and mul) now operate on 32-bit registers. That means that any instruction that uses edx:eax now uses dx:ax.
The main differences in instructions is that the instructions that operate on 64-bit registers (such as div and mul) now operate on 32-bit registers. That means that any instruction that uses edx:eax now uses dx:ax.

Revision as of 20:50, 16 March 2007

Stop hand.png This page is under construction. USE AT YOUR OWN RISK!







Assembly Language Tutorial
Please choose a tutorial page:

Older software, before 32-bit was common, was written in 16-bit x86 assembly. Although it is rare to come across, it does happen. This section will talk about some of the challenges to cracking a 16-bit program.

Thankfully, IDA supports 16-bit programs as well as 32-bit programs. That means that, if nothing else, a friendly disassembler is available to assist with reverse engineering.

W32Dasm also works well on 16-bit programs.

Challenges

There are many challenges with cracking a 16-bit game that aren't present in modern 32-bit programs. Some examples of issues are:

  • Debuggers don't work unless they're specially designed, since 16-bit programs run in a virtual machine.
  • Small segments means code is more spread out.
  • Different uses for registers/instructions.

This section will address the final point, since that's the only really necessary tool.

Registers

The general purpose registers are similar, with one exception: the 32-bit registers no longer exist. That means that the registers available are:

  • ax
  • bx
  • cx
  • dx
  • si
  • di
  • bp
  • sp

Another change is in the instruction pointer, eip -- there are now two instruction pointers, XXXXX and ip. XXXXX points to the current segment and ip points to the current instruction within that segments.

The reason for this change is because a 16-bit register only has a 65536-value range, and most programs are more than 64k big.

Instructions

The main differences in instructions is that the instructions that operate on 64-bit registers (such as div and mul) now operate on 32-bit registers. That means that any instruction that uses edx:eax now uses dx:ax.