flat assembler
Message board for the users of flat assembler.

Index > Windows > My first Win32 dialog app, CPU-Y

Goto page Previous  1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 30 May 2025, 04:20
....


Last edited by flier mate on 30 May 2025, 16:59; edited 1 time in total
Post 30 May 2025, 04:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20685
Location: In your JS exploiting you and your system
revolution 30 May 2025, 04:24
Using GetProcessAffinityMask only returns the numbers of cores available to the process, which can be different from the number of cores in the system.

The Sleep resolution varies between OS versions. Usually somewhere between 10ms and 100ms, with server versions having longer times and consumer versions using shorter times.
Post 30 May 2025, 04:24
View user's profile Send private message Visit poster's website Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 30 May 2025, 04:35
Any frequency measurement option will have errors, especially in protected mode. Here you just need to clarify what frequency the author wants to display in the utility window. In general, full information about the processor (as stated by its manufacturer) can be obtained by reading the SMBIOS database - it contains everything from the socket type to the supply voltage. The GetSystemFirmwareTable() function from Kernel32.dll returns the database in its raw form. In the latest specification v3.8 from 2024, page 42 contains a description of the fields - all that remains is to display the information in the window.
https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.8.0.pdf


Description:
Filesize: 12.72 KB
Viewed: 2455 Time(s)

smbios_cpu.png


Post 30 May 2025, 04:35
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 30 May 2025, 05:14
....


Last edited by flier mate on 30 May 2025, 16:59; edited 1 time in total
Post 30 May 2025, 05:14
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 30 May 2025, 07:08
.....


Last edited by flier mate on 30 May 2025, 17:00; edited 1 time in total
Post 30 May 2025, 07:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20685
Location: In your JS exploiting you and your system
revolution 30 May 2025, 07:45
There is more of a problem than just the definition of a core. The process can have a limited subset of the total system cores. So using GetProcessAffinityMask probably isn't a good option for what the code purports to do.
Post 30 May 2025, 07:45
View user's profile Send private message Visit poster's website Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 30 May 2025, 19:51
Version of the utility with reading the smbios database:
Code:
format   pe gui 6.0
entry    start
include 'win32ax.inc'
;//-------------------
.data
ID_Name     =   1000
ID_Sock     =   1001
ID_Cores    =   1002
ID_Enable   =   1003
ID_Threads  =   1004
ID_Clock    =   1005
ID_Max      =   1006
ID_Speed    =   1007

hModule     dd  0
hName       dd  0
hSock       dd  0
hCores      dd  0
hEnable     dd  0
hThreads    dd  0
hClock      dd  0
hMax        dd  0
hSpeed      dd  0

cpuBase     dd  0
strBuff     rb  128

SocketTable     dd  0x15,@15,0x19,@19,0x1d,@1d,0x1e,@1e,0x1f,@1f,0x20,@20,0x21,@21,0x22,@22,0x23,@23,0x24,@24
                dd  0x25,@25,0x26,@26,0x2b,@26,0x2c,@2c,0x2d,@2d,0x2e,@2e,0x2f,@2f,0x30,@30,0x32,@32,0x33,@33
                dd  0x34,@34,0x35,@35,0x36,@36,0x39,@39,0x3a,@3a,0x3b,@3b,0x3c,@3c,0x3d,@3d,0x3e,@3e,0x01,@Unk  ;30
@15   db  'LGA775 ',0
@19   db  'LGA1366',0
@1d   db  'LGA1156',0
@1e   db  'LGA1567',0
@1f   db  'PGA988A',0
@20   db  'BGA1288',0
@21   db  'PGA988B',0
@22   db  'BGA1023',0
@23   db  'BGA1224',0
@24   db  'LGA1155',0
@25   db  'LGA1356',0
@26   db  'LGA2011',0
@2c   db  'LGA1356',0
@2d   db  'LGA1150',0
@2e   db  'BGA1168',0
@2f   db  'BGA1234',0
@30   db  'BGA1364',0
@32   db  'LGA1151',0
@33   db  'BGA1356',0
@34   db  'BGA1440',0
@35   db  'BGA1515',0
@36   db  'LGA3647',0
@39   db  'LGA2066',0
@3a   db  'BGA1392',0
@3b   db  'BGA1510',0
@3c   db  'BGA1528',0
@3d   db  'LGA4189',0
@3e   db  'LGA1200',0
@Unk  db  'Unknown',0


