Solved Need help with automation \ finding string var

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
Here is a software written in Qt 4.8.2
I need to get the money value of the selected row. As I see I can scan in memory trying to find the string at the right ( red arrow ) or also actually I can click on that item ( blue box) by hand and do a ctrl+c to and copy string to clipboard from selected item...


https://i.imgur.com/aX8hxku.png
But I have 3 problems with these 2 different solutions

1)I tried the easyest one , to click on that item and send that window handle Ctrl+C using SendMessage\PostMessage but that for some reason was not working .. If smb has a 100% working code for sendig key combination to a background window , I will be happy to try it out. I spend alot of time researching \ googling trying and nothing worked..
2) Second problem is if I would try to use clipboard by myself ... before sending Ctrl+C to the app I will need to save and resotre it ... from my code
3) It would be better to read the value of a variable ( red string ) but I can't find it in the memory using CheatEngine 6.6 I do a memory search and then click on other item in the table , so that the selected row changes and that string on the right also changes and no string variable are changed or there is crap in them some times \ randomly
--------------------------------------------------

So how should I find that string var on the right ( red arrow ) ?
I can find the tables values ( cell mony values and change them from CheatEngine) but it would be hard to read for me from the code because this is a dynamic table . So it will be not the best idea for me I think...
Thx for reading this.. I will be glad to recieve any help on sending Ctrl+C using SendMessage\PostMessage etc or help on searching that string variable
 

Obsta

Jr.Hacker
Meme Tier VIP
Jan 27, 2014
394
2,978
17
Tessearact is a google lib ... it helps to get data from screenshots \ pictures, Basically helps to retrieve text from image.
In my case it was not working out of the box correctly , I had to teach it to recognize letteres \ numbers correctly for my project.
But right now I have another issue with similar app.

This app is made with some game engine and is actually rendered using directx \ opengl and that function that I had used for Qt app actually doesn't work it gives a blank screen

Maybe if u look at .dll files can u figureout how can I take a screenshot from it ? I think I should search for some opengl hook ? When I make alt+prntscrn It actually works , but when I use my function
the it is black.. thx.

So basically I wanted to use the same approach , take a screenshot pass it to tessearct and work with this data , but now I have a problem on the stage of screenshot making
You're over complicating it, just take a snapshot using the window handle to your game.
Stack Overflow
First result on google, keep it simple.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Sounds complicated but totally doable, What's wrong with finding a pointer to the table variable and using that?
 

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
I made a video so that it might be easyer 4 you to help me... thx
https://youtu.be/Uby-8baXnxU

I actually could find that string var on the "right"
But when I click on the other row , the memory of the " Let's say " QString , ( the pointer inside of it ) is reallocated , in order to fit the size of new string....
So somehow I think we can find the address of that QString var ?... or any other Ideas ? Thx for help
 

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
I think that I will make a screenshot using winapi and then I will use tessaract in order to get from rectangle of interest (roi) text I need
 

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
Tessearact is a google lib ... it helps to get data from screenshots \ pictures, Basically helps to retrieve text from image.
In my case it was not working out of the box correctly , I had to teach it to recognize letteres \ numbers correctly for my project.
But right now I have another issue with similar app.

This app is made with some game engine and is actually rendered using directx \ opengl and that function that I had used for Qt app actually doesn't work it gives a blank screen

Maybe if u look at .dll files can u figureout how can I take a screenshot from it ? I think I should search for some opengl hook ? When I make alt+prntscrn It actually works , but when I use my function
the it is black.. thx.

So basically I wanted to use the same approach , take a screenshot pass it to tessearct and work with this data , but now I have a problem on the stage of screenshot making


