How to check the version of Qt a program is built on?

If you got an app that was built with Qt lib, how do you get the version of Qt? Suppose you only have the .exe file, you have not the source code that builds the .exe, how to check the version of the Qt libs the exe was linked against? To get the qt version of the runtime lib, you can use GDB to inspect the exe. You have several methods to get the Qt version from the executable:

  • check the global variable qtHookData. This is an array which is supposed to store the addresses of some callback functions. But the third element is actually the qt version number:
    (gdb) python print(gdb.lookup_symbol('qtHookData')[0].value()[2])
    330753

    Here 330753 is 0x050c01, which means Qt version 5.12.1.

    The following GDB python API gets the same result:

    (gdb) python print(str(gdb.parse_and_eval('((void**)&qtHookData)[2]')))
    0x50c01
  • call the global function qVersion in GDB.
    (gdb) p qVersion()
    $1 = 0x668ca3e1 <qt_meta_stringdata_QPauseAnimation+225> "5.12.1"
    
    (gdb) python print(gdb.parse_and_eval("qVersion()"))
    0x668ca3e1 <qt_meta_stringdata_QPauseAnimation+225> "5.12.1"
    
    (gdb) python print(gdb.lookup_symbol("qVersion")[0].value()())
    0x668ca3e1 <qt_meta_stringdata_QPauseAnimation+225> "5.12.1"

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply