News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Accessing the environment of a child process

Started by nidud, February 18, 2016, 08:01:36 AM

Previous topic - Next topic

nidud

deleted

jj2007

If you have its source code, WM_COPYDATA is a good option. Otherwise code injection (but watch the forum rules...)

Zen

NIDUD,
Child Processes, MSDN
...But, this is probably what you're most interested in: Process Security and Access Rights, MSDN
You will notice that this is the MSDN documentation for the current version of the Windows Operating System. As I recall, access of child process memory from the parent process works differently on older versions of the Windows Operating System.

...If you visit Raymond Chen's Windows Blog site, search for the term: child process,...Child Process Search
A process inherits its environment from its parent, and the consequences of this simple statement, Raymond Chen

nidud

#3
deleted

dedndave

there are numerous batch tricks

tell us exactly what you are trying to do
it sounds like you could just pass the current directory on the command line
(you can get that from API too - lol)

dedndave

in other words...

make me understand why GetCurrentDirectory won't work for you

nidud

#6
deleted

dedndave

ok - i am still not clear on what you are trying to accomplish

are you writing a program or a batch file or both ?

maybe you want to...

1) GetEnvironmentStrings - create an environment block of the current process
2) modify the environment strings, as desired
3) CreateProcess and pass the address of the new environment block
4) FreeEnvironmentStrings - release the environment memory block

the environment functions may be ANSI or UNICODE - use the same type for both

dedndave

for batch files, there are many little tricks to use

the SET command has a lot of info in the help

C:\> SET /?>temp.txt

there are a few others, too
i don't remember what they are, but i can probably find them if you're interested

nidud

#9
deleted

nidud

#10
deleted

nidud

#11
deleted