how to get the serial no. of a floppy ?
do CD has serial no. too ? if yes how to get it too ?
do CD has serial no. too ? if yes how to get it too ?
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?
GetVolumeInformation
thanks jademtech
thanks smurf it worked :alright:
btw all cd here seem to have the same serial No. ! .
403234
also they are burned by different CD-RW and they have different brands.
thanks smurf it worked :alright:
btw all cd here seem to have the same serial No. ! .
403234
also they are burned by different CD-RW and they have different brands.
403234
If that value is in hex, it probably is a memory address. Did you print the address instead of the value/string?
Thomas
haha... whoops... i got confused... but serial numbers can be changed /w debug and formatting, too, right?
to jademtech
but how to format a CD ??
to Thomas
yes it is hexa . attached the source code
but how to format a CD ??
to Thomas
yes it is hexa . attached the source code
.386
.model flat,stdcall
option casemap:none
include d:\masm32\include\windows.inc
include d:\masm32\include\kernel32.inc
includelib d:\masm32\lib\kernel32.lib
.data
lpVolumeNameBuffer db 260 dup (0)
lpRootPathName db 'h:\' ; put here your CD-Drive letter
.data?
lpVolumeSerialNumber dw ?
lpMaximumComponentLength dw ?
lpFileSystemFlags dw ?; address of file system flags
lpFileSystemNameBuffer dw ?; address of name of file system
nFileSystemNameSize dw ?; length of lpFileSystemNameBuffer
.code
start:
invoke GetVolumeInformation, addr lpRootPathName, addr lpVolumeNameBuffer, 29,addr lpVolumeSerialNumber ,addr lpMaximumComponentLength, addr lpFileSystemFlags , addr lpFileSystemNameBuffer, 25
lea eax, lpVolumeSerialNumber
lea ecx, lpVolumeNameBuffer
end start
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.
Thomas
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.
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 ??
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 ??
Just a little thing I noticed
This should be dup (?) otherwise your adding 260 bytes to your program.
lpVolumeNameBuffer db 260 dup (0)
This should be dup (?) otherwise your adding 260 bytes to your program.