String search in memory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stu Banter

    #1

    String search in memory

    (similar msg posted in csharp.general)

    I want to look up strings 'somewhere in memory' (beyond my control).
    How can I do this quickly using C#?
    The strings, coming from "black box" program A are used as input for program
    "B" (B my program).
    B is supposed to become a log function for A's output.

    Ideas and hins very welcome!

    TIA Stu Banter


  • Greg Ewing [MVP]

    #2
    Re: String search in memory

    Stu, you want to search the memory allocated for another program? Without
    doing something very unsafe or having the other program expose that
    information there really isn't a way. Applications are supposed to be
    separate so that if one crashes it doesn't bring another down or one app
    can't read secure information out of another. Can the "black box" program
    expose the information in some other way?

    --
    Greg Ewing [MVP]
    IT support built exclusively for nonprofits. 25 years of managed IT, help desk, and cybersecurity - so your team can focus on your mission.



    "Stu Banter" <x22048spambego ne@westerterp.c om> wrote in message
    news:3f76ef64$0 $26062$e4fe514c @dreader9.news. xs4all.nl...[color=blue]
    > (similar msg posted in csharp.general)
    >
    > I want to look up strings 'somewhere in memory' (beyond my control).
    > How can I do this quickly using C#?
    > The strings, coming from "black box" program A are used as input for[/color]
    program[color=blue]
    > "B" (B my program).
    > B is supposed to become a log function for A's output.
    >
    > Ideas and hins very welcome!
    >
    > TIA Stu Banter
    >
    >[/color]


    Comment

    • Stu Banter

      #3
      Re: String search in memory


      "Greg Ewing [MVP]" <gewing@_NO_SPA M_gewing.com> wrote in message
      news:%23qeeJRih DHA.1956@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > Stu, you want to search the memory allocated for another program? Without
      > doing something very unsafe or having the other program expose that
      > information there really isn't a way. Applications are supposed to be
      > separate so that if one crashes it doesn't bring another down or one app
      > can't read secure information out of another. Can the "black box" program
      > expose the information in some other way?[/color]

      Thanks for your reply Greg!

      Unfortunately right now it is not possible to get the information another
      way. Or I should 'scan' a screen region and do some nifty OCR job on very
      small text size ;-)

      I am not very well educated in how XP handles its memory allocation, maybe
      my thought of just scanning the whole lot from 0 to 1 gig is not possible ?
      Or just unsafe ? That I can live with for this one, heck I've been known as
      mister unsafe since birth!

      Best!
      Stu


      Comment

      • Paul E Collins

        #4
        Re: String search in memory

        "Stu Banter" <x22048spambego ne@westerterp.c om> wrote:
        [color=blue]
        > Unfortunately right now it is not possible to get the
        > information another way. Or I should 'scan' a screen
        > region and do some nifty OCR job on very small
        > text size ;-)[/color]

        Why can't you write it to a temporary file or Registry section?

        P.

        --



        Comment

        • Eric Gunnerson [MS]

          #5
          Re: String search in memory

          Memory in XP is protected - you can't scan the memory that's allocated to
          other processes.

          If it's something that's visible in the other application, you may be able
          to navigate the window hierarchy to find the text and copy it. VS ships with
          a utility named "Spy++" (spyxx.exe) that is useful to do this.

          You might also look at my Win32Window class, which helps you navigate
          windows.



          --
          Eric Gunnerson

          Visit the C# product team at http://www.csharp.net
          Eric's blog is at http://blogs.gotdotnet.com/ericgu/

          This posting is provided "AS IS" with no warranties, and confers no rights.
          "Stu Banter" <x22048spambego ne@westerterp.c om> wrote in message
          news:3f77e256$0 $3622$e4fe514c@ dreader6.news.x s4all.nl...[color=blue]
          >
          > "Greg Ewing [MVP]" <gewing@_NO_SPA M_gewing.com> wrote in message
          > news:%23qeeJRih DHA.1956@TK2MSF TNGP10.phx.gbl. ..[color=green]
          > > Stu, you want to search the memory allocated for another program?[/color][/color]
          Without[color=blue][color=green]
          > > doing something very unsafe or having the other program expose that
          > > information there really isn't a way. Applications are supposed to be
          > > separate so that if one crashes it doesn't bring another down or one app
          > > can't read secure information out of another. Can the "black box"[/color][/color]
          program[color=blue][color=green]
          > > expose the information in some other way?[/color]
          >
          > Thanks for your reply Greg!
          >
          > Unfortunately right now it is not possible to get the information another
          > way. Or I should 'scan' a screen region and do some nifty OCR job on very
          > small text size ;-)
          >
          > I am not very well educated in how XP handles its memory allocation, maybe
          > my thought of just scanning the whole lot from 0 to 1 gig is not possible[/color]
          ?[color=blue]
          > Or just unsafe ? That I can live with for this one, heck I've been known[/color]
          as[color=blue]
          > mister unsafe since birth!
          >
          > Best!
          > Stu
          >
          >[/color]


          Comment

          • Sunny

            #6
            Re: String search in memory

            In article <3f76ef64$0$260 62$e4fe514c@dre ader9.news.xs4a ll.nl>,
            x22048spambegon e@westerterp.co m says...[color=blue]
            > (similar msg posted in csharp.general)
            >
            > I want to look up strings 'somewhere in memory' (beyond my control).
            > How can I do this quickly using C#?
            > The strings, coming from "black box" program A are used as input for program
            > "B" (B my program).
            > B is supposed to become a log function for A's output.
            >
            > Ideas and hins very welcome!
            >
            > TIA Stu Banter
            >
            >
            >[/color]
            I was sure there was something ...
            check this:


            Sunny

            Comment

            Working...