• C

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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
ozoCommented:
#include <stdlib.h>
char *getenv (const char *name);
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
sumant032199Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.