Message board for the users of flat assembler.
> Windows > createprocess with commandline
DC740 08 Jun 2005, 01:08
i was trying to make this code work (it was a test, i tried "create process" in the main program and it didnt work) but i found that it doesn't work with the command line, and when i put a NULL in the command line parameter it works perfect... but i need the command line parameter
this is the code, i tried a lot of things, but i'm feeling a little frustated... i'm trying to do something in fasm since last week (i'm a newbie in asm, i finished reading some tutorials las week)
format PE GUI
section '.data' data readable writeable
meemul db 'c:\fasmw161\meosemul\meosemul.exe'
progpath db 'c:\fasmw161\meosemul\guitest.bin'
section '.idata' import data readable writeable
section '.udata' readable writeable
section '.code' code readable executable
|08 Jun 2005, 01:08||
marciano 08 Jun 2005, 02:54
Put a null character after every text string, as follows:
section '.data' data readable writeable meemul db 'c:\fasmw161\meosemul\meosemul.exe',0 progpath db 'c:\fasmw161\meosemul\guitest.bin',0
EDIT: no habia visto que eras de Argentina
|08 Jun 2005, 02:54||
DC740 08 Jun 2005, 17:02
thanx for the reply but it didn't work... now i'm frustated
jeje espero q alguien encuentre la solucion, ya me estoy volviendo loco jajaj
|08 Jun 2005, 17:02||
Nikolay Petrov 08 Jun 2005, 18:30
Read a carefully WinAPI manual. In principle it must to work, but is possible and can't. I can't a divine.
|08 Jun 2005, 18:30||
DC740 08 Jun 2005, 21:50
i have read the windows api reference, i can paste it complete, but i think it's not necesary, anyway i'll post the api declaration
the most strange thing is that i have worked with this api before, making a program in C and i didn't have any problem, but now in asm, the things are getting a little hard
The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.
LPCTSTR lpApplicationName, // pointer to name of executable module
LPTSTR lpCommandLine, // pointer to command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes
LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes
BOOL bInheritHandles, // handle inheritance flag
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // pointer to new environment block
LPCTSTR lpCurrentDirectory, // pointer to current directory name
LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO
LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION
|08 Jun 2005, 21:50||
shoorick 09 Jun 2005, 06:30
hi! it really does not work and i do not know why, but if you want exactly just run look for these two working variants:
format PE GUI entry start include '%fasminc%\win32a.inc' section '.data' data readable writeable meemul db 'c:\fasm\fasmw.exe',0 progpath db 'c:\fasm\beer.asm',0 _open db 'open',0 _cmd db 'c:\fasm\fasmw.exe '; no zero here - continued by cmdline! cmdline db 'c:\fasm\beer.asm',0 section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',shell,'SHELL32.DLL' import kernel,CreateProcess,'CreateProcessA',\ ExitProcess,'ExitProcess' import shell,\ ShellExecute,'ShellExecuteA' section '.udata' readable writeable sinfo STARTUPINFO pinfo PROCESS_INFORMATION section '.code' code readable executable start: invoke ShellExecute,0,_open,meemul,progpath,0,SW_SHOWDEFAULT ;invoke CreateProcess,meemul,progpath,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,sinfo,pinfo invoke CreateProcess,0,_cmd,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,NULL,sinfo,pinfo invoke ExitProcess,0
|09 Jun 2005, 06:30||
DC740 09 Jun 2005, 16:54
thanxxxxxxxxxxxxxxx now it's working, tahnx a lot to everyone
|09 Jun 2005, 16:54||
Madis731 10 Jun 2005, 09:44
Wouldn't it be easier to tell Mike that MeOSEmulator should associate itself with MenuetOS header. I tried your code - it works, but doesn't give me any advantage...
1. I compile ASM->MeOS
2. I drag&drop this to MeOSEmul.exe
1. I compile ASM->MeOS
2. I run your program that in turn runs my MeOS binary with MeOSEmul
I tried messing with registry but I can't get the emulator to accept my parameters and FASM won't run .bin by default
|10 Jun 2005, 09:44||
DC740 10 Jun 2005, 17:17
hello madis i'lll explain you what i'm trying to do... the code that i posted was a test to try the api, the main program was the fasm IDE for win32, my idea is to make it "run" the menuetos compiled .bin with the emulator directly from the IDE (pressing F9 or clicking in "Run").
the api is working, but i don't know how to make it work with the path_buffer variable (inside fasmw.asm), i think that path_buffer doesn't finish with a null byte (0) and that is causing my modifications to not work, now i'm trying to find the way to work with strings to learn to solve my problem, if you have any documentation about that i would be very grateful... it should be easy for an experienced programmer but i started last week and it's my first program... well... is not my program, but you know what i mean... i hope this will be useful... thanx MenuetOS rulez
|10 Jun 2005, 17:17||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.