Hi i want to use the Commandline in CreateProcess. I used it before without problems. But now i have a COM File with parameters and it doesntwork with CreateProcess. When i use a BAT File with this Command:
the comfile works and replace the resource of the pe file.
and here is my masm code:
i also check the msdn library for CreateProcess. But there was not much usefullinfo about handlig com files.
Or maybe the problem is the com file (rl.com) itself ???
rl.com pefile.exe new_res.res
the comfile works and replace the resource of the pe file.
and here is my masm code:
.386p
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\shell32.inc
include \masm32\include\advapi32.inc
include \masm32\include\gdi32.inc
include \masm32\include\comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\masm32.inc
include \masm32\macros\macros.asm
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\masm32.lib
UpdateRes PROTO :DWORD,:DWORD ;targetfile,resfile
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
.const
.data
_rl_cmd db 512 dup (00)
.data?
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
.code
main:
invoke UpdateRes,SADD("pefile.exe"),SADD("new_res.res")
UpdateRes proc _patcherfilename:dword,_resfile:dword
LOCAL _startup :STARTUPINFO
LOCAL _processinfo :PROCESS_INFORMATION
pushad
;---create commandline command---
;Usage: rl <PE_file> [RES_file] [/command]
invoke lstrcat,addr _rl_cmd,SADD ("rl.com ") ;rl.com
invoke lstrcat,addr _rl_cmd,_patcherfilename ;pefile.exe
invoke lstrcat,addr _rl_cmd,SADD (" ") ;space
invoke lstrcat,addr _rl_cmd,_resfile ;*.res file
invoke lstrcat,addr _rl_cmd,SADD (" /l") ;l=delete old res and Add new resources from res file to pe file
;is now "rl.com pefile.exe new_res.res /l"
;---start commandline process---
invoke CreateProcess,NULL,addr _rl_cmd,NULL,NULL,NULL,NULL,
NULL,NULL,addr _startup,addr _processinfo
popad
ret
UpdateRes endp
invoke ExitProcess,NULL
end main
i also check the msdn library for CreateProcess. But there was not much usefullinfo about handlig com files.
Or maybe the problem is the com file (rl.com) itself ???
you know another simple method how to exchange resources with *.res files ?
problem is solved. i wrote a procedure which u can easy implent to your asm codes.
Updating resources using API functions:
http://www.asmcommunity.net/board/viewtopic.php?t=18701
http://www.asmcommunity.net/board/viewtopic.php?t=18701