align 16
buff        rb  4*1024

;//-------------------
.code
start:    invoke  GetModuleHandle,0
          mov     [hModule],eax
          invoke  DialogBoxParam, eax, 100, 0, DialogProc, 0
          invoke  ExitProcess, 0

proc  DialogProc hwnddlg, msg, wparam, lparam

          cmp     [msg],WM_INITDIALOG
          je      @INIT
          cmp     [msg],WM_COMMAND
          je      @exit
          cmp     [msg],WM_CLOSE
          je      @close
          jmp     @next

;//****** "WM_INITDIALOG" Routine *****************************
;//************************************************************
@INIT:    invoke  SetWindowText,[hwnddlg],<'*** SMBIOS-CPU v0.1 ***',0>

;// Static Control Handle
          invoke  GetDlgItem,[hwnddlg],ID_Name
          mov     [hName],eax
          invoke  GetDlgItem,[hwnddlg],ID_Sock
          mov     [hSock],eax
          invoke  GetDlgItem,[hwnddlg],ID_Cores
          mov     [hCores],eax
          invoke  GetDlgItem,[hwnddlg],ID_Enable
          mov     [hEnable],eax
          invoke  GetDlgItem,[hwnddlg],ID_Threads
          mov     [hThreads],eax
          invoke  GetDlgItem,[hwnddlg],ID_Clock
          mov     [hClock],eax
          invoke  GetDlgItem,[hwnddlg],ID_Max
          mov     [hMax],eax
          invoke  GetDlgItem,[hwnddlg],ID_Speed
          mov     [hSpeed],eax

;// Dump SMBIOS Base
          mov     eax,'RSMB'
          bswap   eax
          invoke  GetSystemFirmwareTable,eax,0,buff,4096
          or      eax,eax
          jnz     @f

          invoke  MessageBox,0,<'Read SMBIOS Error!',0>,<'ERROR',0>,0
          jmp     @close

@@:       mov     esi,buff+8
@FindCpuTable:
          movzx   eax,byte[esi+1]
          add     esi,eax
@@:       lodsb
          or      al,al
          jnz     @b
          cmp     byte[esi],0
          jnz     @b

          inc     esi
          cmp     byte[esi],4
          jnz     @FindCpuTable

          mov     [cpuBase],esi

;// Product Name -------------------------
          movzx   eax,byte[esi+1]
          add     esi,eax
          mov     ebx,2
          xor     al,al
          mov     edi,esi
@@:       mov     ecx,-1
          repne   scasb
          dec     ebx
          jnz     @b
          invoke  SetWindowText,[hName],edi

;// Socket -------------------------------
          mov     esi,[cpuBase]
          movzx   ebx,byte[esi+25]
          mov     esi,SocketTable
          mov     ecx,30
@@:       lodsd
          cmp     eax,ebx
          je      @stop
          add     esi,4
          loop    @b
@stop:    mov     esi,[esi]

          invoke  SetWindowText,[hSock],esi

;// Max Cores ----------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+35]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hCores],strBuff

;// Cores Enabled ------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+36]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hEnable],strBuff

;// Threads ------------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+37]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hThreads],strBuff

;// External Clock -----------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+18]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hClock],strBuff

;// Speed --------------------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+22]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hSpeed],strBuff

;// Max Speed ----------------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+20]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hMax],strBuff


;//****** "WM_CLOSE/COMMAND" Routine **************************
;//************************************************************
@exit:    cmp     [wparam],BN_CLICKED shl 16 + IDCANCEL
          jne     @next
@close:   invoke  EndDialog,[hwnddlg], 0
@next:    xor     eax,eax
@return:  ret
endp

;//------------------
section '.idata' import data readable writeable
library  kernel32,'kernel32.DLL', user32,'user32.DLL'
include  'api\kernel32.inc'
include  'api\user32.inc'

