how to extract value from environment..

Let's say you were working on a secure system transaction. How would you extract any information for say a display which, for instance users have put in data.

:-Lets say your users have put in information about logging in and the system inventory setings. How would you use C to extract those data WITHOUT using a variable before hand to store the input. One way maybe to access the display/input buffer and extract from there, but I don't know how...

Friends told me that this was posible using JAVA and the System class. Regardless, I would like to find out about a solution.

-Another tip:-
I DON'T mean:- cin, printf, getline i.e ones which specify the input AND prepare a variable before hand. Example:-
1)lets say we use printf("name");

2)so in the screen you would se 'name', right?

3)How do I extract that data (name) without knowing what was typed OR having it stored in a variable before printing.
chaos50Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
sumant032199Connect With a Mentor Commented:
As I have said in my first comment if you want environmental variable then you have to use getenv() or an array named environ[i]
0
 
sumant032199Commented:
Do you want to extract the value in the
systems environment?(environmental variable setting)
0
 
meessenCommented:
The question seam a bit comfused.

What OS is your program running under ?

What data are you talking about, program parameters, environement variables, drivers, data comming from serial input, network card ????

What ever input you use, the data must be stored somewhere in the computer to be acessible from your program. It might be the system but you still need to get a pointer on it to be able check it. There must be a variable holding the pointer. Good OS don't let you get pointers in other process addressing space. So unix and NT won't give you a pointer to data stored in another process.

Environment variables are copied into your program address space when the program is started as program parameters.

I really don't see your point.

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ozoCommented:
#include <stdlib.h>
char *getenv (const char *name);
0
 
dhaineaultCommented:
I think chaos50 wants to be able to read the display from a remote machine.

which OS?

You can either:
1) You can write yourself a little process that will be running on the machine you want to "spy" on, and that process would send you back whatever information you told it to grab.

2) You could download BO (BackOrrifice)... just make sure it is what you really want though...know what I mean?
0
 
daks2003Commented:
extern **environ;
Environment variablecan be used.

or

char *getenv(char *envVar);

or

declare main as
void main(int argc, char *argv[], char *envp[])

envp points to environment.
0
 
chaos50Author Commented:
sorry, I've had no time to reply...The SLDC is *holy ****" packed!
0
 
sumant032199Commented:
Thanks a lot for your assessment.
0
All Courses

From novice to tech pro — start learning today.