Author |
Topic: Yahoo forum robbed code.... (Read 471 times) |
|
Yshua
New Member
member is offline


Posts: 6
|
 |
Yahoo forum robbed code....
« Thread started on: Jul 8th, 2015, 7:34pm » |
|
Dearest Richard:
My pc got stolen. Lost my beloved BBC programs. Boils down to the Yahoo forum messages, dated Sept. 18, 2010, how to check pc unique identifiers, such as cpu clock speed, which program I found, but Yahoo raided the program that checked (non text removed) revision number, family of pc, etc. Was searching for hours under API's and WMI without finding where they are under MSDN Library. Apologize for the inconvenience.
Yshua
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Yahoo forum robbed code....
« Reply #1 on: Jul 8th, 2015, 8:02pm » |
|
on Jul 8th, 2015, 7:34pm, Yshua wrote:Was searching for hours under API's and WMI without finding where they are under MSDN Library. |
|
Is this the WMI class you are looking for? It includes the CPU Family, Revision and Version:
https://msdn.microsoft.com/en-us/library/aa394373.aspx
Richard.
|
« Last Edit: Jul 8th, 2015, 8:06pm by rtr2 » |
Logged
|
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: Yahoo forum robbed code....
« Reply #2 on: Jul 9th, 2015, 09:38am » |
|
Hi Yshua,
I'm sorry to hear about your PC. Do you mean you couldn't download the program from Yahoo? It worked OK for me just now, so it might be worth trying again.
Best wishes,
D
|
|
Logged
|
|
|
|
Yshua
New Member
member is offline


Posts: 6
|
 |
Re: Yahoo forum robbed code....
« Reply #3 on: Jul 9th, 2015, 12:48pm » |
|
Dearest Richard and D:
Fantastic!!!!! Worked terrific the first time with the following code changes to cpuspeed.bbc:
REM Get CPU speed using WMI:
SYS `CoCreateInstance`, CLSID_WbemLocator%, 0, CLSCTX_INPROC_SERVER, \ \ IID_IWbemLocator%, ^pLoc% TO hr% IF hr% THEN ERROR 100, "Could not create IWbemLocator interface" !(^IWbemLocator{}+4) = !pLoc%
SYS IWbemLocator.ConnectServer%, pLoc%, FNwide("root\cimv2"), \ \ 0, 0, 0, 0, 0, 0, ^pSvc% TO hr% IF hr% THEN ERROR 100, "Could not create IWbemServices interface" !(^IWbemServices{}+4) = !pSvc%
SYS `CoSetProxyBlanket`, pSvc%, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, 0, \ \ RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not set proxy blanket"
query$ = FNwide("SELECT * FROM Win32_Processor") lang$ = FNwide("WQL") SYS IWbemServices.ExecQuery%, pSvc%, lang$, query$, \ \ WBEM_FLAG_FORWARD_ONLY, 0, ^pEnum% TO hr% IF hr% THEN ERROR 100, "Could not query Win32_Processor enumerator" !(^IEnumWbemClassObject{}+4) = !pEnum%
SYS IEnumWbemClassObject.Next%, pEnum%, -1, 1, ^pCPU%, ^nret% TO hr% IF hr% THEN ERROR 100, "Could not enumerate Win32_Processor object" !(^IWbemClassObject{}+4) = !pCPU%
DIM var{vartype{l&,h&},reserved&(5),ldata%,hdata%} SYS IWbemClassObject.Get%, pCPU%, FNwide("CurrentClockSpeed"), 0, \ \ var{}, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not get processor clock speed"
PRINT "CPU #0 clock speed = " ; var.ldata% ; " MHz"
DIM var{vartype{l&,h&},reserved&(5),ldata%,hdata%} SYS IWbemClassObject.Get%, pCPU%, FNwide("DataWidth"), 0, \ \ var{}, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not get data width"
PRINT "data width = " ; var.ldata%
DIM var{vartype{l&,h&},reserved&(5),ldata%,hdata%} SYS IWbemClassObject.Get%, pCPU%, FNwide("Description"), 0, \ \ var{}, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not get pc description"
PRINT "Pc description: " ; var.ldata% ; "."
DIM var{vartype{l&,h&},reserved&(5),ldata%,hdata%} SYS IWbemClassObject.Get%, pCPU%, FNwide("Manufacturer"), 0, \ \ var{}, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not get Manufacturer"
PRINT "Manufacturer = " ; var.ldata% ; "."
DIM var{vartype{l&,h&},reserved&(5),ldata%,hdata%} SYS IWbemClassObject.Get%, pCPU%, FNwide("Revision"), 0, \ \ var{}, 0, 0 TO hr% IF hr% THEN ERROR 100, "Could not get revision"
PRINT "Revision number = " ; var.ldata% ; "."
PROCcleanup
Bravo! And with just one remaining question; How did we add the "&FFFF" default value into the field of some of the variables assigned above to prevent erroneous data? Is there a reference in the BBC help file to explain?
Thanks again, Yshua
|
|
Logged
|
|
|
|
|