WDASM

Windows Disassembler 1.2

Copyright (c) 1992 Eric Grass

Introduction

WDASM translates Windows programs into assembly language code. The code can be viewed in the display window or written to a file.

The Display Window

Saving and Reassembling Files

Commands

File Commands

Edit Commands

View Commands

Scrolling the screen


The Display Window

The display window, unlike saved files, does not include assembler directives, but rather only the instructions (with the exception of DB). At the top of the window is the following information:

Segment number

The chronological number of the segment as it occurs in the program.

Segment offset

A hexadecimal value equal to the segment's offset relative to the beginning of the file

Segment size

A hexadecimal value equal to the number of bytes in the segment.

Bytes in the program can be changed from data declarations to instructions and vice versa with the Set Bytes command.  The offsets of each instruction can be displayed with the Address Offsets command.  The Segments command allows you to exit a segment and view a different one.  To save the file, use the Save Text As command.  The Far Call Names command toggles between showing the literal Windows API function call names and the actual relocation bytes.


Saving and Reassembling Files

Save the assembly language code of the program using the Save Text As command.  Files generated by WDASM cannot be reassembled without some editing. Also required are resource files, and a file header listing (using a program file header utility such as TDUMP or EXEHDR). You will then need to make the following alterations:

1. Fill in the appropriate model type for the .MODEL directive, unless it is a medium model program.

2. Supply all relocatable address references (i.e., OFFSET ABOUTDLG). These are listed in the file header listing.

3. Specify the entry point for the END directive (also given in the file header listing).

4. Specify (or rename if you wish) exported procedures. For example, Proceduren could be renamed as AboutDlg if it is exported and they are equivalent to each other (i.e., if n is the ordinal number of AboutDlg given in the file header listing).  In some cases you will have to provide the PROC directive for an exported procedure if the procedure is not in the relocation table.

5. Make the data segment accessible to all modules.


File Commands

Open

Opens a Windows executable file or dynamic link library. The default extension is .EXE.

Save Text As

Saves assembly language code in a file. If the Create Separate File For Each Segment option is checked, file names are given an integer file name extension equal to the segment's number. If both boxes are checked, WDASM will assume the Create Separate File For Each Segment option was the one intended. If a file of the name you specify already exists, it will automatically be overwritten.  Saving files erases all byte format changes (see Set Bytes) made in the current segment unless you specifically select the Save Current Segment Only option.


Edit Commands

Set Bytes

Controls the way WDASM translates a given range of bytes. If Byte Data is selected, the given range of bytes are translated as byte declarations. If Instruction is selected, the given range of bytes are translated as machine instructions. The Labeled Instruction option allows you to give a set of instructions jump labels in front of them (if the specified range are data declarations, this will have no effect).


View Commands

Go To

Goes to the desired address in the segment (requires a hexadecimal value).

Address Offsets

Shows the offsets of each instruction in the far left hand column.

Far Call Names

Toggles between showing the literal Windows function call names and the actual relocation bytes.

Segment

Opens a desired segment.  Note that all byte format changes previously made will be lost when you open a different segment.


Scrolling the Screen

PAGE UP KEY

Scrolls the window up one page.

PAGE DOWN KEY

Scrolls the window down one page.

UP ARROW KEY

Scrolls the window up one line.

DOWN ARROW KEY

Scrolls the window down one line.