Using Assembly with a wondows desktop Qt project
-
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.pdfCan someone shed some light? Thanks!!
-
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 ;-) -
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...