|
-
Dec 5th, 2000, 06:12 PM
#1
How do i get the command tail and parse it into an array, kinda like C++?
-
Dec 8th, 2000, 11:47 AM
#2
How about a proc to return the command tail?
-
Dec 8th, 2000, 02:15 PM
#3
Frenzied Member
If it wasn't for this sentence I wouldn't have a signature at all.
-
Dec 8th, 2000, 03:46 PM
#4
C:\FOO\MAN\CHOO\MYPROG test.txt
-
Dec 8th, 2000, 06:49 PM
#5
Frenzied Member
ahh, you get a pointer to that in WinMain, say you use a standard C style procedure for WinMain (or whatever the starting procedure is) something like this
Code:
proc WinMain
push ebp
mov ebp, esp ;store the stack pointer in ebp
;so we can get at the parameters
;any code you need for your program
mov esp, ebp
pop ebp
ret 10;
endp WinMain
ebp is then a pointer to the bottom of the stack just after you pushed ebp
so ebp points to what is essentially a structure
Code:
struct
{
unsigned long Old_EBP;
void* Return_Address;
HINSTANCE hInstance;
HINSTANCE hPrevInstance;
LPSTR lpCmdLine;
int nCmdShow;
} Wot_EBP_Points_To;
so [ebp + 10h] is a pointer to a null terminated char array which contains the command tail, the string will stay in memory until the end of the winmain procedure, which should be the end of your program.
hope it helps
If it wasn't for this sentence I wouldn't have a signature at all.
-
Dec 9th, 2000, 02:06 AM
#6
Im doing it in dos, if i was using windows i would call "GetCommandLine".
-
Dec 9th, 2000, 06:12 AM
#7
Frenzied Member
oh, err, I don't know then
If it wasn't for this sentence I wouldn't have a signature at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|