Loading ...
Sorry, an error occurred while loading the content.
 

serial number - windows or mother board

Expand Messages
  • Onesild
    Is there any way to find out the serial number of the windows that we are using or the serial number of the motherboard, using Liberty? onesild
    Message 1 of 16 , Jul 27, 2011
      Is there any way to find out the serial number of the windows that we are using or the serial number of the motherboard, using Liberty?
      onesild
    • Stefan Pendl
      ... The Windows product key can be retrieved, but I never heard of a serial number for Windows. See http://basic.wikispaces.com/CassioFerreira To retrieve
      Message 2 of 16 , Jul 27, 2011
        >
        > Is there any way to find out the serial number of the windows
        > that we are using or the serial number of the motherboard,
        > using Liberty?
        > onesild
        >

        The Windows product key can be retrieved, but I never heard of a serial number for Windows.
        See http://basic.wikispaces.com/CassioFerreira

        To retrieve system information, you can use third party DLLs.
        See http://soft.tahionic.com/download-hdd_id/documentation/how%20to%20call%20it-LibertyBasic.html


        ---
        Stefan Pendl
        http://stefanpendl.runbasichosting.com/

        Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
        Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

        Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

        Books at http://www.lulu.com/ and http://www.amazon.com/
        Alyce Watson ... APIs for Liberty BASIC
        Carl Gundel .... Beginning Programming with Liberty BASIC

        Windows 7 Home Premium 64-bit SP1
        AMD Turion X2 RM-70 2GHz, 4GB RAM
      • John
        Yeah, i ve been trying to get this secret for years. There was one DLL call that sort-of worked, except it returned 2 different values - depending on if you
        Message 3 of 16 , Jul 27, 2011
          Yeah, i've been trying to get this secret for years. There was one DLL call that sort-of worked, except it returned 2 different values - depending on if you restarted the program or something. Could never tell. It only returned 2 though.

          But still, you would think that the Gods at Intel (and others) would allow operating system people (like Microsoft) to know some static place/s where a string of bytes are stored. OR Microsoft would allow programming people (like Smalltalk) to access something - even a hash value of the windows serial num would be fine, if they felt we should not have access to the serial num itself.

          Every now and then I get myself excited about programming, and get back into it - but then I run up against the same old brick wall. How can I copy protect my work?

          Of course, this method means keeping up with users if their computer crashes and they need to reinstall, or they simply upgrade to a newer computer and so on. But I don't mind that. I mean you would get an idea if a user changes computers 17 times in 3 months, you know?
        • Lorne Russell
          I use the hard drive serial number which can be extracted using this code: hardDrive$=DefaultDir$ x=instr(hardDrive$, ) hardDrive$=left$(hardDrive$,x)
          Message 4 of 16 , Jul 27, 2011
            I use the hard drive serial number which can be extracted using this code:

            hardDrive$=DefaultDir$
            x=instr(hardDrive$,"\")
            hardDrive$=left$(hardDrive$,x)
            hardDriveSerial = getHDSerial(hardDrive$)
            print hardDriveSerial
            end

            function getHDSerial(lpRootPathName$)
            struct lpVolumeSerialNumber,SerialNumber as long
            struct lpMaxComponentLength, ComponentLength as long
            struct lpFileSystemFlags,SystemFlags as long

            lpVolumeNameBuffer$ = space$(255)
            nVolumeNameSize = len(lpVolumeNameBuffer$)
            lpFileSystemNameBuffer$ = space$(255)
            nFileSystemNameSize = len(lpFileSystemNameBuffer$)

            calldll #kernel32, "GetVolumeInformationA", _
            lpRootPathName$ as ptr, _
            lpVolumeNameBuffer$ as ptr, _
            nVolumeNameSize as long, _
            lpVolumeSerialNumber as struct, _
            lpMaxComponentLength as struct, _
            lpFileSystemFlags as struct, _
            lpFileSystemNameBuffer$ as ptr, _
            nFileSystemNameSize as long, _
            result as long
            getHDSerial = lpVolumeSerialNumber.SerialNumber.struct
            end function

            Regards,
            Lorne Russell


            From: John
            Sent: Wednesday, July 27, 2011 7:54 PM
            To: libertybasic@yahoogroups.com
            Subject: [libertybasic] Re: serial number - windows or mother board



            Yeah, i've been trying to get this secret for years. There was one DLL call that sort-of worked, except it returned 2 different values - depending on if you restarted the program or something. Could never tell. It only returned 2 though.

            But still, you would think that the Gods at Intel (and others) would allow operating system people (like Microsoft) to know some static place/s where a string of bytes are stored. OR Microsoft would allow programming people (like Smalltalk) to access something - even a hash value of the windows serial num would be fine, if they felt we should not have access to the serial num itself.

            Every now and then I get myself excited about programming, and get back into it - but then I run up against the same old brick wall. How can I copy protect my work?

            Of course, this method means keeping up with users if their computer crashes and they need to reinstall, or they simply upgrade to a newer computer and so on. But I don't mind that. I mean you would get an idea if a user changes computers 17 times in 3 months, you know?





            [Non-text portions of this message have been removed]
          • Stefan Pendl
            ... As the name of the variable implies, this is not the serial number of the physical harddisk, but the one of the formatted volume. This serial number will
            Message 5 of 16 , Jul 28, 2011
              >
              > I use the hard drive serial number which can be extracted
              > using this code:
              >
              > hardDrive$=DefaultDir$
              > x=instr(hardDrive$,"\")
              > hardDrive$=left$(hardDrive$,x)
              > hardDriveSerial = getHDSerial(hardDrive$)
              > print hardDriveSerial
              > end
              >
              > function getHDSerial(lpRootPathName$)
              > struct lpVolumeSerialNumber,SerialNumber as long
              > struct lpMaxComponentLength, ComponentLength as long
              > struct lpFileSystemFlags,SystemFlags as long
              >
              > lpVolumeNameBuffer$ = space$(255)
              > nVolumeNameSize = len(lpVolumeNameBuffer$)
              > lpFileSystemNameBuffer$ = space$(255)
              > nFileSystemNameSize = len(lpFileSystemNameBuffer$)
              >
              > calldll #kernel32, "GetVolumeInformationA", _
              > lpRootPathName$ as ptr, _
              > lpVolumeNameBuffer$ as ptr, _
              > nVolumeNameSize as long, _
              > lpVolumeSerialNumber as struct, _
              > lpMaxComponentLength as struct, _
              > lpFileSystemFlags as struct, _
              > lpFileSystemNameBuffer$ as ptr, _
              > nFileSystemNameSize as long, _
              > result as long
              > getHDSerial = lpVolumeSerialNumber.SerialNumber.struct
              > end function
              >

              As the name of the variable implies, this is not the serial number of the physical harddisk, but the one of the formatted volume.
              This serial number will change whenever you format the drive, so you apply a new volume to it.

              It is very common to license based on the MAC address of the network adapter or using multiple IDs of the systems hardware and
              create a hash from that.
              The MAC address is unique across the globe, so this is quite save, and a network adapter does not crash as often as a harddisk.

              A personalized copy, where you create a hash from the user information is the easiest, but needs separate copies for each user.

              Copy protection is an endless story and the final solution is still not found.


              ---
              Stefan Pendl
              http://stefanpendl.runbasichosting.com/

              Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
              Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

              Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

              Books at http://www.lulu.com/ and http://www.amazon.com/
              Alyce Watson ... APIs for Liberty BASIC
              Carl Gundel .... Beginning Programming with Liberty BASIC

              Windows 7 Home Premium 64-bit SP1
              AMD Turion X2 RM-70 2GHz, 4GB RAM
            • John
              Lorne, You are a genius, and obviously one of the gods from the higher levels of Mount Olympus. I have been looking for this for years !! Somebody posted
              Message 6 of 16 , Jul 28, 2011
                Lorne,

                You are a genius, and obviously one of the gods from the higher levels of Mount Olympus. I have been looking for this for years !!

                Somebody posted something a couple months back that relied on a third party DLL called HardwareIDExtractorC.dll which you had to find online, and even then I did not find it to be very reliable. But that might have just been me :-)

                Your code relies only on the #kernel32 which I assume is an existing part of Windows because I did not download it.

                The next trick will be to see if the exact same code syntax works for newer versions of Windows, such as Vista and "7". While one would think it should work just fine, however, in those versions there may not be any such thing as #kernel32 - or they may have removed numerous elements from it, so that it no longer works. Those are just things that Microsoft does to keep us all on our toes :-)

                I will now get down to writing the code for REGISTERING software with users - which will involve a hash function and a GUI screen for the user to enter your registration code based on their HD id (hash) etc etc etc. These will be SUBROUTINES which you can place into your software if you wish. I will upload them to the groups site and paste the code into a message as well for all to use, should they desire, and assuming my coding is up to the standards of many on here who are much more experienced.

                In addition, I will e-mail it to you directly in case you miss that edition of the LB group post.

                Thanks again, and may You be with you - LOL.






                --- In libertybasic@yahoogroups.com, "Lorne Russell" <lorneokb@...> wrote:
                >
                > I use the hard drive serial number which can be extracted using this code:
                >
                > hardDrive$=DefaultDir$
                > x=instr(hardDrive$,"\")
                > hardDrive$=left$(.........................
              • onesild silva
                Hi, Lorne I use this code, but it returns the same number for two different hard-disks in two different computers!!! (-1438217098) I don’t know whats the
                Message 7 of 16 , Jul 29, 2011
                  Hi, Lorne

                  I use this code, but it returns the same number for two different hard-disks in two different computers!!! (-1438217098)



                  I don’t know whats the problem!!!



                  Regards



                  onesild





                  From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On Behalf Of Lorne Russell
                  Sent: quinta-feira, 28 de julho de 2011 01:48
                  To: libertybasic@yahoogroups.com
                  Subject: Re: [libertybasic] Re: serial number - windows or mother board





                  I use the hard drive serial number which can be extracted using this code:

                  hardDrive$=DefaultDir$
                  x=instr(hardDrive$,"\")
                  hardDrive$=left$(hardDrive$,x)
                  hardDriveSerial = getHDSerial(hardDrive$)
                  print hardDriveSerial
                  end

                  function getHDSerial(lpRootPathName$)
                  struct lpVolumeSerialNumber,SerialNumber as long
                  struct lpMaxComponentLength, ComponentLength as long
                  struct lpFileSystemFlags,SystemFlags as long

                  lpVolumeNameBuffer$ = space$(255)
                  nVolumeNameSize = len(lpVolumeNameBuffer$)
                  lpFileSystemNameBuffer$ = space$(255)
                  nFileSystemNameSize = len(lpFileSystemNameBuffer$)

                  calldll #kernel32, "GetVolumeInformationA", _
                  lpRootPathName$ as ptr, _
                  lpVolumeNameBuffer$ as ptr, _
                  nVolumeNameSize as long, _
                  lpVolumeSerialNumber as struct, _
                  lpMaxComponentLength as struct, _
                  lpFileSystemFlags as struct, _
                  lpFileSystemNameBuffer$ as ptr, _
                  nFileSystemNameSize as long, _
                  result as long
                  getHDSerial = lpVolumeSerialNumber.SerialNumber.struct
                  end function

                  Regards,
                  Lorne Russell

                  From: John
                  Sent: Wednesday, July 27, 2011 7:54 PM
                  To: libertybasic@yahoogroups.com <mailto:libertybasic%40yahoogroups.com>
                  Subject: [libertybasic] Re: serial number - windows or mother board

                  Yeah, i've been trying to get this secret for years. There was one DLL call that sort-of worked, except it returned 2 different values - depending on if you restarted the program or something. Could never tell. It only returned 2 though.

                  But still, you would think that the Gods at Intel (and others) would allow operating system people (like Microsoft) to know some static place/s where a string of bytes are stored. OR Microsoft would allow programming people (like Smalltalk) to access something - even a hash value of the windows serial num would be fine, if they felt we should not have access to the serial num itself.

                  Every now and then I get myself excited about programming, and get back into it - but then I run up against the same old brick wall. How can I copy protect my work?

                  Of course, this method means keeping up with users if their computer crashes and they need to reinstall, or they simply upgrade to a newer computer and so on. But I don't mind that. I mean you would get an idea if a user changes computers 17 times in 3 months, you know?

                  [Non-text portions of this message have been removed]





                  [Non-text portions of this message have been removed]
                • John
                  Onesild, Get the command prompt: Start -- All Programs -- Accessories -- Command Prompt Type C: vol it will give you the vol id in Hex (i think). do this
                  Message 8 of 16 , Jul 29, 2011
                    Onesild,

                    Get the command prompt: Start --> All Programs --> Accessories --> Command Prompt

                    Type

                    C:> vol

                    it will give you the vol id in Hex (i think).

                    do this on both computers and see if they are the same.

                    It can just be a coincidence, as Stefan pointed out - it is an id created during format based on date, time, etc. and there is a slight coincidence they could be the same.

                    Anyway, that's just my guess.
                  • Stefan Pendl
                    ... According to http://msdn.microsoft.com/en-us/library/aa364993%28VS.85%29.aspx the data types are incorrect for the arguments. ... must be translated as:
                    Message 9 of 16 , Jul 29, 2011
                      >
                      > I use this code, but it returns the same number for two
                      > different hard-disks in two different computers!!! (-1438217098)
                      >

                      According to http://msdn.microsoft.com/en-us/library/aa364993%28VS.85%29.aspx the data types are incorrect for the arguments.

                      The following:

                      > struct lpVolumeSerialNumber,SerialNumber as long
                      > struct lpMaxComponentLength, ComponentLength as long
                      > struct lpFileSystemFlags,SystemFlags as long

                      must be translated as:

                      struct lpVolumeSerialNumber, SerialNumber as ulong
                      struct lpMaxComponentLength, ComponentLength as ulong
                      struct lpFileSystemFlags, SystemFlags as ulong

                      This is due to the original data type being a DWORD.

                      The initial translation might have been made from VB code, which uses the correct data types behind the scene, but the user can only
                      specify simple ones.

                      In general translating from VB is error prone, only translating from C code is resulting in good code.


                      ---
                      Stefan Pendl
                      http://stefanpendl.runbasichosting.com/

                      Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                      Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                      Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

                      Books at http://www.lulu.com/ and http://www.amazon.com/
                      Alyce Watson ... APIs for Liberty BASIC
                      Carl Gundel .... Beginning Programming with Liberty BASIC

                      Windows 7 Home Premium 64-bit SP1
                      AMD Turion X2 RM-70 2GHz, 4GB RAM
                    • onesild silva
                      NOTHING HAPPENS!!!! FIRST OF ALL. I CANNOT REACH THE C: VOLUME. THE SYSTEM SEND ME TO C: USERS ONESILD INSTEAD OF C? REGARDS ONESILD From:
                      Message 10 of 16 , Jul 29, 2011
                        NOTHING HAPPENS!!!!

                        FIRST OF ALL. I CANNOT REACH THE C: VOLUME.

                        THE SYSTEM SEND ME TO C:\USERS\ONESILD INSTEAD OF C?

                        REGARDS

                        ONESILD



                        From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
                        Behalf Of John
                        Sent: sexta-feira, 29 de julho de 2011 11:04
                        To: libertybasic@yahoogroups.com
                        Subject: [libertybasic] Re: serial number - windows or mother board





                        Onesild,

                        Get the command prompt: Start --> All Programs --> Accessories --> Command
                        Prompt

                        Type

                        C:> vol

                        it will give you the vol id in Hex (i think).

                        do this on both computers and see if they are the same.

                        It can just be a coincidence, as Stefan pointed out - it is an id created
                        during format based on date, time, etc. and there is a slight coincidence
                        they could be the same.

                        Anyway, that's just my guess.







                        [Non-text portions of this message have been removed]
                      • Stefan Pendl
                        ... Would you mind stop shouting at us, there is no need to get rude. It makes no difference, if you use CD C: before call in the VOL DOS command or not.
                        Message 11 of 16 , Jul 29, 2011
                          >
                          > NOTHING HAPPENS!!!!
                          >
                          > FIRST OF ALL. I CANNOT REACH THE C: VOLUME.
                          >
                          > THE SYSTEM SEND ME TO C:\USERS\ONESILD INSTEAD OF C?
                          >
                          > REGARDS
                          >
                          > ONESILD
                          >

                          Would you mind stop shouting at us, there is no need to get rude.

                          It makes no difference, if you use "CD C:\" before call in the "VOL" DOS command or not.

                          The "VOL" DOS command will always show the information of the current volume, despite of the current folder you are in.


                          ---
                          Stefan Pendl
                          http://stefanpendl.runbasichosting.com/

                          Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                          Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                          Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

                          Books at http://www.lulu.com/ and http://www.amazon.com/
                          Alyce Watson ... APIs for Liberty BASIC
                          Carl Gundel .... Beginning Programming with Liberty BASIC

                          Windows 7 Home Premium 64-bit SP1
                          AMD Turion X2 RM-70 2GHz, 4GB RAM
                        • onesild silva
                          Sorry, Stefan, but I can see on my reply any kind of “rude”. What I said it is that “nothing happens “ after to follow the instruction!! I have found
                          Message 12 of 16 , Jul 30, 2011
                            Sorry, Stefan, but I can see on my reply any kind of “rude”.

                            What I said it is that “nothing happens “ after to follow the instruction!!

                            I have found the number, entering CMD at Command line, and after that I
                            enter just VOL and the volume ID was showed!!

                            Best regards.

                            By the way, I got the solution, thru your information accessing
                            <http://soft.tahionic.com/download-hdd_id/documentation/how%20to%20call%20it
                            -LibertyBasic.html>
                            http://soft.tahionic.com/download-hdd_id/documentation/how%20to%20call%20it-
                            LibertyBasic.html.



                            The complete program is showed below, and its necessary obtain the
                            hardwareIDExtractorC.dll (attached)





                            REM ' CONSTANTS

                            Dots$ = "............................................"

                            ' OSMemType

                            OSMemType$(1) = "Memory Load (%)"

                            OSMemType$(2) = "Total Physical"

                            OSMemType$(3) = "Avail Physical"

                            OSMemType$(4) = "Total Page File"

                            OSMemType$(5) = "Available Page File"

                            OSMemType$(6) = "Total Virtual"

                            OSMemType$(7) = "Available Virtual"

                            ' ProcMemType

                            ProcMemType$(1) = "Working Set Size"

                            ProcMemType$(2) = "Page Fault Count"

                            ProcMemType$(3) = "Peak Working Set Size"

                            ProcMemType$(4) = "Quota Peak Paged Pool Usage"

                            ProcMemType$(5) = "Quota Paged Pool Usage"

                            ProcMemType$(6) = "Quota Peak Non Paged Pool Usage"

                            ProcMemType$(7) = "Quota Non Paged Pool Usage"

                            ProcMemType$(8) = "Pagefile Usage"

                            ProcMemType$(9) = "Peak Pagefile Usage"

                            REM

                            ' main routines testing

                            call OpenHwIDexDLL

                            print

                            print "CPU Information"

                            print "==============="

                            print

                            print "CPU Speed .......................... "; GetCPUSpeed(); " MHz"

                            print "CPU Family ......................... "; CPUFamily$()

                            print "CPU Theoretic Speed ................ "; GetCpuTheoreticSpeed(); "
                            MHz"

                            print "Is CPU ID available ................ "; IsCPUIDAvailable()

                            for Core = 1 to GetCPUCount()

                            print "CPU ID Core "; Core; " ...................... "; GetCPUID$(Core)

                            next

                            print "CPU ID now ......................... "; GetCpuIdNow$()

                            print "Is Intel(R) 64-Bit CPU ............. "; IsIntel64BitCPU()

                            print "CPU Vendor ......................... "; GetCPUVendor$()

                            print

                            print "RAM Information"

                            print "==============="

                            print

                            print OSMemType$(1); " "; left$(Dots$, 35 - len(OSMemType$(1))); " "; _

                            MemStatWindows(1); " %"

                            for OSMemType = 2 to 7

                            print OSMemType$(OSMemType); " "; left$(Dots$, 35 -
                            len(OSMemType$(OSMemType))); " "; _

                            using("#############", MemStatWindows(OSMemType)); " Byte ... "; _

                            using("##########", val(MemStatWindowsKB$(OSMemType))); " kiloByte ... "; _

                            using("#######", val(MemStatWindowsMB$(OSMemType))); " MegaByte"

                            next



                            for ProcMemType = 1 to 9

                            print ProcMemType$(ProcMemType); " "; left$(Dots$, 35 -
                            len(ProcMemType$(ProcMemType))); " "; _

                            using("#############", MemStatCurrProc(ProcMemType));

                            if ProcMemType = 2 then

                            print

                            else

                            print " Byte"

                            end if

                            next

                            print "Peak Memory Used ................... "; using("#############",
                            MemStatPeak()); " Byte"

                            print

                            print "RAM Advanced"

                            print "============"

                            print

                            print "Page Size .......................... "; GetPageSize()

                            print "Memory Granularity ................. "; GetMemGranularity(); "
                            kiloByte"

                            print "Lowest Address ..................... "; GetLowAddr()

                            print "Highest Address .................... "; GetHiAddr()

                            print

                            print "HDD Information"

                            print "==============="

                            print

                            count = 1

                            do

                            Drive$ = upper$(word$(Drives$, count))

                            if Drive$ <> "" then

                            print "Partition ID "; Drive$; " .................... ";
                            GetPartitionID$(Drive$)

                            end if

                            count = count + 1

                            loop until Drive$ = ""

                            for DriveID = 0 to 7

                            print "IDE Serial Number Drive "; DriveID; " .......... ";
                            trim$(GetIDESerialNumber$(DriveID))

                            next

                            print

                            print "BIOS Information"

                            print "================"

                            print

                            print "BIOS Date .......................... "; BiosDate$()

                            print "BIOS Version ....................... "; BiosVersion$()

                            print "BIOS Product ID .................... "; BiosProductID$()

                            print "BIOS Video ......................... "; BiosVideo$()

                            print

                            print "Utilities"

                            print "========="

                            print

                            print "HardwareIDExtractorC.dll Version ... "; GetDllVersion()

                            print "Bin to Integer (10011001) .......... "; BinToInt("10011001")

                            call CloseHwIDexDLL

                            end

                            REM

                            sub OpenHwIDexDLL

                            ' open DLL

                            Open "HardwareIDExtractorC.dll" for DLL as #HwIDex

                            end sub

                            REM

                            sub CloseHwIDexDLL

                            ' close DLL

                            close #HwIDex

                            end sub

                            REM

                            sub ReleaseMemory pointer

                            ' release memory used by returned String

                            calldll #HwIDex, "ReleaseMemory", pointer as ulong, result as void

                            end sub

                            REM

                            ' CPU

                            function GetCPUSpeed()

                            calldll #HwIDex, "GetCPUSpeed", GetCPUSpeed as double

                            end function

                            REM

                            function CPUFamily$()

                            calldll #HwIDex, "CPUFamily", pointer as ulong

                            CPUFamily$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function GetCpuTheoreticSpeed()

                            calldll #HwIDex, "GetCpuTheoreticSpeed", GetCpuTheoreticSpeed as long

                            end function

                            REM

                            function IsCPUIDAvailable()

                            calldll #HwIDex, "IsCPUIDAvailable", result as ulong

                            IsCPUIDAvailable = (result > 0)

                            end function

                            REM

                            function GetCPUID$(CoreNo)

                            calldll #HwIDex, "CoreNumber2CoreMask", CoreNo as long, CoreMask as long

                            calldll #HwIDex, "GetCPUID", CoreMask as word, pointer as ulong

                            GetCPUID$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function GetCpuIdNow$()

                            calldll #HwIDex, "GetCpuIdNow", pointer as ulong

                            GetCpuIdNow$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function GetCPUCount()

                            calldll #HwIDex, "GetCPUCount", GetCPUCount as long

                            end function

                            REM

                            function IsIntel64BitCPU()

                            calldll #HwIDex, "IsIntel64BitCPU", result as ulong

                            IsIntel64BitCPU = (result > 0)

                            end function

                            REM

                            function GetCPUVendor$()

                            calldll #HwIDex, "GetCPUVendor", pointer as ulong

                            GetCPUVendor$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            ' RAM

                            function MemStatWindows(OSMemType)

                            calldll #HwIDex, "MemStatWindows", OSMemType as ushort, MemStatWindows as
                            ulong

                            end function

                            REM

                            function MemStatWindowsKB$(OSMemType)

                            calldll #HwIDex, "MemStatWindows_KB", OSMemType as ushort, pointer as ulong

                            MemStatWindowsKB$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function MemStatWindowsMB$(OSMemType)

                            calldll #HwIDex, "MemStatWindows_MB", OSMemType as ushort, pointer as ulong

                            MemStatWindowsMB$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function MemStatCurrProc(ProcMemType)

                            calldll #HwIDex, "MemStatCurrProc", ProcMemType as ushort, MemStatCurrProc
                            as ulong

                            end function

                            REM

                            function MemStatPeak()

                            calldll #HwIDex, "MemStatPeak", MemStatPeak as ulong

                            end function

                            REM

                            ' RAM - Advanced stuff

                            function GetPageSize()

                            calldll #HwIDex, "GetPageSize", GetPageSize as ulong

                            end function

                            REM

                            function GetMemGranularity()

                            calldll #HwIDex, "GetMemGranularity", GetMemGranularity as long

                            end function

                            REM

                            function GetLowAddr()

                            calldll #HwIDex, "GetLowAddr", GetLowAddr as ulong

                            end function

                            REM

                            function GetHiAddr()

                            calldll #HwIDex, "GetHiAddr", GetHiAddr as ulong

                            end function

                            REM

                            ' HDD

                            function GetPartitionID$(Partition$)

                            calldll #HwIDex, "GetPartitionID", Partition$ as ptr, pointer as ulong

                            GetPartitionID$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function GetIDESerialNumber$(DriveNumber)

                            calldll #HwIDex, "GetIDESerialNumber", DriveNumber as ushort, pointer as
                            ulong

                            GetIDESerialNumber$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            ' BIOS (NEW!)

                            function BiosDate$()

                            calldll #HwIDex, "BiosDate", pointer as ulong

                            BiosDate$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function BiosVersion$()

                            calldll #HwIDex, "BiosVersion", pointer as ulong

                            BiosVersion$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function BiosProductID$()

                            calldll #HwIDex, "BiosProductID", pointer as ulong

                            BiosProductID$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            function BiosVideo$()

                            calldll #HwIDex, "BiosVideo", pointer as ulong

                            BiosVideo$ = winstring(pointer)

                            call ReleaseMemory pointer

                            end function

                            REM

                            ' Utils

                            function BinToInt(Value$)

                            calldll #HwIDex, "BinToInt", Value$ as ptr, BinToInt as long

                            end function

                            REM

                            function GetDllVersion()

                            calldll #HwIDex, "GetDllVersion", GetDllVersion as double

                            END function

                            REM



                            From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
                            Behalf Of Stefan Pendl
                            Sent: sábado, 30 de julho de 2011 03:05
                            To: libertybasic@yahoogroups.com
                            Subject: RE: [libertybasic] serial number - windows or mother board





                            >
                            > NOTHING HAPPENS!!!!
                            >
                            > FIRST OF ALL. I CANNOT REACH THE C: VOLUME.
                            >
                            > THE SYSTEM SEND ME TO C:\USERS\ONESILD INSTEAD OF C?
                            >
                            > REGARDS
                            >
                            > ONESILD
                            >

                            Would you mind stop shouting at us, there is no need to get rude.

                            It makes no difference, if you use "CD C:\" before call in the "VOL" DOS
                            command or not.

                            The "VOL" DOS command will always show the information of the current
                            volume, despite of the current folder you are in.

                            ---
                            Stefan Pendl
                            http://stefanpendl.runbasichosting.com/

                            Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                            Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                            Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

                            Books at http://www.lulu.com/ and http://www.amazon.com/
                            Alyce Watson ... APIs for Liberty BASIC
                            Carl Gundel .... Beginning Programming with Liberty BASIC

                            Windows 7 Home Premium 64-bit SP1
                            AMD Turion X2 RM-70 2GHz, 4GB RAM





                            [Non-text portions of this message have been removed]
                          • Stefan Pendl
                            ... Sending a message in all capital letters is considered shouting, that was rude. If you want to emphasize one word by using capitals, that is not a problem.
                            Message 13 of 16 , Jul 30, 2011
                              >
                              > Sorry, Stefan, but I can see on my reply any kind of "rude".
                              >

                              Sending a message in all capital letters is considered shouting, that was rude.

                              If you want to emphasize one word by using capitals, that is not a problem.


                              ---
                              Stefan Pendl
                              http://stefanpendl.runbasichosting.com/

                              Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                              Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                              Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

                              Books at http://www.lulu.com/ and http://www.amazon.com/
                              Alyce Watson ... APIs for Liberty BASIC
                              Carl Gundel .... Beginning Programming with Liberty BASIC

                              Windows 7 Home Premium 64-bit SP1
                              AMD Turion X2 RM-70 2GHz, 4GB RAM
                            • Rod
                              And no Salsa or Rumba either, unless you are fully dressed and over twenty one!
                              Message 14 of 16 , Jul 30, 2011
                                And no Salsa or Rumba either, unless you are fully dressed and over twenty one!

                                --- In libertybasic@yahoogroups.com, "Stefan Pendl" <pendl2megabit@...> wrote:
                                >
                                > >
                                > > Sorry, Stefan, but I can see on my reply any kind of "rude".
                                > >
                                >
                                > Sending a message in all capital letters is considered shouting, that was rude.
                                >
                                > If you want to emphasize one word by using capitals, that is not a problem.
                                >
                                >
                                > ---
                                > Stefan Pendl
                                > http://stefanpendl.runbasichosting.com/
                                >
                                > Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                                > Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe
                                >
                                > Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/
                                >
                                > Books at http://www.lulu.com/ and http://www.amazon.com/
                                > Alyce Watson ... APIs for Liberty BASIC
                                > Carl Gundel .... Beginning Programming with Liberty BASIC
                                >
                                > Windows 7 Home Premium 64-bit SP1
                                > AMD Turion X2 RM-70 2GHz, 4GB RAM
                                >
                              • John
                                Stefan, ... Now the program produces a decimal number which DOES calculate to be the same as the HEX value given by the VOL command. That is outstanding ! I
                                Message 15 of 16 , Jul 30, 2011
                                  Stefan,

                                  Thank you so much for investigating this. I made the changes to the three lines to be "ulong" instead of just "long" as follows:

                                  > struct lpVolumeSerialNumber,SerialNumber as long
                                  > struct lpMaxComponentLength, ComponentLength as long
                                  > struct lpFileSystemFlags,SystemFlags as long

                                  Now the program produces a decimal number which DOES calculate to be the same as the HEX value given by the VOL command.

                                  That is outstanding !

                                  I hope to have the registration subroutines I promised posted in another day or two.

                                  Respectfully,


                                  John Roberts
                                  Abaco, Bahamas
                                • Ron Spruell
                                  When you use caps it means you are shouting. From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On Behalf Of onesild silva Sent:
                                  Message 16 of 16 , Jul 31, 2011
                                    When you use caps it means you are shouting.



                                    From: libertybasic@yahoogroups.com [mailto:libertybasic@yahoogroups.com] On
                                    Behalf Of onesild silva
                                    Sent: Saturday, July 30, 2011 6:25 AM
                                    To: libertybasic@yahoogroups.com
                                    Subject: RE: [libertybasic] serial number - windows or mother board





                                    Sorry, Stefan, but I can see on my reply any kind of “rude”.

                                    What I said it is that “nothing happens “ after to follow the instruction!!

                                    I have found the number, entering CMD at Command line, and after that I
                                    enter just VOL and the volume ID was showed!!

                                    Best regards.

                                    By the way, I got the solution, thru your information accessing
                                    <http://soft.tahionic.com/download-hdd_id/documentation/how%20to%20call%20it
                                    -LibertyBasic.html>
                                    http://soft.tahionic.com/download-hdd_id/documentation/how%20to%20call%20it-
                                    LibertyBasic.html.

                                    The complete program is showed below, and its necessary obtain the
                                    hardwareIDExtractorC.dll (attached)

                                    REM ' CONSTANTS

                                    Dots$ = "............................................"

                                    ' OSMemType

                                    OSMemType$(1) = "Memory Load (%)"

                                    OSMemType$(2) = "Total Physical"

                                    OSMemType$(3) = "Avail Physical"

                                    OSMemType$(4) = "Total Page File"

                                    OSMemType$(5) = "Available Page File"

                                    OSMemType$(6) = "Total Virtual"

                                    OSMemType$(7) = "Available Virtual"

                                    ' ProcMemType

                                    ProcMemType$(1) = "Working Set Size"

                                    ProcMemType$(2) = "Page Fault Count"

                                    ProcMemType$(3) = "Peak Working Set Size"

                                    ProcMemType$(4) = "Quota Peak Paged Pool Usage"

                                    ProcMemType$(5) = "Quota Paged Pool Usage"

                                    ProcMemType$(6) = "Quota Peak Non Paged Pool Usage"

                                    ProcMemType$(7) = "Quota Non Paged Pool Usage"

                                    ProcMemType$(8) = "Pagefile Usage"

                                    ProcMemType$(9) = "Peak Pagefile Usage"

                                    REM

                                    ' main routines testing

                                    call OpenHwIDexDLL

                                    print

                                    print "CPU Information"

                                    print "==============="

                                    print

                                    print "CPU Speed .......................... "; GetCPUSpeed(); " MHz"

                                    print "CPU Family ......................... "; CPUFamily$()

                                    print "CPU Theoretic Speed ................ "; GetCpuTheoreticSpeed(); "
                                    MHz"

                                    print "Is CPU ID available ................ "; IsCPUIDAvailable()

                                    for Core = 1 to GetCPUCount()

                                    print "CPU ID Core "; Core; " ...................... "; GetCPUID$(Core)

                                    next

                                    print "CPU ID now ......................... "; GetCpuIdNow$()

                                    print "Is Intel(R) 64-Bit CPU ............. "; IsIntel64BitCPU()

                                    print "CPU Vendor ......................... "; GetCPUVendor$()

                                    print

                                    print "RAM Information"

                                    print "==============="

                                    print

                                    print OSMemType$(1); " "; left$(Dots$, 35 - len(OSMemType$(1))); " "; _

                                    MemStatWindows(1); " %"

                                    for OSMemType = 2 to 7

                                    print OSMemType$(OSMemType); " "; left$(Dots$, 35 -
                                    len(OSMemType$(OSMemType))); " "; _

                                    using("#############", MemStatWindows(OSMemType)); " Byte ... "; _

                                    using("##########", val(MemStatWindowsKB$(OSMemType))); " kiloByte ... "; _

                                    using("#######", val(MemStatWindowsMB$(OSMemType))); " MegaByte"

                                    next

                                    for ProcMemType = 1 to 9

                                    print ProcMemType$(ProcMemType); " "; left$(Dots$, 35 -
                                    len(ProcMemType$(ProcMemType))); " "; _

                                    using("#############", MemStatCurrProc(ProcMemType));

                                    if ProcMemType = 2 then

                                    print

                                    else

                                    print " Byte"

                                    end if

                                    next

                                    print "Peak Memory Used ................... "; using("#############",
                                    MemStatPeak()); " Byte"

                                    print

                                    print "RAM Advanced"

                                    print "============"

                                    print

                                    print "Page Size .......................... "; GetPageSize()

                                    print "Memory Granularity ................. "; GetMemGranularity(); "
                                    kiloByte"

                                    print "Lowest Address ..................... "; GetLowAddr()

                                    print "Highest Address .................... "; GetHiAddr()

                                    print

                                    print "HDD Information"

                                    print "==============="

                                    print

                                    count = 1

                                    do

                                    Drive$ = upper$(word$(Drives$, count))

                                    if Drive$ <> "" then

                                    print "Partition ID "; Drive$; " .................... ";
                                    GetPartitionID$(Drive$)

                                    end if

                                    count = count + 1

                                    loop until Drive$ = ""

                                    for DriveID = 0 to 7

                                    print "IDE Serial Number Drive "; DriveID; " .......... ";
                                    trim$(GetIDESerialNumber$(DriveID))

                                    next

                                    print

                                    print "BIOS Information"

                                    print "================"

                                    print

                                    print "BIOS Date .......................... "; BiosDate$()

                                    print "BIOS Version ....................... "; BiosVersion$()

                                    print "BIOS Product ID .................... "; BiosProductID$()

                                    print "BIOS Video ......................... "; BiosVideo$()

                                    print

                                    print "Utilities"

                                    print "========="

                                    print

                                    print "HardwareIDExtractorC.dll Version ... "; GetDllVersion()

                                    print "Bin to Integer (10011001) .......... "; BinToInt("10011001")

                                    call CloseHwIDexDLL

                                    end

                                    REM

                                    sub OpenHwIDexDLL

                                    ' open DLL

                                    Open "HardwareIDExtractorC.dll" for DLL as #HwIDex

                                    end sub

                                    REM

                                    sub CloseHwIDexDLL

                                    ' close DLL

                                    close #HwIDex

                                    end sub

                                    REM

                                    sub ReleaseMemory pointer

                                    ' release memory used by returned String

                                    calldll #HwIDex, "ReleaseMemory", pointer as ulong, result as void

                                    end sub

                                    REM

                                    ' CPU

                                    function GetCPUSpeed()

                                    calldll #HwIDex, "GetCPUSpeed", GetCPUSpeed as double

                                    end function

                                    REM

                                    function CPUFamily$()

                                    calldll #HwIDex, "CPUFamily", pointer as ulong

                                    CPUFamily$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function GetCpuTheoreticSpeed()

                                    calldll #HwIDex, "GetCpuTheoreticSpeed", GetCpuTheoreticSpeed as long

                                    end function

                                    REM

                                    function IsCPUIDAvailable()

                                    calldll #HwIDex, "IsCPUIDAvailable", result as ulong

                                    IsCPUIDAvailable = (result > 0)

                                    end function

                                    REM

                                    function GetCPUID$(CoreNo)

                                    calldll #HwIDex, "CoreNumber2CoreMask", CoreNo as long, CoreMask as long

                                    calldll #HwIDex, "GetCPUID", CoreMask as word, pointer as ulong

                                    GetCPUID$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function GetCpuIdNow$()

                                    calldll #HwIDex, "GetCpuIdNow", pointer as ulong

                                    GetCpuIdNow$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function GetCPUCount()

                                    calldll #HwIDex, "GetCPUCount", GetCPUCount as long

                                    end function

                                    REM

                                    function IsIntel64BitCPU()

                                    calldll #HwIDex, "IsIntel64BitCPU", result as ulong

                                    IsIntel64BitCPU = (result > 0)

                                    end function

                                    REM

                                    function GetCPUVendor$()

                                    calldll #HwIDex, "GetCPUVendor", pointer as ulong

                                    GetCPUVendor$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    ' RAM

                                    function MemStatWindows(OSMemType)

                                    calldll #HwIDex, "MemStatWindows", OSMemType as ushort, MemStatWindows as
                                    ulong

                                    end function

                                    REM

                                    function MemStatWindowsKB$(OSMemType)

                                    calldll #HwIDex, "MemStatWindows_KB", OSMemType as ushort, pointer as ulong

                                    MemStatWindowsKB$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function MemStatWindowsMB$(OSMemType)

                                    calldll #HwIDex, "MemStatWindows_MB", OSMemType as ushort, pointer as ulong

                                    MemStatWindowsMB$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function MemStatCurrProc(ProcMemType)

                                    calldll #HwIDex, "MemStatCurrProc", ProcMemType as ushort, MemStatCurrProc
                                    as ulong

                                    end function

                                    REM

                                    function MemStatPeak()

                                    calldll #HwIDex, "MemStatPeak", MemStatPeak as ulong

                                    end function

                                    REM

                                    ' RAM - Advanced stuff

                                    function GetPageSize()

                                    calldll #HwIDex, "GetPageSize", GetPageSize as ulong

                                    end function

                                    REM

                                    function GetMemGranularity()

                                    calldll #HwIDex, "GetMemGranularity", GetMemGranularity as long

                                    end function

                                    REM

                                    function GetLowAddr()

                                    calldll #HwIDex, "GetLowAddr", GetLowAddr as ulong

                                    end function

                                    REM

                                    function GetHiAddr()

                                    calldll #HwIDex, "GetHiAddr", GetHiAddr as ulong

                                    end function

                                    REM

                                    ' HDD

                                    function GetPartitionID$(Partition$)

                                    calldll #HwIDex, "GetPartitionID", Partition$ as ptr, pointer as ulong

                                    GetPartitionID$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function GetIDESerialNumber$(DriveNumber)

                                    calldll #HwIDex, "GetIDESerialNumber", DriveNumber as ushort, pointer as
                                    ulong

                                    GetIDESerialNumber$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    ' BIOS (NEW!)

                                    function BiosDate$()

                                    calldll #HwIDex, "BiosDate", pointer as ulong

                                    BiosDate$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function BiosVersion$()

                                    calldll #HwIDex, "BiosVersion", pointer as ulong

                                    BiosVersion$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function BiosProductID$()

                                    calldll #HwIDex, "BiosProductID", pointer as ulong

                                    BiosProductID$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    function BiosVideo$()

                                    calldll #HwIDex, "BiosVideo", pointer as ulong

                                    BiosVideo$ = winstring(pointer)

                                    call ReleaseMemory pointer

                                    end function

                                    REM

                                    ' Utils

                                    function BinToInt(Value$)

                                    calldll #HwIDex, "BinToInt", Value$ as ptr, BinToInt as long

                                    end function

                                    REM

                                    function GetDllVersion()

                                    calldll #HwIDex, "GetDllVersion", GetDllVersion as double

                                    END function

                                    REM

                                    From: libertybasic@yahoogroups.com <mailto:libertybasic%40yahoogroups.com>
                                    [mailto:libertybasic@yahoogroups.com <mailto:libertybasic%40yahoogroups.com>
                                    ] On
                                    Behalf Of Stefan Pendl
                                    Sent: sábado, 30 de julho de 2011 03:05
                                    To: libertybasic@yahoogroups.com <mailto:libertybasic%40yahoogroups.com>
                                    Subject: RE: [libertybasic] serial number - windows or mother board

                                    >
                                    > NOTHING HAPPENS!!!!
                                    >
                                    > FIRST OF ALL. I CANNOT REACH THE C: VOLUME.
                                    >
                                    > THE SYSTEM SEND ME TO C:\USERS\ONESILD INSTEAD OF C?
                                    >
                                    > REGARDS
                                    >
                                    > ONESILD
                                    >

                                    Would you mind stop shouting at us, there is no need to get rude.

                                    It makes no difference, if you use "CD C:\" before call in the "VOL" DOS
                                    command or not.

                                    The "VOL" DOS command will always show the information of the current
                                    volume, despite of the current folder you are in.

                                    ---
                                    Stefan Pendl
                                    http://stefanpendl.runbasichosting.com/

                                    Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
                                    Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                                    Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

                                    Books at http://www.lulu.com/ and http://www.amazon.com/
                                    Alyce Watson ... APIs for Liberty BASIC
                                    Carl Gundel .... Beginning Programming with Liberty BASIC

                                    Windows 7 Home Premium 64-bit SP1
                                    AMD Turion X2 RM-70 2GHz, 4GB RAM

                                    [Non-text portions of this message have been removed]





                                    [Non-text portions of this message have been removed]
                                  Your message has been successfully submitted and would be delivered to recipients shortly.