flat assembler
Message board for the users of flat assembler.

Index > Windows > Reading Lba HDD sectors!

Author
Thread Post new topic Reply to topic
Dilshod



Joined: 23 Feb 2005
Posts: 23
Location: Uzbekistan, Tashkent
Dilshod
How can I read all the LbaHDD sectors to file, from Windows or Dos?
thanks
Post 15 Mar 2005, 11:21
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dilshod



Joined: 23 Feb 2005
Posts: 23
Location: Uzbekistan, Tashkent
Dilshod
Any body knows where can I get
VWIN32_DIOC_DOS_INT25 and VWIN32_DIOC_DOS_DRIVEINFO
constants values,
wich used with 'DeviceIoControl' kernel function?
Post 16 Mar 2005, 04:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
All I did was use google and the search strings
"VWIN32_DIOC_DOS_INT25 ="
"VWIN32_DIOC_DOS_DRIVEINFO ="

And I found that their const values are
VWIN32_DIOC_DOS_INT25 = 2
VWIN32_DIOC_DOS_DRIVEINFO = 6
Post 16 Mar 2005, 06:19
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Dilshod



Joined: 23 Feb 2005
Posts: 23
Location: Uzbekistan, Tashkent
Dilshod
Thanks,
But still not working
(Win98)
Code:
FileName db ''\\.\vwin32',0
Regs:
REAX    dd      0
RECX    dd      0
REDX    dd      0
REBX    dd      0
RESP    dd      0
REBP    dd      0
RESI    dd      0
REDI    dd      0

Main:
 invoke CreateFile,FileName,\
       GENERIC_READ,0,0,0,FILE_FLAG_DELETE_ON_CLOSE,0
 mov    [hDevice],eax
 mov    [REAX],3            ;Disk 3-C
 mov    [REBX],Bts_        ;Buffer
 mov    [RECX],1            ;Sectors Cnt
 mov    [REDX],1            ;From
 invoke DeviceIoControl,\
       [hDevice],VWIN32_DIOC_DOS_INT25,Regs,8*4,Regs,nb,0
 invoke CloseHandle,[hDevice]
    
Post 16 Mar 2005, 06:45
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dilshod



Joined: 23 Feb 2005
Posts: 23
Location: Uzbekistan, Tashkent
Dilshod
All Ok, I found it,

Code:
Regs:
REBX    dd      0
REDX    dd      0
RECX    dd      0
REAX    dd      0
REDI    dd      0
RESI    dd      0
Flags   dd      0

d_str:  
diStartSector   dd      0
diSectors       dw      0
diBuffer        dd      0

Main:
        mov     [diStartSector],1           ;Beg Sect
.Next:
        invoke  CreateFile,FileName,GENERIC_READ,0,0,0,\
                   FILE_FLAG_DELETE_ON_CLOSE,0
        mov     [hDevice],eax
        mov     [diSectors],128     ;Sectors Cnt
        mov     [diBuffer],Bts_      ;Buffer
        mov     [REAX],7305h
        mov     [REBX],d_str
        mov     [RECX],-1
        mov     [REDX],6         ;Disk
        mov     [Flags],1
        invoke  DeviceIoControl,[hDevice],\
              VWIN32_DIOC_DOS_DRIVEINFO,Regs,7*4,Regs,7*4,nb,0
        invoke  CloseHandle,[hDevice]
    
Post 16 Mar 2005, 09:26
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.