;//------------------
section '.rsrc' data resource readable
directory  RT_DIALOG, dialogs
resource   dialogs, 100, LANG_ENGLISH + SUBLANG_DEFAULT, mainform

dialog  mainform,'',150,100,380,110, DS_3DLOOK + WS_CAPTION + WS_SYSMENU,,,'Verdana',8
   dialogitem 'STATIC','CPU Name',    -1,020,010,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Name,       060,010,300,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Socket',      -1,020,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Sock,       060,030,060,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Cores',       -1,140,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Cores,      165,030,030,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Enable',      -1,220,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Enable,     245,030,030,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Threads',     -1,300,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Threads,    330,030,030,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','ExtClock',    -1,020,050,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Clock,      060,050,060,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Speed',       -1,138,050,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Speed,      165,050,070,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Max Speed',   -1,250,050,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Max,        291,050,070,012,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'BUTTON','Exit',IDCANCEL,  290,090,070,013,WS_VISIBLE + BS_DEFPUSHBUTTON
enddialog
    


Description:
Filesize: 7.98 KB
Viewed: 2349 Time(s)

SmbCpu.png


Post 30 May 2025, 19:51
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 31 May 2025, 06:49
Added core voltage, physical memory size, real-time TSC counter value, and processor name via CPUID, since smbios has a string, but its position in the table is not fixed. The code has several additional functions and a window message handler WM_TIMER:
Code:
format   pe gui 6.0
entry    start
include 'win32ax.inc'
;//-------------------
.data
ID_Name     =   1000
ID_Sock     =   1001
ID_Cores    =   1002
ID_Enable   =   1003
ID_Threads  =   1004
ID_Clock    =   1005
ID_Max      =   1006
ID_Speed    =   1007
ID_Volt     =   1008
ID_Mem      =   1009
ID_Tsc      =   1010

hModule     dd  0
hName       dd  0
hSock       dd  0
hCores      dd  0
hEnable     dd  0
hThreads    dd  0
hClock      dd  0
hMax        dd  0
hSpeed      dd  0
hVolt       dd  0
hMem        dd  0
hTsc        dd  0

cpuBase     dd  0
mByte       dd  1024*1024
strBuff     rb  128

SocketTable     dd  0x15,@15,0x19,@19,0x1d,@1d,0x1e,@1e,0x1f,@1f,0x20,@20,0x21,@21,0x22,@22,0x23,@23,0x24,@24
                dd  0x25,@25,0x26,@26,0x2b,@26,0x2c,@2c,0x2d,@2d,0x2e,@2e,0x2f,@2f,0x30,@30,0x32,@32,0x33,@33
                dd  0x34,@34,0x35,@35,0x36,@36,0x39,@39,0x3a,@3a,0x3b,@3b,0x3c,@3c,0x3d,@3d,0x3e,@3e,0x01,@Unk  ;30
@15   db  'LGA775 ',0
@19   db  'LGA1366',0
@1d   db  'LGA1156',0
@1e   db  'LGA1567',0
@1f   db  'PGA988A',0
@20   db  'BGA1288',0
@21   db  'PGA988B',0
@22   db  'BGA1023',0
@23   db  'BGA1224',0
@24   db  'LGA1155',0
@25   db  'LGA1356',0
@26   db  'LGA2011',0
@2c   db  'LGA1356',0
@2d   db  'LGA1150',0
@2e   db  'BGA1168',0
@2f   db  'BGA1234',0
@30   db  'BGA1364',0
@32   db  'LGA1151',0
@33   db  'BGA1356',0
@34   db  'BGA1440',0
@35   db  'BGA1515',0
@36   db  'LGA3647',0
@39   db  'LGA2066',0
@3a   db  'BGA1392',0
@3b   db  'BGA1510',0
@3c   db  'BGA1528',0
@3d   db  'LGA4189',0
@3e   db  'LGA1200',0
@Unk  db  'Unknown',0

align 16
buff        rb  4*1024

;//-------------------
.code
start:    invoke  GetModuleHandle,0
          mov     [hModule],eax
          invoke  DialogBoxParam, eax, 100, 0, DialogProc, 0
          invoke  ExitProcess, 0

