News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

New "getvendor.asm" file.

Started by hutch--, December 20, 2016, 10:48:58 AM

Previous topic - Next topic

hutch--

This one jumped up and bit me once I started using large amounts of memory. As soon as the algo ran the app dropped dead. In its original form I had used EAX rather than RAX as the register to hold the address, changed it after tracking down where the crash occurred and its reliable with software using the /LARGEADDRESSAWARE linker option.

I have attached a single asm library module to replace it. Unzip the file, overwrite the one in the current library with the new one and run "makeit.bat" and all should be well.

This is the module.


; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm32\include64\masm64rt.inc

    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

Get_Vendor proc pBuffer:QWORD

  ; -----------------------------------------------
  ; pBuffer needs to be at least 16 bytes in length
  ; -----------------------------------------------

    LOCAL .ebx :DWORD

    mov .ebx, ebx
   
    mov eax, 0                          ; set ID string for Intel
    cpuid

    mov rax, pBuffer                    ; (pBuffer) load buffer address into RAX

    mov [rax],    ebx                   ; write results to buffer
    mov [rax+4],  edx
    mov [rax+8],  ecx
    mov BYTE PTR [rax+12], 0

    mov ebx, .ebx
   
    ret

Get_Vendor endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    end