News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Machine ID

Started by Nilrem, January 31, 2005, 01:41:46 PM

Previous topic - Next topic

MichaelW

Nilrem,

The input macro allocates a 128-byte buffer, copies the user input to the buffer, and returns the address of the buffer. Your lpString variable should be a single DWORD, and the contents of lpString rather than the address of lpString should be passed to GetVolumeInformation, and to the print macro.

eschew obfuscation

Nilrem


Nilrem

How would one go about getting the IDE serial number?

Lubos.Tomandl

Hello,

Machine ID from MAC address network card? OK! Example, source code and exec is on this link
http://www.sendme.cz/sg-5/new/source/MacAddr.zip

View source code:


.586
.model flat, stdcall
option casemap:none

include     \masm32\include\windows.inc
include     \masm32\include\user32.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\IpHlpApi.inc
includelib  \masm32\lib\user32.lib
includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\IpHlpApi.lib

.data
pinfo       IP_ADAPTER_INFO <>
len         dd  0
String      db  '%02X:%02X:%02X:%02X:%02X:%02X',0
Buffer      db  18 dup (0)
Text        db  'MAC Address,',0

.code
Start:
    invoke  GetAdaptersInfo,addr pinfo,addr len
    invoke  GlobalAlloc,GMEM_FIXED,len
    push    eax
    invoke  GetAdaptersInfo,eax,addr len
    pop     esi
    push    esi
    assume  esi:ptr IP_ADAPTER_INFO
    movzx   eax,byte ptr [esi].Address[5]
    push    eax
    movzx   eax,byte ptr [esi].Address[4]
    push    eax
    movzx   eax,byte ptr [esi].Address[3]
    push    eax
    movzx   eax,byte ptr [esi].Address[2]
    push    eax
    movzx   eax,byte ptr [esi].Address[1]
    push    eax
    movzx   eax,byte ptr [esi].Address[0]
    push    eax
    push    offset String
    push    offset Buffer
    call    wsprintf
    pop     eax
    invoke  GlobalFree,eax
    invoke  MessageBox,0,addr Buffer,addr Text,MB_OK
    invoke  ExitProcess,eax

end     Start



Sorry my english

Nilrem


Lubos.Tomandl

For Machine ID from HDD this link http://www.winsim.com/diskid32/diskid32.html sorry source code is C++.