The Tasm code bellow creates a exe that when i click in the run button runs UNRAR.EXE but what I want is to make it run UNRAR.EXE T *.RAR, being T *.RAR options available in the UNRAR.EXE command line.

Thanks in advance for any help.



.386
.Model Flat, StdCall
Locals
jumps
UNICODE=0
;*************************************************
extern WriteProcessMemory:PROC
extern GetAsyncKeyState:PROC
;*************************************************
include w32.inc
;*************************************************
DLG1 equ 104
RUN equ 102
ICON1 equ 106
SM_ICON equ 0
;*************************************************
dlg1Proc PROTO :DWORD,:DWORD,:DWORD,:DWORD
;*************************************************
.Data
;*************************************************
errorcaption db "Error",0
;*************************************************
errormessage db "Sorry!!",0ah
;*************************************************
filename db "UnRAR.exe",0
;*************************************************
@startupinfo dd 0
db 68 dup (0)
;*************************************************
.data?
_hInst dd ?
_hanicon dd ?
hProcess dd ?
hThread dd ?
dwProcessID dd ?
dwThreadID dd ?
;*************************************************
.CODE
main:
call GetModuleHandle,0
mov _hInst,eax
Push 0
Push offset Dlg1Proc
Push 0
Push DLG1
Push _hInst
Call DialogBoxParamA
Call ExitProcess,0
dlg1Proc proc uses ebx edi esi, _hwind:DWORD, wmsg:DWORD, wparama:DWORD, lparama:DWORD
push 0
push 90
push 0
push _hwind
call SetTimer
cmp , WM_INITDIALOG
jz _initdlg
cmp , WM_COMMAND
jz events
cmp , WM_CLOSE
jz kill_it
cmp , WM_DESTROY
jz kill_it
cmp , WM_TIMER
jz @timer
xor eax,eax
;*************************************************
end_it:
ret
;*************************************************
kill_it:
Call Exitprocess,0
;*************************************************
_initdlg:
push ICON1
push _hinst
call LoadIcon
mov _hanicon, eax
push eax
push SM_ICON
push WM_SETICON
push _hwind
call SendMessage
jmp end_it
;*************************************************
events:
cmp ,RUN
jnz @next1
call @start
@next1:
xor eax,eax
jmp end_it
;*************************************************
@timer:
ret
;*************************************************
@f1 proc
ret
@f1 endp
;*************************************************
@start proc
push offset hprocess
push offset @startupinfo
push 0
push 0
push NORMAL_PRIORITY_CLASS
push 0
push 0
push 0
push 0
push offset filename
call createprocess
cmp eax,0
jnz @okie
call @error
@okie:
ret
@start endp
;*************************************************
dlg1Proc endp
;*************************************************
@error proc
push 0
push offset errorcaption
push offset errormessage
push _hwind
call messageboxa
ret
@error endp
;*************************************************
End main
Posted on 2003-03-04 07:24:11 by sabertooth
Hi sabertooth,





.data
[b]ppoint dd 0[/b]
[b]parametre db 'T *.RAR ',0 [/b] ; your parameter
...


and change CreateProcess option to



[b]mov dword ptr [ppoint], offset parametre[/b]
...
[b]push offset parametre [/b]
push offset filename
call createprocess
cmp eax,0
...


Regards
Posted on 2003-03-04 09:34:48 by CYDONIA
Thanks for the info but it didn't worked.
I did as you said but the run button only started UNRAR.EXE and not UNRAR T *.RAR.
Posted on 2003-03-04 12:20:14 by sabertooth
This is not enough,

filename db "UnRAR.exe",0

CreateProcess needs FULL Path.

like,

"C:\MyStuff\unrar.exe"

Good luck
Posted on 2003-03-04 18:41:26 by cakmak
"CreateProcess needs FULL Path" not necessary because the compiled exe is in the same directory that unrar.exe so the complete path is not necessary, but thanks anyway.
Posted on 2003-03-08 09:03:35 by sabertooth