Platforms to show: All Mac Windows Linux Cross-Platform

/Util/Read Raw Disk on Windows


Required plugins for this example: MBS Util Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Read Raw Disk on Windows

This example is the version from Mon, 19th Aug 2012.

Project "Read Raw Disk on Windows.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control bar Inherits ScrollBar
ControlInstance bar Inherits ScrollBar
EventHandler Sub ValueChanged() if NoEvents then Return offset = me.Value * 1024 * 3 read End EventHandler
End Control
Control BevelButton1 Inherits BevelButton
ControlInstance BevelButton1 Inherits BevelButton
EventHandler Sub Action() b.Position = offset List.DeleteAllRows dim q as integer = 0 for blocks as integer = 1 to 10000 // search a maximum of 10 MB for j as integer = 0 to 2 dim p as int64 = b.Position dim s as string = b.Read(1024) s = ReplaceNonPrintableCharactersMBS(s) if CountFields(s, ".") < 900 then // interesting ShowBlock s, p q = q + 1 end if next if q = 3 then exit end if next NoEvents = true offset = b.Position bar.Value = Offset / 3 / 1024 NoEvents = false End EventHandler
End Control
EventHandler Sub Open() b = LargeBinaryStreamMBS.Open("\\.\PhysicalDrive0", false) List.ColumnAlignment(0) = List.AlignRight if b = nil then MsgBox "Please run as admin on Windows." quit else Title = str(b.Length) read end if End EventHandler
Sub Read() b.Position = offset List.DeleteAllRows for j as integer = 0 to 2 dim p as int64 = b.Position dim s as string = b.Read(1024) s = ReplaceNonPrintableCharactersMBS(s) ShowBlock s,p next End Sub
Sub ShowBlock(s as string, p as int64) for i as integer = 0 to 15 List.AddRow hex(p+i*64), mid(s, i*64+1, 64) next End Sub
Property NoEvents As Boolean
Property b As LargeBinaryStreamMBS
Property offset As int64
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...