Hi guys,
How do you get the drives in a system, say for example, like C: and D: ?
Also I was wondering about Win32 API function SetCurrentDirectory, if I pass the string ".." , will it go up one level or do I have to manually edit the directory string?
Thanks
How do you get the drives in a system, say for example, like C: and D: ?
Also I was wondering about Win32 API function SetCurrentDirectory, if I pass the string ".." , will it go up one level or do I have to manually edit the directory string?
Thanks
The function to get all of the current drive letters is documented here:
http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/getlogicaldrivestrings.asp
The MS docs say that SetCurrentDirectory will accept a relative path so ".." should work.
http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/getlogicaldrivestrings.asp
The MS docs say that SetCurrentDirectory will accept a relative path so ".." should work.
Fasm syntax of listing the drives(assuming all drive names are one letter long).
the information is stored as such:
"c:\",0,"d:\",0, etc. and this is my code for accessing, and displaying.
*cough*, this was for one of my more evil things a time ago, i just converted to fasm for the hell of it.
the information is stored as such:
"c:\",0,"d:\",0, etc. and this is my code for accessing, and displaying.
drivelist: ;list all drives on the users computer
invoke wsprintf,wbuffer,fDriveList,buffer1+1
invoke lstrlen,wbuffer
invoke send,[shandle],wbuffer,eax,0
invoke GetLogicalDriveStrings,255,dbuffer
mov edi,dbuffer
sub edi,4
_lar:
add edi,4
cmp byte [edi],0
je seguir
invoke GetDriveType,edi
cmp eax,DRIVE_FIXED
jne _lar
invoke wsprintf,wbuffer,fDrive,buffer1+1,edi
invoke lstrlen,wbuffer
invoke send,[shandle],wbuffer,eax,0
jmp _lar
*cough*, this was for one of my more evil things a time ago, i just converted to fasm for the hell of it.