Inject .dll into Qt and call functions
-
@Johannes-S GammaRay needs to be compiled for exactly the Qt version you are using in the application you are debugging (and on most platforms even with the same compiler and compiler settings)
@JulienMaille Yeah I figured that out, but I wasn't even able to start GammaRay without attaching it to anything...
-
Thank you very much, all of you who helped me here!
I finally got it to work today. It was the TableLayoutWidget, which I had tried to resize before, but I made a stupid mistake...I checked if the className was equal to "TableLayoutWidget" and resized only if it was. However, since I received the classname as a const char* the comparison to a string always failed and nothing happened...So now all thats left to do is to find a way to easily communicate with the process to resize windows without reinjecting a .dll every time.
Thanks again!
EDIT: Do you know if there's a way to automatically subclass (SetWindowLong with a new WndProc) all windows of a process?
-
Thank you very much, all of you who helped me here!
I finally got it to work today. It was the TableLayoutWidget, which I had tried to resize before, but I made a stupid mistake...I checked if the className was equal to "TableLayoutWidget" and resized only if it was. However, since I received the classname as a const char* the comparison to a string always failed and nothing happened...So now all thats left to do is to find a way to easily communicate with the process to resize windows without reinjecting a .dll every time.
Thanks again!
EDIT: Do you know if there's a way to automatically subclass (SetWindowLong with a new WndProc) all windows of a process?
@Johannes-S
I'm glad it worked.So now all thats left to do is to find a way to easily communicate with the process to resize windows without reinjecting a .dll every time.
This may not be possible, although don't hold me to that statement.
Do you know if there's a way to automatically subclass (SetWindowLong with a new WndProc) all windows of a process?
I have no clue what you're talking about, but it's probably just me. I haven't developed for Windows for quite a lot of years.
Kind regards.
-
Hi, sorry for the bump. I am upping this because I'd like to share some more thoughts about this topic with @Johannes-S. I hope I didn't break any rules.
-
@Johannes-S
hi , i use CreateRemoteThread to inject a dll into a qt application ,after QCoreApplication::instance()->installEventFilter (this);
eventFilter doesnt work... i dont know why...please help -
@Johannes-S
hi , i use CreateRemoteThread to inject a dll into a qt application ,after QCoreApplication::instance()->installEventFilter (this);
eventFilter doesnt work... i dont know why...please help@yue-feng said in Inject .dll into Qt and call functions:
please help
How? You don't provide much information.
Did you verify that QCoreApplication::instance()->installEventFilter (this) is called?
If it is called did you do any debugging to see whether you event filter is called? -
@yue-feng said in Inject .dll into Qt and call functions:
please help
How? You don't provide much information.
Did you verify that QCoreApplication::instance()->installEventFilter (this) is called?
If it is called did you do any debugging to see whether you event filter is called? -
@jsulm
i tested yesterday, the reason why eventFilter doesnt work is that the ptr get from QCoreApplication::instance() is nullptr.....
i think i use QCoreApplication::instance() in a wrong place...@yue-feng said in Inject .dll into Qt and call functions:
i think i use QCoreApplication::instance() in a wrong place
Yes, looks like you use it before QCoreApplication instance is created.
-
@yue-feng said in Inject .dll into Qt and call functions:
i think i use QCoreApplication::instance() in a wrong place
Yes, looks like you use it before QCoreApplication instance is created.