Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Need a debugger for windows
Reply
Posted 2006-05-02, 09:17 PM
I was playing around with debug for a while, and I think it can't properly handle windows programs. For instance, I wrote a simple piece of code that prints my name for the purpose of looking and tracing through the disassembled code :

Code:
#include <stdio.h>

int main(void)
{
   printf("Jamal");
   return 0;
}
When I look at the registers and dissasemble it, here is what I get:

Code:
-r
AX=0000  BX=0000  CX=3B2F  DX=0000  SP=00B8  BP=0000  SI=0000  DI=0000
DS=0B6D  ES=0B6D  SS=0B7D  CS=0B7D  IP=0000   NV UP EI PL NZ NA PO NC
0B7D:0000 0E            PUSH    CS
-u
0B7D:0000 0E            PUSH    CS
0B7D:0001 1F            POP     DS
0B7D:0002 BA0E00        MOV     DX,000E
0B7D:0005 B409          MOV     AH,09
0B7D:0007 CD21          INT     21
0B7D:0009 B8014C        MOV     AX,4C01
0B7D:000C CD21          INT     21
0B7D:000E 54            PUSH    SP
0B7D:000F 68            DB      68
0B7D:0010 69            DB      69
0B7D:0011 7320          JNB     0033
0B7D:0013 7072          JO      0087
0B7D:0015 6F            DB      6F
0B7D:0016 67            DB      67
0B7D:0017 7261          JB      007A
0B7D:0019 6D            DB      6D
0B7D:001A 206361        AND     [BP+DI+61],AH
0B7D:001D 6E            DB      6E
0B7D:001E 6E            DB      6E
0B7D:001F 6F            DB      6F
I believe the part of the code we're looking at is:

Code:
0B7D:0000 0E            PUSH    CS
0B7D:0001 1F            POP     DS
0B7D:0002 BA0E00        MOV     DX,000E
0B7D:0005 B409          MOV     AH,09
0B7D:0007 CD21          INT     21
0B7D:0009 B8014C        MOV     AX,4C01
0B7D:000C CD21          INT     21
Now, I tried to dump 0B7D:0000 and this is what I got:

Code:
0B7D:0000  0E 1F BA 0E 00 B4 09 CD-21 B8 01 4C CD 21 54 68   ........!..L.!Th
0B7D:0010  69 73 20 70 72 6F 67 72-61 6D 20 63 61 6E 6E 6F   is program canno
0B7D:0020  74 20 62 65 20 72 75 6E-20 69 6E 20 44 4F 53 20   t be run in DOS
0B7D:0030  6D 6F 64 65 2E 0D 0D 0A-24 00 00 00 00 00 00 00   mode....$.......
0B7D:0040  50 45 00 00 4C 01 05 00-94 17 58 44 00 16 00 00   PE..L.....XD....
0B7D:0050  C6 01 00 00 E0 00 07 03-0B 01 02 38 00 0A 00 00   ...........8....
0B7D:0060  00 12 00 00 00 02 00 00-20 12 00 00 00 10 00 00   ........ .......
0B7D:0070  00 20 00 00 00 00 40 00-00 10 00 00 00 02 00 00   . ....@.........
What bothers me is that where my name Jamal should be, it says that the program can't be run in MS-Dos mode. Is there a debugger which will allow me to properly debug this code?

Last edited by Demosthenes; 2006-05-02 at 09:28 PM.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:11 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.