Announcement

Collapse
No announcement yet.

SOURCE CODE: Simplest way to read Floppy Sectors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SOURCE CODE: Simplest way to read Floppy Sectors

    I tested with Win2k Pro and it works perfect! I can read and
    write directly to a floppy disk.

    I've read directly from a CDROM and saved it as a BIN

    I've read directly from Drive C as well and it works perfectly.

    How is this possible? I thought Winnt offered protections.

    I'm sure if I can read Drive C, I can easily write to it. Maybe
    someone with VMWare could test it

    ------------------
    -Greg

    [This message has been edited by Gregery D Engle (edited August 13, 2001).]
    -Greg
    [email protected]
    MCP,MCSA,MCSE,MCSD

  • #2
    I may be misinformed but I'm pretty sure that NT permits absolute
    reads from any drive. You may, however, run into a problem if you
    try to absolute write to a hard drive.


    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      >How is this possible? I thought Winnt offered protections.

      It's explained in the Win32.hlp. Look at "CreateFile" API. The only
      important thing is, that you use shared mode.

      >I'm sure if I can read Drive C, I can easily write to it. Maybe
      >someone with VMWare could test it

      Ok, I'll test it in VMware




      ------------------
      E-Mail (home): mailto:[email protected][email protected]</A>
      E-Mail (work): mailto:[email protected][email protected]</A>

      Comment


      • #4
        Wow! (just wondering about myself). It works perfectly. Here's the
        first Sector of my (empty) drive G (I just tried it at my "real" machine):

        Code:
        00000000 EB52 904E 5446 5320 2020 2000 0208 0000 0000 0000 00F8 0000 3F00 FF00 0004 FB00 0000 0000 .R.NTFS    .............?...........
        00000024 8000 8000 840F 6A01 0000 0000 0400 0000 0000 0000 F8A0 1600 0000 0000 F600 0000 0100 0000 ......j.............................
        00000048 A304 E8FC 3CE8 FCEA 0000 0000 FA33 C08E D0BC 007C FBB8 C007 8ED8 E816 00B8 000D 8EC0 33DB ....<........3.....|..............3.
        0000006C C606 0E00 10E8 5300 6800 0D68 6A02 CB8A 1624 00B4 08CD 1373 05B9 FFFF 8AF1 660F B6C6 4066 [email protected]
        00000090 0FB6 D180 E23F F7E2 86CD C0ED 0641 660F B7C9 66F7 E166 A320 00C3 B441 BBAA 558A 1624 00CD .....?.......Af...f..f. ...A..U..$..
        000000B4 1372 0F81 FB55 AA75 09F6 C101 7404 FE06 1400 C366 601E 0666 A110 0066 0306 1C00 663B 0620 .r...U.u....t......f`..f...f....f;. 
        000000D8 000F 823A 001E 666A 0066 5006 5366 6810 0001 0080 3E14 0000 0F85 0C00 E8B3 FF80 3E14 0000 ...:..fj.fP.Sfh.....>...........>...
        000000FC 0F84 6100 B442 8A16 2400 161F 8BF4 CD13 6658 5B07 6658 6658 1FEB 2D66 33D2 660F B70E 1800 ..a..B..$.......fX[.fXfX..-f3.f.....
        00000120 66F7 F1FE C28A CA66 8BD0 66C1 EA10 F736 1A00 86D6 8A16 2400 8AE8 C0E4 060A CCB8 0102 CD13 f......f..f....6......$.............
        00000144 0F82 1900 8CC0 0520 008E C066 FF06 1000 FF0E 0E00 0F85 6FFF 071F 6661 C3A0 F801 E809 00A0 ....... ...f..........o...fa........
        00000168 FB01 E803 00FB EBFE B401 8BF0 AC3C 0074 09B4 0EBB 0700 CD10 EBF2 C30D 0A46 6568 6C65 7220 .............<.t.............Fehler 
        0000018C 6265 696D 204C 6573 656E 2064 6573 2044 6174 656E 7472 8467 6572 7300 0D0A 4E54 4C44 5220 beim Lesen des Datentr.gers...NTLDR 
        000001B0 6665 686C 7400 0D0A 4E54 4C44 5220 6B6F 6D70 7269 6D69 6572 7400 0D0A 4E65 7573 7461 7274 fehlt...NTLDR komprimiert...Neustart
        000001D4 206D 6974 2053 7472 672B 416C 742B 456E 7466 0D0A 000A 0000 0000 0000 0000 0000 0000 0000  mit Strg+Alt+Entf..................
        000001F8 83A8 B6CA 0000 55AA                                                                       ......U.
        And that's the first Sector after changing some bytes with Hexworkshop and writing it back

        Code:
        00000000 EB52 904E 5446 5320 2020 2000 0208 0000 0000 0000 00F8 0000 3F00 FF00 0004 FB00 0000 0000 .R.NTFS    .............?...........
        00000024 8000 8000 840F 6A01 0000 0000 0400 0000 0000 0000 F8A0 1600 0000 0000 F600 0000 0100 0000 ......j.............................
        00000048 A304 E8FC 3CE8 FCEA 0000 0000 FA33 C08E D0BC 007C FBB8 C007 8ED8 E816 00B8 000D 8EC0 33DB ....<........3.....|..............3.
        0000006C C606 0E00 10E8 5300 6800 0D68 6A02 CB8A 1624 00B4 08CD 1373 05B9 FFFF 8AF1 660F B6C6 4066 [email protected]
        00000090 0FB6 D180 E23F F7E2 86CD C0ED 0641 660F B7C9 66F7 E166 A320 00C3 B441 BBAA 558A 1624 00CD .....?.......Af...f..f. ...A..U..$..
        000000B4 1372 0F81 FB55 AA75 09F6 C101 7404 FE06 1400 C366 601E 0666 A110 0066 0306 1C00 663B 0620 .r...U.u....t......f`..f...f....f;. 
        000000D8 000F 823A 001E 666A 0066 5006 5366 6810 0001 0080 3E14 0000 0F85 0C00 E8B3 FF80 3E14 0000 ...:..fj.fP.Sfh.....>...........>...
        000000FC 0F84 6100 B442 8A16 2400 161F 8BF4 CD13 6658 5B07 6658 6658 1FEB 2D66 33D2 660F B70E 1800 ..a..B..$.......fX[.fXfX..-f3.f.....
        00000120 66F7 F1FE C28A CA66 8BD0 66C1 EA10 F736 1A00 86D6 8A16 2400 8AE8 C0E4 060A CCB8 0102 CD13 f......f..f....6......$.............
        00000144 0F82 1900 8CC0 0520 008E C066 FF06 1000 FF0E 0E00 0F85 6FFF 071F 6661 C3A0 F801 E809 00A0 ....... ...f..........o...fa........
        00000168 FB01 E803 00FB EBFE B401 8BF0 AC3C 0074 09B4 0EBB 0700 CD10 EBF2 C30D 0A46 6568 6C65 7220 .............<.t.............Fehler 
        0000018C 504F 5745 5242 4153 4943 2064 6573 2044 6174 656E 7472 8467 6572 7300 0D0A 4E54 4C44 5220 POWERBASIC des Datentr.gers...NTLDR 
        000001B0 6665 686C 7400 0D0A 4E54 4C44 5220 6B6F 6D70 7269 6D69 6572 7400 0D0A 4E65 7573 7461 7274 fehlt...NTLDR komprimiert...Neustart
        000001D4 206D 6974 2053 7472 672B 416C 742B 456E 7466 0D0A 000A 0000 0000 0000 0000 0000 0000 0000  mit Strg+Alt+Entf..................
        000001F8 83A8 B6CA 0000 55AA                                                                       ......U.
        And here's the code, I used:

        Code:
        #COMPILE EXE "test2.exe"
        
        
        FUNCTION PBMAIN
        
            OPEN "\\.\G:" FOR BINARY SHARED AS #1
            OPEN "test.bin" FOR BINARY SHARED AS #2
        
                GET$ #2, 512, a$
                PUT$ #1, a$
        
            CLOSE #1
            CLOSE #2
        
            MSGBOX "image erstellt"
        
        END FUNCTION

        Huh, that's simple

        ------------------
        E-Mail (home): mailto:[email protected].de[email protected]</A>
        E-Mail (work): mailto:[email protected][email protected]</A>

        Comment


        • #5
          Sven,

          That's pretty crazy.

          I wonder if you can get direct BYTE access to a device. Such
          as a floppy disk which is 2 megs native.

          ------------------
          -Greg

          [This message has been edited by Gregery D Engle (edited August 14, 2001).]
          -Greg
          [email protected]
          MCP,MCSA,MCSE,MCSD

          Comment


          • #6
            >That's pretty crazy. What OS was that?

            Win2K (SP2).



            ------------------
            E-Mail (home): mailto:[email protected][email protected]</A>
            E-Mail (work): mailto:[email protected][email protected]</A>

            Comment

            Working...
            X