C++:
QImage makeScreenshot(HWND handle)
{
    RECT rcSrc;
    HDC hDC, hSrcDC;
    HBITMAP hBmp;
    GetWindowRect(handle, &rcSrc);

    hDC = GetDC(handle);
    hSrcDC = CreateCompatibleDC(NULL);
    hBmp = CreateCompatibleBitmap(hDC, rcSrc.right - rcSrc.left, rcSrc.bottom - rcSrc.top);

    SelectObject(hSrcDC, hBmp);
    PrintWindow(handle, hSrcDC, 0);

    BitBlt(
        hDC,
        0,
        0,
        rcSrc.right - rcSrc.left,
        rcSrc.bottom - rcSrc.top,
        hSrcDC,
        0,
        0,
        SRCCOPY);
    QImage img = QtWin::fromHBITMAP(hBmp).toImage();
    img = convertToGray(&img);
    DeleteObject(hBmp);
    DeleteDC(hSrcDC);
    ReleaseDC(handle, hDC);

    return img;
}

 

PwndDepot

I has a status
Dank Tier VIP
Trump Tier Donator
Dank Tier Donator
Nov 5, 2014
239
7,748
19
Rake;45837 said:
I did google and failed :(
In his defense, the full name of it is TesseractOCR. Tesseract by itself is a geometery thing :p
 

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
You're over complicating it, just take a snapshot using the window handle to your game.
Stack Overflow
First result on google, keep it simple.
U r right in some way
But I hv mentioned that I used the code that worked for the Qt app , but it is not working for a Rendered on the GPU window \ game
here is the code of screenshot function
C++:
QImage makeScreenshot(HWND handle)
{
    RECT rcSrc;
    HDC hDC, hSrcDC;
    HBITMAP hBmp;
    GetWindowRect(handle, &rcSrc);
 
    hDC = GetDC(handle);
    hSrcDC = CreateCompatibleDC(NULL);
    hBmp = CreateCompatibleBitmap(hDC, rcSrc.right - rcSrc.left, rcSrc.bottom - rcSrc.top);
 
    SelectObject(hSrcDC, hBmp);
    PrintWindow(handle, hSrcDC, 0);
 
    BitBlt(
        hDC,
        0,
        0,
        rcSrc.right - rcSrc.left,
        rcSrc.bottom - rcSrc.top,
        hSrcDC,
        0,
        0,
        SRCCOPY);
    QImage img = QtWin::fromHBITMAP(hBmp).toImage();
    img = convertToGray(&img);
    DeleteObject(hBmp);
    DeleteDC(hSrcDC);
    ReleaseDC(handle, hDC);
 
    return img;
}
Here is the resulting screenshot that I actully get if you will google for "BitBlt black screenshot" u will find out interesting info
Basically u will find out that u should dll inject to opengl or d3d and make a hook in order to copy a frame ...
I.e u can add game window in OBS studio as a usual window and u will also get a Black Screen , but if u would add a game window as a game , obs will hook it and get frames from OGL\D3D directly
So the only right solution for this is to hook OGL in my case

What I need to achive: Windowed app should be running in the background and I should be able to take screenshots of it and controll it sendig commands using winapi ( SendMessage )
I did that for Qt app , everything is ok. But for this next app which is rendered on GPU I'm currently on stage of taking screenshot, I hv figured out that It uses OpenGL and so from this point I will need to findout source code that can help me with OpenGL hooking getting frames etc

 
Last edited:

LongJmp

Newbie
Full Member
Oct 13, 2015
9
82
0
I have onother problem . I have managed to hook and get screenshot but.... on my pc where I have external GTX 950
But on the PC that is runnning under Intel HD Graphics ( GPU build in to CPU ) id doesn't want to hook ( msi afterburner doesn't want to attach, and obs doesn't want to attach as a game window) and also when I take a screenshot with fucntion mentioned above ^ I get a black screen but when I add this game window to obs as a usual "window" it is able to get picture from it ... do u hv any ideas , I need to go and read obs src files ?

I need to take screenshot of an app that is running in background , it's gpu based and it is running on pc with builled in GPU .
On pc with externall gpu it is possible , on pc with builed in GPU it doesn't want to hook.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods