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. Using Assembly with a wondows desktop Qt project
Forum Updated to NodeBB v4.3 + New Features

Using Assembly with a wondows desktop Qt project

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 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.
  • J Offline
    J Offline
    jediengineer
    wrote on last edited by
    #1

    Hi all, I'm using Qt5.2 on a Windows 7 x64 platform (MinGW) and I'm writing a program that needs to be hard coded it to a processor ID. From what I've found, Qt does not have support for accessing the processor information and so it must be done manually (correct me if I'm wrong). I just can't seem to find any documentation explaining how to run assembly commands within Qt. I've started with this:

    @
    asm volatile(//asm code)
    @

    I read that this was the specific format for MinGW, but it seems that the compiler doesn't accept any of the assembly code I enter. These have been my references for accessing the information, and for using the asm code:

    https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended-Asm

    http://stackoverflow.com/questions/6877545/computerid-in-qt/24326328#24326328
    https://software.intel.com/en-us/forums/topic/308483
    http://download.intel.com/design/PentiumIII/applnots/24512501.pdf

    Can someone shed some light? Thanks!!

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      The syntax is correct, why you need asm is more the question. I tried this:
      @
      asm ("nop");
      @
      in a constructor and in a C included file, both lines do not give compile errors.
      I never heard of anyone combining C++ and asm before ;-)

      Greetz, Jeroen

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jediengineer
        wrote on last edited by
        #3

        I'm using it for a small, basic copy protection. The people getting this program are smart enough to change a mac address, but not smart enough to decompile and crack a program. So I want to retrieve the CPU serial number for verification. Those links gave me the answer but I was having trouble utilizing the asm with gcc. apparently it's a little different...

        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