Do you know some good tutorials covering strings .

I have used getcommandline()

but I want to use only the file that was calling my program if there is any ?

and to remove the quotes

to remove quotes from string I use :

invoke GetCommandLine
invoke lstrcpy,addr torun,eax
mov ebx,offset torun
repeater:
cmp byte ptr,0
je finish
cmp byte ptr,22h
je fixit
inc ebx
jmp repeater
fixit:
mov byte ptr,0
inc ebx
jmp repeater
finish:
invoke MessageBox,0,addr torun+1,addr msgcap,MB_OK

but how to remove the path to my program that appears infront of the argumeters .
Posted on 2004-05-23 14:42:59 by Gangleri
Gangleri,

Hutch's masm32 library provides functions to extract the command line parameters:


ArgCL
ArgClC
GetCL



If you want to get the filename:


NameFromPath

NameFromPath proc lpPath:DWORD,lpBuffer:DWORD

Description

NameFromPath reads the filename from a complete path and returns it in the buffer specified in the parameter list.

Parameters
1. lpPath is the address of the full path that has the file name.

2. lpBuffer is the address of the buffer to receive the filename.

Return Value
The file name is returned in the buffer supplied in the second parameter.


Also, there are very usefull string handling functions from masm32.lib
Posted on 2004-05-23 14:51:34 by Vortex
Posted on 2004-05-24 08:17:51 by roticv
Thanks a lot .
Posted on 2004-05-24 15:27:02 by Gangleri