proc  DialogProc hwnddlg, msg, wparam, lparam

          cmp     [msg],WM_INITDIALOG
          je      @INIT
          cmp     [msg],WM_TIMER    ;<-----------//
          je      @RDTSC
          cmp     [msg],WM_COMMAND
          je      @exit
          cmp     [msg],WM_CLOSE
          je      @close
          jmp     @next

;//************************************************************
;//****** "WM_INITDIALOG" Handler *****************************
;//************************************************************
@INIT:    invoke  SetWindowText,[hwnddlg],<'*** SMBIOS-CPU v0.2 ***',0>

;// Static Control Handle
          invoke  GetDlgItem,[hwnddlg],ID_Name
          mov     [hName],eax
          invoke  GetDlgItem,[hwnddlg],ID_Sock
          mov     [hSock],eax
          invoke  GetDlgItem,[hwnddlg],ID_Cores
          mov     [hCores],eax
          invoke  GetDlgItem,[hwnddlg],ID_Enable
          mov     [hEnable],eax
          invoke  GetDlgItem,[hwnddlg],ID_Threads
          mov     [hThreads],eax
          invoke  GetDlgItem,[hwnddlg],ID_Clock
          mov     [hClock],eax
          invoke  GetDlgItem,[hwnddlg],ID_Max
          mov     [hMax],eax
          invoke  GetDlgItem,[hwnddlg],ID_Speed
          mov     [hSpeed],eax
          invoke  GetDlgItem,[hwnddlg],ID_Volt
          mov     [hVolt],eax
          invoke  GetDlgItem,[hwnddlg],ID_Mem
          mov     [hMem],eax
          invoke  GetDlgItem,[hwnddlg],ID_Tsc
          mov     [hTsc],eax

;// Dump SMBIOS Base ----------------------
          mov     eax,'RSMB'
          bswap   eax
          invoke  GetSystemFirmwareTable,eax,0,buff,4096
          or      eax,eax
          jnz     @f

          invoke  MessageBox,0,<'Read SMBIOS Error!',0>,<'ERROR',0>,0
          jmp     @close

@@:       mov     esi,buff+8
@FindCpuTable:
          movzx   eax,byte[esi+1]
          add     esi,eax
@@:       lodsb
          or      al,al
          jnz     @b
          cmp     byte[esi],0
          jnz     @b

          inc     esi
          cmp     byte[esi],4
          jnz     @FindCpuTable

          mov     [cpuBase],esi

;// Product Name -------------------------
          mov     eax,0x80000002
          mov     ecx,3
          mov     edi,strBuff
@@:       push    eax ecx
          cpuid
          stosd
          xchg    eax,ebx
          stosd
          xchg    eax,ecx
          stosd
          xchg    eax,edx
          stosd
          pop     ecx eax
          inc     eax
          loop    @b
          invoke  SetWindowText,[hName],strBuff

;// Socket -------------------------------
          mov     esi,[cpuBase]
          movzx   ebx,byte[esi+25]
          mov     esi,SocketTable
          mov     ecx,30
@@:       lodsd
          cmp     eax,ebx
          je      @stop
          add     esi,4
          loop    @b
@stop:    mov     esi,[esi]

          invoke  SetWindowText,[hSock],esi

;// Max Cores ----------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+35]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hCores],strBuff

;// Cores Enabled ------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+36]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hEnable],strBuff

;// Threads ------------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+37]
         cinvoke  wsprintf,strBuff,<'%d',0>,eax
          invoke  SetWindowText,[hThreads],strBuff

;// External Clock -----------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+18]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hClock],strBuff

;// Speed --------------------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+22]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hSpeed],strBuff

;// Max Speed ----------------------------
          mov     esi,[cpuBase]
          movzx   eax,word[esi+20]
         cinvoke  wsprintf,strBuff,<'%d MHz',0>,eax
          invoke  SetWindowText,[hMax],strBuff

;// Voltage ------------------------------
          mov     esi,[cpuBase]
          movzx   eax,byte[esi+17]
          and     al,not 80h
          xor     edx,edx
          mov     ebx,10
          div     ebx
         cinvoke  wsprintf,strBuff,<'%d.%d v',0>,eax,edx
          invoke  SetWindowText,[hVolt],strBuff

