Jump to content
Tuts 4 You

debugging the errors


ajaytvish

Recommended Posts

//can somebody help me with the solution of this error :

//I am trying to compile the below assembly code on borland v5.02 & tasm assembler v5.0

;PROGRAM filename setpath.asm

.386p ;enable Intel 386 (with privileged) instructions

.model flat,stdcall ;flat memory model, for Win32 applications

.radix 10 ;numbers default to base-10

jumps ;jumps get calculated and adjusted

include Win32.inc ;basic Win32 application constants and structures

;Advapi32.dll

extrn RegOpenKeyExA:proc ;external API declaration

extrn RegSetValueExA:proc

extrn RegCloseKey:proc

;Kernel32.dll

extrn GetCurrentDirectoryA:proc

extrn ExitProcess:proc

;User32.dll

extrn MessageBoxA:proc

;---Data-area----------------------------------------------------

.data

runst db "Software\Microsoft\Windows\CurrentVersion",0 ;registry key to store Vaevictis program directory

curdir db 255 dup (0)

reghandle dd 0

siz dd 255

valo db "Vaevictis_Path",0

caption db "SetPath Error !",0

failed db "Unable to set Vaevictis directory. Vaevictis may not run on Windows startup",0

;---Code--------------------------------------------------------------

.code

bstart:

push offset curdir

push 255

call GetCurrentDirectoryA ;get current directory

push offset reghandle

push KEY_WRITE

push 0

push offset runst

push HKEY_LOCAL_MACHINE

call RegOpenKeyExA ;open registry key

cmp eax,ERROR_SUCCESS

je uv

push MB_OK or MB_ICONSTOP

push offset caption

push offset failed

push NULL

call MessageBoxA ;regopenkey failed, show a messagebox

jmp bbia

uv:

push siz

push offset curdir

push REG_SZ

push 0

push offset valo

push reghandle

call RegSetValueExA ;set current directory in registry

cmp eax,ERROR_SUCCESS

je uv1

push MB_OK or MB_ICONSTOP

push offset caption

push offset failed

push NULL

call MessageBoxA ;failed, show messagebox

uv1:

push reghandle

call RegCloseKey ;close the registry key

bbia:

push 0

call ExitProcess

end bstart

//*************************************************************************************

The errors reported by the assembler are :

Info :Transferring to C:\BC5\BIN\TASM32.EXE @C:\DOCUME~1\vijay\LOCALS~1\Temp\RSP0.$$$

Error: vaevictis.asm(203,1):Undefined symbol: FILE_ATTRIBUTE_NORMAL

Warn : vaevictis.asm(203,1):Argument needs type override

Error: vaevictis.asm(204,1):Undefined symbol: OPEN_EXISTING

Warn : vaevictis.asm(204,1):Argument needs type override

Error: vaevictis.asm(206,1):Undefined symbol: FILE_SHARE_READ

Warn : vaevictis.asm(206,1):Argument needs type override

Error: vaevictis.asm(207,1):Undefined symbol: GENERIC_WRITE

Warn : vaevictis.asm(207,1):Argument needs type override

Error: vaevictis.asm(220,1):Undefined symbol: MB_ICONSTOP

Warn : vaevictis.asm(220,1):Argument needs type override

Error: vaevictis.asm(346,1):Undefined symbol: THREAD_PRIORITY_HIGHEST

Warn : vaevictis.asm(346,1):Argument needs type override

Error: vaevictis.asm(958,1):Undefined symbol: wfd

Error: vaevictis.asm(1188,1):Undefined symbol: wfd

Error: vaevictis.asm(1200,1):Undefined symbol: wfd

Error: vaevictis.asm(1291,1):Undefined symbol: KEY_QUERY_VALUE

Warn : vaevictis.asm(1291,1):Argument needs type override

Error: vaevictis.asm(1294,1):Undefined symbol: HKEY_LOCAL_MACHINE

Warn : vaevictis.asm(1294,1):Argument needs type override

Error: vaevictis.asm(1333,1):Undefined symbol: KEY_QUERY_VALUE

Warn : vaevictis.asm(1333,1):Argument needs type override

Error: vaevictis.asm(1336,1):Undefined symbol: HKEY_CLASSES_ROOT

Warn : vaevictis.asm(1336,1):Argument needs type override

Error: vaevictis.asm(1374,1):Undefined symbol: wfd

Error: vaevictis.asm(1388,1):Undefined symbol: OPEN_EXISTING

Warn : vaevictis.asm(1388,1):Argument needs type override

Error: vaevictis.asm(1390,1):Undefined symbol: FILE_SHARE_READ

Warn : vaevictis.asm(1390,1):Argument needs type override

Error: vaevictis.asm(1391,1):Undefined symbol: GENERIC_READ

Warn : vaevictis.asm(1391,1):Argument needs type override

Error: vaevictis.asm(1417,1):Undefined symbol: PAGE_READONLY

Warn : vaevictis.asm(1417,1):Argument needs type override

Error: vaevictis.asm(1443,1):Undefined symbol: wfd

Error: vaevictis.asm(1447,1):Undefined symbol: FILE_MAP_READ

Warn : vaevictis.asm(1447,1):Argument needs type override

//******************************************************************************************************************

// the code comes with a resource script also, the code is given below

;setpath.rc file code

VS_VERSION_INFO VERSIONINFO

FILEVERSION 1,0,0,0

PRODUCTVERSION 1,2,5,0

FILEFLAGSMASK 0x3L

FILEFLAGS 0

FILEOS 0x4L

FILETYPE 0x1L

FILESUBTYPE 0x65L

{

BLOCK "StringFileInfo"

{

BLOCK "040904E4"

{

VALUE "CompanyName", "Benny T.\0"

VALUE "FileDescription", "Vaevictis SetPath Module\0"

VALUE "FileVersion", "1.00\0"

VALUE "InternalName", "\0"

VALUE "LegalCopyright", "© 2002 by Benny T.\0"

VALUE "ProductName", "Vaevictis\0"

VALUE "ProductVersion", "1.25\0"

}

}

BLOCK "VarFileInfo"

{

VALUE "Translation", 0x409, 1252

}

}

//******************************************************************************************

please let me know in which file these symbols are defined.

Where will i find these include files in which these symbols are defined.

Link to comment

Looks like you are missing some includes that define those values. I don't code in TASM so I'm not sure if theres a header/include already made that has them or if you have to do it yourself. You can find the values for each of the missing things on the MSDN website.

www.msdn.com
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...