Advertisement
dllbridge

Untitled

Apr 18th, 2024
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.31 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4.  
  5.  
  6. extern "C"  char*  __stdcall  _sysInfo();        
  7.  
  8.  
  9.  
  10. ////////////////////////////////////////////////////////
  11. int main()                                            //
  12. {
  13.  
  14.     int i;
  15.  
  16.     printf("%s\n", _sysInfo() );
  17.  
  18.     scanf("%d", &i);
  19.  
  20. }
  21.  
  22.  
  23.  
  24. /////////////////////////////////////////////////////////////////////////////////////
  25.  
  26.  
  27. include    'win32a.inc'
  28.  
  29.  
  30.  
  31.  
  32. format      MS COFF
  33.  
  34.  
  35.  
  36. public     _sysInfo                 as '__sysInfo@0'
  37.  
  38.  
  39. section   '.text' code readable executable
  40.  
  41.  
  42. ;/////////////////////////////////////////////////////////////
  43. proc   _sysInfo                                            ;//
  44.  
  45.  
  46.         mov     edi, sz_2
  47.         cld
  48.  
  49.         mov     eax,80000002h ; Прочитать информацию о процессоре
  50. @@:
  51.         push    eax
  52.         cpuid
  53.         stosd
  54.         xchg    eax,ebx
  55.         stosd
  56.         xchg    eax,ecx
  57.         stosd
  58.         xchg    eax,edx
  59.         stosd
  60.         pop     eax
  61.         inc     eax
  62.         cmp     eax,80000004h
  63.         jbe     @b
  64.  
  65.         mov eax, sz_2
  66.         ret
  67. endp
  68.  
  69. ;
  70.  
  71.  
  72.  
  73.  
  74. section '.data' data readable writeable
  75. ;-------------------------------------------------------------     Создание переменных:
  76.  
  77.    sz_2    db   59 dup(0)
  78.  
  79.              
  80.  
  81.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement