how to get the serial no. of a floppy ?

do CD has serial no. too ? if yes how to get it too ?
Posted on 2002-06-01 21:09:16 by Sa6ry
i'm not sure if you're referring to the volume label... but can't that just be set /w debug or during a format?
Posted on 2002-06-01 22:42:24 by jademtech
Posted on 2002-06-02 00:38:10 by smurf
thanks jademtech
thanks smurf it worked :alright:

btw all cd here seem to have the same serial No. ! .


also they are burned by different CD-RW and they have different brands.
Posted on 2002-06-02 10:42:08 by Sa6ry

If that value is in hex, it probably is a memory address. Did you print the address instead of the value/string?

Posted on 2002-06-02 10:48:11 by Thomas
haha... whoops... i got confused... but serial numbers can be changed /w debug and formatting, too, right?
Posted on 2002-06-02 13:14:21 by jademtech
to jademtech
but how to format a CD ??

to Thomas
yes it is hexa . attached the source code

.model flat,stdcall
option casemap:none
include d:\masm32\include\
include d:\masm32\include\

includelib d:\masm32\lib\kernel32.lib


lpVolumeNameBuffer db 260 dup (0)
lpRootPathName db 'h:\' ; put here your CD-Drive letter

lpVolumeSerialNumber dw ?
lpMaximumComponentLength dw ?
lpFileSystemFlags dw ?; address of file system flags
lpFileSystemNameBuffer dw ?; address of name of file system
nFileSystemNameSize dw ?; length of lpFileSystemNameBuffer


invoke GetVolumeInformation, addr lpRootPathName, addr lpVolumeNameBuffer, 29,addr lpVolumeSerialNumber ,addr lpMaximumComponentLength, addr lpFileSystemFlags , addr lpFileSystemNameBuffer, 25
lea eax, lpVolumeSerialNumber
lea ecx, lpVolumeNameBuffer
end start
Posted on 2002-06-03 00:22:52 by Sa6ry

There are a couple of things wrong in your code:

- lpRootPathName has no 0 terminator.
- Your variable names are a bit confusing. The lp prefix in variable names stands for 'long pointer', indicating the variable contains a pointer to something. However your variables do not contain a pointer, they are buffers to receive the data. So name them 'VolumeNameBuffer' and 'VolumeSerialNumber' to avoid confusion.
- DW does not stand for 'DWORD', but for 'define/declare WORD. To define a dword, use dd.
- The last few lines (lea), load the addresses of the buffers. This is correct for the VolumeNameBuffer (you could have used mov ecx, offset VolumeNameBuffer instead), but not for the serial number buffer, as it's not a string but a DWORD. Use mov eax, VolumeSerialNumber instead, or VolumeSerialNumber directly.

Posted on 2002-06-03 08:20:11 by Thomas
thanks aloooot Thomas .

btw i was trying to protect the CD through the serial no.

but after making an image of the cd , i noticed it got the same serial no. :(

do anyone know anyway to get a unique information about a CD ?? like brand , speed it was written with .. etc ??
Posted on 2002-06-03 10:00:58 by Sa6ry
Just a little thing I noticed
lpVolumeNameBuffer db 260 dup (0)

This should be dup (?) otherwise your adding 260 bytes to your program.
Posted on 2002-06-03 10:07:29 by Kudos