;// Sys Memory ---------------------------
          mov     dword[buff],8*8
          invoke  GlobalMemoryStatusEx,buff
          fild    qword[buff+8]
          fidiv   [mByte]
          fistp   dword[buff]
         cinvoke  wsprintf,strBuff,<'%d MB',0>,dword[buff]
          invoke  SetWindowText,[hMem],strBuff

;//************************************************************
;//****** "WM_TIMER Handler" **********************************
;//************************************************************
@RDTSC:
;// Real Time Stamp Counter --------------
          rdtsc
         cinvoke  wsprintf,strBuff,<'%08X-%08X',0>,edx,eax
          invoke  SetWindowText,[hTsc],strBuff

          invoke  SetTimer,[hwnddlg],0123,1000,0     ;<--------------// Change period

;//************************************************************
;//****** "WM_CLOSE/COMMAND" Handler **************************
;//************************************************************
@exit:    cmp     [wparam],BN_CLICKED shl 16 + IDCANCEL
          jne     @next
@close:   invoke  EndDialog,[hwnddlg], 0
@next:    xor     eax,eax
@return:  ret
endp

;//------------------
section '.idata' import data readable writeable
library  kernel32,'kernel32.DLL', user32,'user32.DLL'
include  'api\kernel32.inc'
include  'api\user32.inc'

;//------------------
section '.rsrc' data resource readable
directory  RT_DIALOG, dialogs
resource   dialogs, 100, LANG_ENGLISH + SUBLANG_DEFAULT, mainform

dialog  mainform,'',150,100,380,125, DS_3DLOOK + WS_CAPTION + WS_SYSMENU,,,'Verdana',8
   dialogitem 'STATIC','CPU Name',    -1,000,010,055,013,WS_VISIBLE + SS_RIGHT
   dialogitem 'STATIC','',ID_Name,       060,010,300,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Socket',      -1,000,030,055,013,WS_VISIBLE + SS_RIGHT
   dialogitem 'STATIC','',ID_Sock,       060,030,060,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Cores',       -1,140,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Cores,      165,030,030,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Enabled',     -1,215,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Enable,     245,030,030,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Threads',     -1,300,030,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Threads,    330,030,030,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','ExtClock',    -1,000,050,055,013,WS_VISIBLE + SS_RIGHT
   dialogitem 'STATIC','',ID_Clock,      060,050,060,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Speed',       -1,138,050,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Speed,      165,050,070,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Max Speed',   -1,250,050,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Max,        291,050,070,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Voltage',     -1,000,070,055,013,WS_VISIBLE + SS_RIGHT
   dialogitem 'STATIC','',ID_Volt,       060,070,060,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','Memory',      -1,132,070,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Mem,        165,070,070,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'STATIC','TSC',         -1,250,070,050,013,WS_VISIBLE
   dialogitem 'STATIC','',ID_Tsc,        270,070,090,011,WS_VISIBLE + SS_CENTER + SS_SUNKEN

   dialogitem 'BUTTON','Exit',IDCANCEL,  290,100,070,013,WS_VISIBLE + BS_DEFPUSHBUTTON
enddialog
    


Description:
Filesize: 8.12 KB
Viewed: 2290 Time(s)

smb_v2.png


Post 31 May 2025, 06:49
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1169
Location: Russia
macomics 31 May 2025, 16:44
Only you assume that there is always a processor in SMBIOS, but what if it is not there? You don't have anywhere in the cycle of viewing tables to check their end.
Core i7 wrote:
Code:
@@:       mov     esi,buff+8
@FindCpuTable:
          movzx   eax,byte[esi+1]
          add     esi,eax
@@:       lodsb
          or      al,al
          jnz     @b
          cmp     byte[esi],0
          jnz     @b

          inc     esi
          cmp     byte[esi],4
          jnz     @FindCpuTable; <- testEndOfTable    
Post 31 May 2025, 16:44
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 00:10
macomics wrote:
Only you assume that there is always a processor in SMBIOS

Fair comment. You can add a test for 127, but the CPU table is present in all versions of smbios from 2.1 to 3.8


