Question about hooking and simulating input in C++

G

gara.matt

Hi,

I was wondering if its possible to "hook" programs as in windows on
linux (ubuntu specifically.) I doubt it is as its a big security flaw,
but "hooking" is very useful for automating things I'd I'm
interested.

Also is it possible to simulate input through a mouse click or a
keystroke using c++ libraries? For example, this is possible through
the Java class awt.Robot. Documentation of this class can be found
here http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html. This
class is also really useful for automating things, and I was wondering
if the same thing or something like it exists in the c++ libraries on
linux (ubuntu.)
Thanks,

Matt
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Hi,

I was wondering if its possible to "hook" programs as in windows on
linux (ubuntu specifically.) I doubt it is as its a big security flaw,
but "hooking" is very useful for automating things I'd I'm
interested.

If it's Ubuntu specific you probably have to use a ubuntu-library.
Also is it possible to simulate input through a mouse click or a
keystroke using c++ libraries? For example, this is possible through
the Java class awt.Robot. Documentation of this class can be found
here http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html. This
class is also really useful for automating things, and I was wondering
if the same thing or something like it exists in the c++ libraries on
linux (ubuntu.)

Probably possible, look at the X-libraries.
 
J

James Kanze

I was wondering if its possible to "hook" programs as in windows on
linux (ubuntu specifically.) I doubt it is as its a big security flaw,
but "hooking" is very useful for automating things I'd I'm
interested.
Also is it possible to simulate input through a mouse click or a
keystroke using c++ libraries? For example, this is possible through
the Java class awt.Robot. Documentation of this class can be found
herehttp://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html. This
class is also really useful for automating things, and I was wondering
if the same thing or something like it exists in the c++ libraries on
linux (ubuntu.)

Within C++ itself, all you have is the iostreams. It's possible
to change the streambuf on cin, of course, but I don't think
that is really what you're looking for.

For anything concerning a GUI, you'd have to ask in a group
specialized for that GUI library. I'm not too sure what you're
asking, as I'm not familiar with the tools you mention. (I can
imagine how it might work in Java, but it would be in a higher
level layer than just the language or the OS---somewhere in AWT,
for example.) Under Unix, you might want to Google for pseudo
terminal or expect, but I'm not sure how they interact with X.
(Expect is often used for testing socket based applications, and
pseudo terminals for interactive ones.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top