News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

just wonder..

Started by Zerofox, July 08, 2005, 08:11:17 AM

Previous topic - Next topic

Zerofox

hey i need opinions from all of u guys about the flow of the application

ex:



.model small
.code
org 100h

   
data:

jmp procces

dat1 DB 'a'

procces:

mov ah,02h
mov dl,'a'

int 21h
int 20h

END data



ok from what i read on the book, the program should jump the data variabel section in order to evade the execution from data variabel isnt it. well im just wonder if the data section really JUMPED by the program, shouldnt be the data variabel doesnt recognized by the program?  ::)

Vortex

Hi Zerofox,

The program can recognize the variable, but it jumps directly to the statement mov ah,02h

A more efficient way :

.model small
.stack

.data
dat1 DB 'a'

.code
start:
mov ah,02h
mov dl,'a'
int 21h
mov ah,04Ch ; Exit to DOS
int 21h

END start

[attachment deleted by admin]

MichaelW

Hi Zerofox,

As the program is coded, there is no data section. Here is your code modified to check that the data is reconized:

.model small
.code
org 100h

data:

jmp procces

dat1 DB 'a'

procces:

mov ah,02h

mov dl,dat1
;mov dl,'a'

int 21h

mov ah,10h ; wait for user to press key
int 16h

int 20h
END data


Here is the batch file I used to assemble and link (I assumed from the org 100h that the program is supposed to be a COM file).

ML /Fl /Sa /c nodata.asm
pause
LINK16 /TINY nodata.obj,nodata.com,nodata.map;
pause


And here is the map file the linker generated:


Start  Stop   Length Name                   Class
00000H 00111H 00112H _TEXT                  CODE
00112H 00112H 00000H _DATA                  DATA

Origin   Group
0011:0   DGROUP

Program entry point at 0000:0100

eschew obfuscation