flat assembler
Message board for the users of flat assembler.
Index
> Windows > Harddrive Serial Number in Fasm |
Author |
|
Fungos Bauux 10 Jan 2006, 18:23
Hi, anyone has any hd serial retriever in fasm?
See this one: http://www.winsim.com/diskid32/diskid32.html Any ports? |
|||
10 Jan 2006, 18:23 |
|
Fungos Bauux 10 Jan 2006, 21:14
Thanks, but this serial changes with every volume change. The serial number from diskid32 is a internal vendor serial code with vendor string.
|
|||
10 Jan 2006, 21:14 |
|
RedGhost 10 Jan 2006, 22:45
i dont know about HDD serials but GetCurrentHwProfile returns a globally unique identifier (GUID) based on many aspects of hardware which i once used for a per-computer password/login for an application i didnt want leaked
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getcurrenthwprofile.asp _________________ redghost.ca |
|||
10 Jan 2006, 22:45 |
|
Madis731 11 Jan 2006, 09:32
Code: Drive Model Number________________: Maxtor 6B300S0 Drive Serial Number_______________: B60LWM8H Drive Controller Revision Number__: BANC1B10 Controller Buffer Size on Drive___: 16777216 bytes Drive Type________________________: Fixed Physical Geometry: 16383 Cylinders 16 Heads 63 Sectors per track Computer ID_______________________: 116244297 6B300S0 - you mean this? Its also possible with Windows API, because if you check your HDD's properties it shows up there too. If you mean this B60LWM8H, then I don't know how to get it, but there was a bit easier method as I recall. ...but what is Computer ID in this app and where is my drive size? |
|||
11 Jan 2006, 09:32 |
|
Fungos Bauux 11 Jan 2006, 12:38
Quote:
@RedGhost: I want to do something like yours, it worked? Do you like this solution? Quote:
This "Computer ID" is calculed using "Drive Serial Number" and "Drive Model Number" (vendor name only). see: Code: char *p = HardDriveSerialNumber; if ( ! strncmp (HardDriveSerialNumber, "WD-W", 4)) p += 5; for ( ; p && *p; p++) { if ('-' == *p) continue; id *= 10; switch (*p) { case '0': id += 0; break; case '1': id += 1; break; case '2': id += 2; break; case '3': id += 3; break; case '4': id += 4; break; case '5': id += 5; break; case '6': id += 6; break; case '7': id += 7; break; case '8': id += 8; break; case '9': id += 9; break; case 'a': case 'A': id += 10; break; case 'b': case 'B': id += 11; break; case 'c': case 'C': id += 12; break; case 'd': case 'D': id += 13; break; case 'e': case 'E': id += 14; break; case 'f': case 'F': id += 15; break; case 'g': case 'G': id += 16; break; case 'h': case 'H': id += 17; break; case 'i': case 'I': id += 18; break; case 'j': case 'J': id += 19; break; case 'k': case 'K': id += 20; break; case 'l': case 'L': id += 21; break; case 'm': case 'M': id += 22; break; case 'n': case 'N': id += 23; break; case 'o': case 'O': id += 24; break; case 'p': case 'P': id += 25; break; case 'q': case 'Q': id += 26; break; case 'r': case 'R': id += 27; break; case 's': case 'S': id += 28; break; case 't': case 'T': id += 29; break; case 'u': case 'U': id += 30; break; case 'v': case 'V': id += 31; break; case 'w': case 'W': id += 32; break; case 'x': case 'X': id += 33; break; case 'y': case 'Y': id += 34; break; case 'z': case 'Z': id += 35; break; } } } id %= 100000000; if (strstr (HardDriveModelNumber, "IBM-")) id += 300000000; else if (strstr (HardDriveModelNumber, "MAXTOR") || strstr (HardDriveModelNumber, "Maxtor")) id += 400000000; else if (strstr (HardDriveModelNumber, "WDC ")) id += 500000000; else id += 600000000; |
|||
11 Jan 2006, 12:38 |
|
Madis731 11 Jan 2006, 13:31
First I thought suggesting you to use the output of that program for your needs, but seeing this code WOW! ... now I remember why I chose ASM:
Code: ... ;The whole case tree can be packed into this: ;[eax] contains some value 0-9,A-Z,a-z movzx edx,byte[eax] cmp dl,'A' jb @f or dl,20h sub dl,'a'-10 @@: sub dl,30h add [id],dl ... |
|||
11 Jan 2006, 13:31 |
|
Fungos Bauux 11 Jan 2006, 17:23
Yes I understand your feelings, this is why Im trying getting back to asm and want to do this thing 100% in fasm.
|
|||
11 Jan 2006, 17:23 |
|
RedGhost 11 Jan 2006, 18:06
Fungos Bauux wrote:
yeah i figured thats why you might want a serial, yeah it worked fine for me as i recall, but the GUID returned in GetCurrentHwProfile is unique per computer and is very long (which is good!), i also like the fact its based on many hardware components not just the HDD _________________ redghost.ca |
|||
11 Jan 2006, 18:06 |
|
Fungos Bauux 11 Jan 2006, 18:10
Thanks RedGhost, I will try implement using this one.
|
|||
11 Jan 2006, 18:10 |
|
Madis731 12 Jan 2006, 11:27
I hope you won't throw a user away when he changes a USB-stick
Usually when HDD-s crash - I make "ghosts" out of them and boot with another HDD as if nothing has happened. This might be a problem, when programs are calculating GUID checksums but well...security is the most important thing |
|||
12 Jan 2006, 11:27 |
|
Fungos Bauux 12 Jan 2006, 16:09
Hm, GUID will change with little hardware changes? I wont use hdd serial anymore because these problems, but will windows keep its guid ?
|
|||
12 Jan 2006, 16:09 |
|
bzdashek 16 Apr 2012, 19:19
So, how's your progress, comrade?
|
|||
16 Apr 2012, 19:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.