Last edited by Core i7 on 01 Jun 2025, 06:28; edited 1 time in total
Post 01 Jun 2025, 00:10
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 01 Jun 2025, 05:17
I am testing your SMBIOS-CPU v0.2, after I patch the KERNEL.inc for missing GetSystemFirmwareTable and GlobalMemoryStatusEx, it compiles successfully.

But nothing pops up after I run the program. How to troubleshoot if it is supported on my PC?

EDIT: Wait, I am still troubleshooting, at least I can get a blank dialog box.


Last edited by flier mate on 01 Jun 2025, 05:49; edited 2 times in total
Post 01 Jun 2025, 05:17
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 05:39
What version of Windows are you testing on? (I have 7-10 ok).
The code requires Win7+, because WinXP does not have GetSystemFirmwareTable()
That's why the header says "format pe gui 6.0"
Post 01 Jun 2025, 05:39
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 01 Jun 2025, 05:44
Core i7 wrote:
What version of Windows are you testing on? (I have 7-10 ok).
The code requires Win7+, because WinXP does not have GetSystemFirmwareTable()
That's why the header says "format pe gui 6.0"


I am testing on Windows 10 22H2 latest patch.

Still troubleshooting....
Post 01 Jun 2025, 05:44
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 05:47
here is a compiled version - try it


Description:
Download
Filename: CPU_SMB.ZIP
Filesize: 1.81 KB
Downloaded: 104 Time(s)

Post 01 Jun 2025, 05:47
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 01 Jun 2025, 05:53
Your CPU_SMD.EXE is same, nothing pops up.

I can confirm that GetSystemFirmwareTable returns a value, but maybe the code after it.
Post 01 Jun 2025, 05:53
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 01 Jun 2025, 05:56
I found where it is not working:
Code:
;// Socket -------------------------------
          mov     esi,[cpuBase]
          movzx   ebx,byte[esi+25]
          mov     esi,SocketTable
          mov     ecx,30
@@:       lodsd
          cmp     eax,ebx
          je      @stop
          add     esi,4
          loop    @b
@stop:    mov     esi,[esi]

          invoke  SetWindowText,[hSock],esi   ;<----- Failed here
    


The raw value of esi is 927024972, maybe error in lookup table?

From CPU-Z, my socket is Socket FT1 BGA.


Description: Only "Socket" is a problem, the rest are OK!
Filesize: 8.65 KB
Viewed: 2151 Time(s)

i74.PNG




Last edited by flier mate on 01 Jun 2025, 06:07; edited 1 time in total
Post 01 Jun 2025, 05:56
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 06:03
thanks for the tests!
and what is your processor socket number, can you tell me?
I will add it to the processor database (although I can just write unknown).
the socket can be viewed in the cpuz program: https://cpuid.com/
Post 01 Jun 2025, 06:03
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 06:06
ah.. i got it!
i only have Intel in my database, and you have AMD
Post 01 Jun 2025, 06:06
View user's profile Send private message Reply with quote
flier mate



Joined: 24 May 2025
Posts: 29
flier mate 01 Jun 2025, 06:08
Core i7 wrote:
thanks for the tests!
and what is your processor socket number, can you tell me?
I will add it to the processor database (although I can just write unknown).
the socket can be viewed in the cpuz program: https://cpuid.com/


The raw value of esi is 927024972, maybe error in lookup table?

From CPU-Z, my socket is Socket FT1 BGA.

I am happy to provide feedback!
Post 01 Jun 2025, 06:08
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 109
Location: Socket on motherboard
Core i7 01 Jun 2025, 06:19
here is the corrected version - it will output "Unknown"
Code:
;// Socket -------------------------------
          mov     esi,[cpuBase]
          movzx   ebx,byte[esi+25]
          mov     esi,SocketTable
          mov     ecx,29          ;<-----------
@@:       lodsd
          cmp     eax,ebx
          je      @stop
          add     esi,4
          loop    @b
          add     esi,4           ;<-----------
@stop:    mov     esi,[esi]

          invoke  SetWindowText,[hSock],esi
    
Post 01 Jun 2025, 06:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.