How to hook a XDrawString or a XDrawText - Xwindows

This is a discussion on How to hook a XDrawString or a XDrawText - Xwindows ; Hello, I need to hook a XDrawString or a XDrawText in a tier application, in order to retrieve the text which is displayed in the client window, in order to process this text. Does someone knows how to do that ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: How to hook a XDrawString or a XDrawText

  1. How to hook a XDrawString or a XDrawText

    Hello,
    I need to hook a XDrawString or a XDrawText in a tier application, in
    order to retrieve the text which is displayed in the client window, in
    order to process this text.
    Does someone knows how to do that please ?

  2. Re: How to hook a XDrawString or a XDrawText

    On Nov 28, 3:27 pm, Alain wrote:
    > Hello,
    > I need to hook a XDrawString or a XDrawText in a tier application, in
    > order to retrieve the text which is displayed in the client window, in
    > order to process this text.
    > Does someone knows how to do that please ?


    What do you mean by "hook"? What do you mean by "tier application"?

    Neither XDrawString nor XDrawText are of any use to retrieve text
    displayed anywhere.

    Tell us what it is you really want to do.
    --
    Fred Kleinschmidt

  3. Re: How to hook a XDrawString or a XDrawText

    On 2007-11-29, fred.l.kleinschmidt@boeing.com wrote:
    > On Nov 28, 3:27 pm, Alain wrote:
    >> Hello,
    >> I need to hook a XDrawString or a XDrawText in a tier application, in
    >> order to retrieve the text which is displayed in the client window, in
    >> order to process this text.
    >> Does someone knows how to do that please ?

    >
    > What do you mean by "hook"? What do you mean by "tier application"?
    >
    > Neither XDrawString nor XDrawText are of any use to retrieve text
    > displayed anywhere.


    I guess he wants to intercept the XDrawText/String calls to see what
    the application is drawing? Thats not an issue of X-Windows. Its
    generally an issue of the loader used by the operating system and
    the details vary between different file formats used in executables
    and shared libraries. So the question becomes 'How can I hook a function
    in ELF binaries (most Unix systems)' or `How can I hook a function in
    XCOFF binaries (some other Unix systems), etc. Neither of these questions
    can be answered in this group.

    For ELF, see LD_PRELOAD in the linker documentation.

    --- Jan

  4. Re: How to hook a XDrawString or a XDrawText

    In comp.windows.x, Alain

    wrote
    on Thu, 29 Nov 2007 00:27:24 +0100
    :
    > Hello,
    > I need to hook a XDrawString or a XDrawText in a tier application, in
    > order to retrieve the text which is displayed in the client window, in
    > order to process this text.
    > Does someone knows how to do that please ?


    If this is a client application over which you have some
    control, one might consider changing the application to
    use a text widget that understands cut and paste, instead
    of static text display.

    If this is a client application over which you have *no*
    control, one might want to research the X protocol and
    implement or modify a proxy (Xnest might be a good starting
    point, as it implements "X-in-a-box") that can intercept
    what you need. One issue with this approach is that it
    involves a fair amount of additional machinery, though,
    especially if one throws window management into the mix.
    Window managers tend to draw their own text (title bars
    and flyovers); I'm not sure how to distinguish the two.

    --
    #191, ewill3@earthlink.net
    Windows. Multi-platform(1), multi-tasking(1), multi-user(1).
    (1) if one defines "multi" as "exactly one".

    --
    Posted via a free Usenet account from http://www.teranews.com


  5. Re: How to hook a XDrawString or a XDrawText

    On Nov 29, 10:00 am, The Ghost In The Machine
    wrote:

    > If this is a client application over which you have *no*
    > control, one might want to research the X protocol and
    > implement or modify a proxy (Xnest might be a good starting
    > point, as it implements "X-in-a-box") that can intercept
    > what you need.



    I think Xnest is a rather heavyweight starting point. Something which
    understands X, but only does something minor to it before passing it
    on would be a better start. I think mxconns could be a good place to
    check.

    -Ed

  6. Re: How to hook a XDrawString or a XDrawText

    Hello,

    Thanks a lot for your answers all of you.

    I am using a web/java application on which I have no control. The
    application logs the activity - the results of my interactions with the
    interface - in a subwindow as scrolling text. This text cannot be
    copy/pasted. I want to retrieve this text each time the log is updated for
    archiving needs and offline analyses. To explain the story, the provider
    of this application - an on line game - offers this archiving
    functionality - for storing the play - under MS Windows in a richclient
    application : replay, stats. For the other OS, they only offer a limited
    web/java client.

    I have made the assumptions that :
    1) the text is written in the log window using JRE text functionalities.
    2) JRE for Linux/X11 uses XDrawString or XDrawText.
    3) catching XDrawString or XDrawText with a hook, after having identified
    the window ID would enable to get the text object

    Are my assumptions correct ? Unfortunatly, it is also possible that the
    text is written by the application using JRE draw-text functionalities and
    here, I would be in trouble. By the way, I don't know java.

    Best regards,

    Alain.

+ Reply to Thread