Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT dll and winapi
Forum Updated to NodeBB v4.3 + New Features

QT dll and winapi

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 408 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TomNow99
    wrote on last edited by TomNow99
    #1

    Hi,

    OS: Win 10

    I created dll using QT. In this dll I have 4 functions:

    1. hook(), where I have only one command: SetWindowsHookEx()
    2. unhook(), where I have only one command: UnhookWindowsHookEx()
    3. DllMain(), where I don't have many interesting things, only set variables :)
    4. callback function with hook code

    I created example.exe app, where I get this dll and execute functions hook() and unhook(). My goal is to have global WH_CBT hook. In callback function in dll i have write to file on Desktop text with the name of App, which go to this callback function to check is that hook is really global. When I run my QT apps, which I wrote and run them ( from qt creator or from desktop ) I see that apps are infected by dll. Perfect. But when I run other apps I don't see their names. I tried run for example Oracle Virtual Box. My dll is 64 bits and Oracle VB is 64 bits, so my dll should infected VB too. Why this doesn't work? Maybe because of that dll is created by QT?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Something I do not get, how is that dll supposed to be injected in your other processes ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TomNow99
        wrote on last edited by
        #3

        @SGaist I don't understand you question, so I show you my code :) I ask about that in other forum:

        https://stackoverflow.com/questions/63113636/how-to-set-global-hook-wh-cbt-in-winapi

        When the fourth arg in SetWindowsHookEx will be 0, my dll should be ijected to other processes.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Does it work if you do not use any Qt code in your .dll ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved