Sign in to follow this  
Followers 0
Hollinar

Help getting text from hidden control

9 posts in this topic

I understand how to get text from a window and from a Control. The problem is, the control is nowhere to be found. I've tried using WinGetClassList, WinGetText for each entry of WinList, Using a delay and Alt+Tabbing into the window and using WinGetText("active"). Finally, I tried using the following code, thinking that perhaps it unloaded the text while it wasn't on top:

AutoItSetOption("WinTitleMatchMode", 4)
Global $var = WinList()
Global $var2[UBound($var)][UBound($var, 2) + 1]
Sleep(10000)
For $i = 1 to UBound($var) - 1
    $var2[$i][0] = $var[$i][0]
    $var2[$i][1] = $var[$i][1]
    $var2[$i][2] = WinGetText($var[$i][0])
Next
MsgBox(0, "...", "done getting text")
For $a = 1 to UBound($var2) - 1
    MsgBox(0, "Details", "Title=" & $var2[$a][0] & @LF & "Handle=" & $var2[$a][1] & @LF & "Text:" & @LF & $var2[$a][2])
Next

This code didn't help me either. The sleep allows me to alt+tab into the window. The code lists the text in every window, no matter if it's visible or not. I tried using Au3Info.exe as well, but that shows nothing for text(but it does get the proper Pixel color). I'm wondering if there was something I missed, or if what I'm trying to do is impossible.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

is this the internet.. or a browser???

if not... maybe someone here might know the program or how to work with it..

if you want to give the title/program name

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

What kind of window are you trying to get text from? Is it a particular application? A game, perhaps?

Share this post


Link to post
Share on other sites

Yeah, it's a game called Astonia 3... I'm working on a miner-bot but I need to be able to read the chat box.

Share this post


Link to post
Share on other sites

Quite hard to do using AutoIt's inherent *GetText functions. If you really need to read the chat box in a game, start learning how to read/manipulate the process' memory. Don't know of any other way that fits your needs.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Okay, using a debugger, I've found that the following sections of code contain the text in the chat box...

Dump 1:

CODE

-----------------------------------------------------------

0058D858 00 00 00 00 01 00 00 00 .......

0058D860 20 D9 5C 00 00 00 00 00 Ù\.....

0058D868 C8 15 00 00 00 59 5B 00 È...Y[.

0058D870 C8 3F 00 00 B0 36 00 00 È?..°6..

0058D878 00 00 00 00 F4 2B DE 00 ....ô+Þ.

0058D880 E2 C8 43 00 03 C9 43 00 âÈC.ÉC.

0058D888 00 00 00 00 00 00 00 00 ........

0058D890 EF 58 97 1A 00 00 00 00 ïX—....

0058D898 00 00 00 00 D7 84 32 0B ....ׄ2

0058D8A0 09 3A 00 4C 61 67 20 77 .:.Lag w

0058D8A8 69 74 68 69 6E 20 72 65 ithin re

0058D8B0 61 73 6F 6E 61 62 6C 65 asonable

0058D8B8 20 62 6F 75 6E 64 73 20 bounds

0058D8C0 61 67 61 69 6E 2E 20 41 again. A

0058D8C8 75 74 6F 2D 43 6F 6E 74 uto-Cont

0058D8D0 72 6F 6C 20 64 69 73 61 rol disa

0058D8D8 62 6C 65 64 2E 79 70 65 bled.ype

0058D8E0 20 2F 6C 61 67 20 61 67 /lag ag

0058D8E8 61 69 6E 29 20 62 65 66 ain) bef

0058D8F0 6F 72 65 20 79 6F 75 20 ore you

0058D8F8 63 6F 6D 70 6C 61 69 6E complain

0058D900 20 61 62 6F 75 74 20 6C about l

0058D908 61 67 21 09 34 00 4C 61 ag!.4.La

0058D910 67 20 65 78 63 65 65 64 g exceed

0058D918 73 20 73 79 73 74 65 6D s system

0058D920 20 6C 69 6D 69 74 73 2E limits.

0058D928 20 41 75 74 6F 2D 43 6F Auto-Co

0058D930 6E 74 72 6F 6C 20 74 61 ntrol ta

0058D938 6B 69 6E 67 20 6F 76 65 king ove

0058D940 72 2E 00 00 00 00 00 00 r.......

----------------------------------------------------------------

005918A0 00 00 00 00 09 15 00 4C ......L

005918A8 61 67 20 43 6F 6E 74 72 ag Contr

005918B0 6F 6C 20 53 65 74 74 69 ol Setti

005918B8 6E 67 73 3A 09 1A 00 4D ngs:..M

005918C0 61 78 2E 20 4C 61 67 20 ax. Lag

005918C8 5B 2F 4D 41 58 4C 41 47 [/MAXLAG

005918D0 5D 3A 20 30 20 73 65 63 ]: 0 sec

005918D8 2E 09 28 00 44 6F 6E 27 ..(.Don'

005918E0 74 20 75 73 65 20 42 61 t use Ba

005918E8 6C 6C 20 4C 69 67 68 74 ll Light

005918F0 6E 69 6E 67 20 5B 2F 4E ning [/N

005918F8 4F 42 41 4C 4C 5D 3A 20 OBALL]:

00591900 4F 66 66 2E 09 20 00 44 Off.. .D

00591908 6F 6E 27 74 20 75 73 65 on't use

00591910 20 42 6C 65 73 73 20 5B Bless [

00591918 2F 4E 4F 42 4C 45 53 53 /NOBLESS

00591920 5D 3A 20 4F 66 66 2E 09 ]: Off..

00591928 25 00 44 6F 6E 27 74 20 %.Don't

00591930 75 73 65 20 46 69 72 65 use Fire

00591938 62 61 6C 6C 20 5B 2F 4E ball [/N

00591940 4F 46 49 52 45 42 41 4C OFIREBAL

00591948 4C 5D 3A 20 4F 6E 2E 09 L]: On..

00591950 2A 00 44 6F 6E 27 74 20 *.Don't

00591958 75 73 65 20 4C 69 67 68 use Ligh

00591960 74 6E 69 6E 67 20 46 6C tning Fl

00591968 61 73 68 20 5B 2F 4E 4F ash [/NO

00591970 46 4C 41 53 48 5D 3A 20 FLASH]:

00591978 4F 66 66 2E 09 21 00 44 Off..!.D

00591980 6F 6E 27 74 20 75 73 65 on't use

00591988 20 46 72 65 65 7A 65 20 Freeze

00591990 5B 2F 4E 4F 46 52 45 45 [/NOFREE

00591998 5A 45 5D 3A 20 4F 6E 2E ZE]: On.

005919A0 09 1E 00 44 6F 6E 27 74 ..Don't

005919A8 20 75 73 65 20 48 65 61 use Hea

005919B0 6C 20 5B 2F 4E 4F 48 45 l [/NOHE

005919B8 41 4C 5D 3A 20 4F 66 66 AL]: Off

005919C0 2E 09 28 00 44 6F 6E 27 ..(.Don'

005919C8 74 20 75 73 65 20 4D 61 t use Ma

005919D0 67 69 63 20 53 68 69 65 gic Shie

005919D8 6C 64 20 5B 2F 4E 4F 53 ld [/NOS

005919E0 48 49 45 4C 44 5D 3A 20 HIELD]:

005919E8 4F 66 66 2E 09 20 00 44 Off.. .D

005919F0 6F 6E 27 74 20 75 73 65 on't use

005919F8 20 50 75 6C 73 65 20 5B Pulse [

00591A00 2F 4E 4F 50 55 4C 53 45 /NOPULSE

00591A08 5D 3A 20 4F 66 66 2E 09 ]: Off..

00591A10 29 00 44 6F 6E 27 74 20 ).Don't

00591A18 75 73 65 20 48 65 61 6C use Heal

00591A20 69 6E 67 20 50 6F 74 69 ing Poti

00591A28 6F 6E 73 20 5B 2F 4E 4F ons [/NO

00591A30 4C 49 46 45 5D 3A 20 4F LIFE]: O

00591A38 66 66 2E 09 26 00 44 6F ff..&.Do

00591A40 6E 27 74 20 75 73 65 20 n't use

00591A48 4D 61 6E 61 20 50 6F 74 Mana Pot

00591A50 69 6F 6E 73 20 5B 2F 4E ions [/N

00591A58 4F 4D 41 4E 41 5D 3A 20 OMANA]:

00591A60 4F 66 66 2E 09 28 00 44 Off..(.D

00591A68 6F 6E 27 74 20 75 73 65 on't use

00591A70 20 43 6F 6D 62 6F 20 50 Combo P

00591A78 6F 74 69 6F 6E 73 20 5B otions [

00591A80 2F 4E 4F 43 4F 4D 42 4F /NOCOMBO

00591A88 5D 3A 20 4F 66 66 2E 09 ]: Off..

00591A90 29 00 44 6F 6E 27 74 20 ).Don't

00591A98 75 73 65 20 52 65 63 61 use Reca

00591AA0 6C 6C 20 53 63 72 6F 6C ll Scrol

00591AA8 6C 20 5B 2F 4E 4F 52 45 l [/NORE

00591AB0 43 41 4C 4C 5D 3A 20 4F CALL]: O

00591AB8 66 66 2E 09 19 00 44 6F ff...Do

00591AC0 6E 27 74 20 4D 6F 76 65 n't Move

00591AC8 20 5B 2F 4E 4F 4D 4F 56 [/NOMOV

00591AD0 45 5D 3A 20 4F 6E 2E 09 E]: On..

00591AD8 14 00 41 75 74 6F 6D 61 .Automa

00591AE0 74 69 6F 6E 20 53 65 74 tion Set

00591AE8 74 69 6E 67 73 3A 09 24 tings:.$

00591AF0 00 41 75 74 6F 6D 61 74 .Automat

00591AF8 69 63 20 52 65 2D 42 6C ic Re-Bl

00591B00 65 73 73 20 5B 2F 41 55 ess [/AU

00591B08 54 4F 42 4C 45 53 53 5D TOBLESS]

00591B10 3A 20 4F 6E 2E 09 21 00 : On..!.

00591B18 41 75 74 6F 6D 61 74 69 Automati

00591B20 63 20 50 75 6C 73 65 20 c Pulse

00591B28 5B 2F 41 55 54 4F 50 55 [/AUTOPU

00591B30 4C 53 45 5D 3A 20 4F 6E LSE]: On

00591B38 2E 09 22 00 41 75 74 6F ..".Auto

00591B40 6D 61 74 69 63 20 54 75 matic Tu

00591B48 72 6E 69 6E 67 20 5B 2F rning [/

00591B50 41 55 54 4F 54 55 52 4E AUTOTURN

00591B58 5D 3A 20 4F 6E 2E 09 14 ]: On..

00591B60 00 50 72 6F 74 65 63 74 .Protect

00591B68 69 6F 6E 20 53 65 74 74 ion Sett

00591B70 69 6E 67 73 3A 09 2C 00 ings:.,.

00591B78 41 6C 6C 6F 77 20 6F 74 Allow ot

00591B80 68 65 72 73 20 74 6F 20 hers to

00591B88 62 6C 65 73 73 20 6D 65 bless me

00591B90 20 5B 2F 41 4C 4C 4F 57 [/ALLOW

00591B98 42 4C 45 53 53 5D 3A 20 BLESS]:

00591BA0 59 65 73 2E 09 0F 00 41 Yes...A

00591BA8 63 63 6F 75 6E 74 20 53 ccount S

00591BB0 74 61 74 75 73 3A 09 23 tatus:.#

00591BB8 00 59 6F 75 72 20 61 63 .Your ac

00591BC0 63 6F 75 6E 74 20 77 69 count wi

00591BC8 6C 6C 20 65 78 70 69 72 ll expir

00591BD0 65 20 69 6E 20 36 20 64 e in 6 d

00591BD8 61 79 73 2E 09 0D 00 54 ays....T

00591BE0 72 69 61 6C 20 41 63 63 rial Acc

00591BE8 6F 75 6E 74 00 00 00 00 ount....

----------------------------------------------------------

005958A8 09 4D 00 B0 63 39 41 75 .M.°c9Au

005958B0 63 74 69 6F 6E 3A 20 B0 ction: °

005958B8 63 31 37 43 6C 6F 73 65 c17Close

005958C0 77 61 72 B0 63 31 38 20 war°c18

005958C8 28 32 34 29 20 73 61 79 (24) say

005958D0 73 3A 20 22 75 20 73 68 s: "u sh

005958D8 6F 75 6C 64 6E 74 20 73 ouldnt s

005958E0 65 6C 6C 20 69 74 2C 20 ell it,

005958E8 61 74 20 6C 65 61 73 74 at least

005958F0 20 75 73 65 20 69 74 22 use it"

005958F8 3F 3F 22 20 70 61 72 72 ??" parr

00595900 79 20 32 20 69 6D 6D 20 y 2 imm

00595908 34 20 6D 61 6E 61 20 6F 4 mana o

00595910 72 62 73 20 2F 74 65 6C rbs /tel

00595918 6C 20 6D 65 20 70 6C 7A l me plz

00595920 21 21 21 21 22 00 3E 01 !!!!".>

00595928 00 04 00 05 64 64 64 98 ..ddd˜

00595930 E8 07 17 00 D8 19 00 D8 è.Ø.Ø

00595938 1F 00 E8 32 1A 00 D8 1F .è2.Ø

00595940 00 E8 33 1F 00 F8 9B 06 .è3.ø›

00595948 00 E8 34 00 E8 34 00 E8 .è4.è4.è

00595950 34 00 E8 34 00 E8 34 00 4.è4.è4.

00595958 E8 34 00 E8 34 00 E8 34 è4.è4.è4

00595960 00 E8 34 00 E8 34 00 E8 .è4.è4.è

00595968 34 00 E8 34 00 E8 34 00 4.è4.è4.

00595970 E8 34 00 E8 34 00 E8 34 è4.è4.è4

00595978 00 E8 34 00 12 00 00 00 .è4....

----------------------------------------------------------------

005AD8C0 09 0D 00 61 6C 69 61 73 ...alias

005AD8C8 52 44 20 2D 3E 20 31 30 RD -> 10

----------------------------------------------------------------

005B18C0 00 00 00 00 09 1A 00 54 ......T

005B18C8 75 72 6E 65 64 20 61 72 urned ar

005B18D0 74 69 66 69 63 69 61 6C tificial

005B18D8 20 6C 61 67 20 6F 66 66 lag off

005B18E0 2E 00 F8 D3 07 00 D8 00 ..øÓ.Ø.

005B18E8 E8 33 00 D8 00 E8 33 00 è3.Ø.è3.

005B18F0 D8 00 E8 33 00 D8 00 E8 Ø.è3.Ø.è

005B18F8 33 00 D8 00 E8 33 00 D8 3.Ø.è3.Ø

005B1900 00 E8 33 00 D8 00 E8 33 .è3.Ø.è3

005B1908 00 D8 00 E8 33 00 D8 00 .Ø.è3.Ø.

005B1910 E8 33 00 D8 00 E8 33 00 è3.Ø.è3.

005B1918 D8 00 00 00 00 00 00 00 Ø.......

----------------------------------------------------------------

005B58C8 09 35 00 B0 63 39 41 75 .5.°c9Au

005B58D0 63 74 69 6F 6E 3A 20 B0 ction: °

005B58D8 63 31 37 49 72 6F 78 61 c17Iroxa

005B58E0 B0 63 31 38 20 28 31 29 °c18 (1)

005B58E8 20 73 61 79 73 3A 20 22 says: "

005B58F0 69 6C 6C 20 67 69 76 65 ill give

005B58F8 20 75 20 31 35 6B 3F 22 u 15k?"

005B5900 00 D8 00 D8 00 D8 00 D8 .Ø.Ø.Ø.Ø

005B5908 00 E8 2F 00 D8 00 D8 00 .è/.Ø.Ø.

005B5910 D8 00 D8 00 A8 2A E8 06 Ø.Ø.¨*è

005B5918 00 D8 00 D8 00 D8 00 A7 .Ø.Ø.Ø.§

005B5920 2A 3D 00 00 00 3E 01 01 *=...>

005B5928 08 00 05 64 64 64 E8 07 .dddè

005B5930 00 D8 00 D8 00 E8 32 00 .Ø.Ø.è2.

005B5938 D8 00 E8 33 00 E8 E4 00 Ø.è3.èä.

005B5940 E8 34 00 E8 34 00 E8 34 è4.è4.è4

005B5948 00 E8 34 00 E8 34 00 E8 .è4.è4.è

005B5950 34 00 E8 34 00 E8 34 00 4.è4.è4.

005B5958 E8 34 00 E8 34 00 E8 34 è4.è4.è4

005B5960 00 E8 34 00 E8 34 00 E8 .è4.è4.è

005B5968 34 00 E8 34 00 E8 34 00 4.è4.è4.

005B5970 E8 34 00 18 03 00 00 00 è4....

Dump 2

CODE

0058D858 00 00 00 00 01 00 00 00 .......

0058D860 1F D9 5C 00 00 00 00 00 Ù\.....

0058D868 3A 07 00 00 E1 18 5B 00 :..á[.

0058D870 E3 3F 00 00 A2 0E 00 00 ã?..¢..

0058D878 00 00 00 00 F4 2B DE 00 ....ô+Þ.

0058D880 E2 C8 43 00 03 C9 43 00 âÈC.ÉC.

0058D888 00 00 00 00 00 00 00 00 ........

0058D890 3B FC EA 46 00 00 00 00 ;üêF....

0058D898 00 00 00 00 AE 88 32 0B ....®ˆ2

0058D8A0 09 0D 00 61 6C 69 61 73 ...alias

0058D8A8 52 44 20 2D 3E 20 31 30 RD -> 10

-------------------------------------------------------------

005918A0 00 00 00 00 07 0F 7F 00 .....

005918A8 81 00 B8 E2 04 A7 32 3D .¸â§2=

005918B0 00 00 00 73 02 01 08 00 ...s.

005918B8 05 64 64 64 18 07 00 00 ddd..

------------------------------------------------------------

005C18D0 00 00 00 00 18 0A 00 B0 ......°

005C18D8 63 39 41 75 63 74 69 6F c9Auctio

005C18E0 6E 3A 20 B0 63 31 37 4D n: °c17M

005C18E8 61 67 69 63 62 75 73 B0 agicbus°

005C18F0 63 31 38 20 28 31 29 20 c18 (1)

005C18F8 73 61 79 73 3A 20 22 73 says: "s

005C1900 65 6C 6C 20 2B 31 34 20 ell +14

005C1908 65 63 63 20 72 69 6E 67 ecc ring

005C1910 20 75 65 20 20 20 6D 62 ue mb

005C1918 20 35 6B 22 00 00 00 00 5k"....

I'm afraid this is beyond my current scope of understanding, so I must ask for help on how to develop a function that would search the proper adresses for a string, then return the next 20-30 characters after it. Normally I prefer to learn these things myself(I'm self-taught in PHP, MySQL, HTML, CSS fairly well and VB and C# I know the basics of), but as I said, this is beyond my scope of understanding like the moon is out of arm's reach :wacko:

Any help you can offer would be great, and if needed I can zip up the two dumps I got those adresses from and upload to rapidshare or something. Thanks.

Edited by Hollinar

Share this post


Link to post
Share on other sites

Use w0uter's memory functions to edit the memory:

http://www.autoitscript.com/forum/index.php?showtopic=19329

It appears you have the memory addresses, so all you need now is to input the changes into his memory functions to change the data and hopefully not crash the program. :P


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Ahh, but I don't need to modify the memory at all, just read it and look for a string in it, the string being a variation of "Macro Daemon", I would have to get a dump of it most likely... But anyways, If you know of a function that can search a range of adresses for a string and return the text following that string, please do tell. Perhaps a variation of the following code, searching a wide range?

AutoItSetOption("WinTitleMatchMode", 2)
$PID = WinGetProcess("Astonia")
Func CheckMem($start, $end)
    $current = $start
    While $current <> $end
        $i_Open = _MemOpen($PID)
        $searchtext = _MemRead($i_Open, $current)
        _MemClose($i_Open)
        $current = $current + 1
        If StringInStr($searchtext, "Macro Daemon") Then
            $current = $end
        EndIf
    WEnd
EndFunc

Please note, I wrote this in-browser, so I'm not sure of it's validity.

Problem already... anyone know how to incriment a hex? can i do $current = $current + 1? Even if not, I've edited it into the code area...

Edited by Hollinar

Share this post


Link to post
Share on other sites

Sorry about my double post, but it won't let me re-edit my previous one. This is the code I have now, along with the _Mem functions at http://www.autoitscript.com/forum/index.php?showtopic=19329

Func CheckMem($processid, $start, $finish, $text)
    $current = Dec($start)
    $end = Dec($finish)
    $found = 0
    MsgBox(0, "Starting search", "Starting search..." & @CRLF & "Variables passed to the script: " & @CRLF & $processid & @CRLF & $start & @CRLF & $finish & @CRLF & $text)
    Sleep(10000)
    $i_Open = _MemOpen($processid)
    While $current <> $end
        $searchtext = _MemRead($i_Open, Hex($current))
        $current = $current + 1
        If StringInStr($searchtext, $text) Then
            MsgBox(0, "found", "Found It!" & @CRLF & "Adress: " & Hex($current) & @CRLF & "Text: " & $searchtext)
            $current = $end
            $found = 1
        EndIf
    WEnd
    _MemClose($i_Open)
    If $found = 0 Then
        MsgBox(0, "not found", "Error! It wasn't found... Variables passed to the script: " & $processid & @CRLF & $start & @CRLF & $finish & @CRLF & $text)
    EndIf
EndFunc
Call("CheckMem", WinGetProcess("Astonia"), 0x0044D000, 0x0044E000, "RING")
Exit

Now, I first used this to search the memory of the game itself. It's extremely slow(takes about 10 secs to scan that little bit with window inactive, 25-30 secs to scan with it active), but it found it. OllyDbg shows the string "RING" to be at 0x0044D1B8 - 0x0044D1BF, and the start of the code is at 0x0044D000.

The script returns the following when it gets to it:

Found it!
Adress: 04510133
Text: RING

After this it exits as intended. I have two problems currently. The execution time is HORRENDOUS, and the Adress fails to come out properly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0