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 .
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 .
Gangleri,
Hutch's masm32 library provides functions to extract the command line parameters:
If you want to get the filename:
Also, there are very usefull string handling functions from masm32.lib
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
Thanks a lot .