Exclamation[HELP]Virtual machine program

Posts 1–15 of 18 · Page 1 of 2
[HELP]Virtual machine program
Hey, I was wondering if i could make a program somewhat similar to vmWare. A virtual machine to run another O.S. in without actually formatting or anything.
Kinda bored and i figured this would be a bad ass project. any help is greatly appreciated. Thanks
Unless you are super bad-ass, no.
Quote Originally Posted by Hawky1337 View Post
Unless you are super bad-ass, no.
He is not asking for making a new OS lol. Making a VM is easy !!
What if i am super bad ass
LOL i may as well take a crack at it
i have a source that you may like when i get home it's a vm coded in vb.net

my buddy from hackforms coded it you all know him as DeToX i know him as jordan
Oh shit son! Post it up, or send me a PM/VM please and thank you
i lost it but il have detox send it to me again

edit: here is the code
Code:
Public Class VirtualFileSystem
	''' <summary>
	''' The virtual File System is created by DragonHunter
	''' This is some hardcoded stuff so if you use it in ur own project
	''' Or somewhere else the credits goes to DragonHunter
	''' </summary>
	Public Sub New()
	End Sub

	Public Directories As SortedList(Of String, VirtualDirectory)

	Public Sub Initialize(VirtualizeFolder As String)
		Me.Directories = New SortedList(Of String, VirtualDirectory)()

		'Lets load the files into RAM
		For Each file__1 As FileInfo In New DirectoryInfo(VirtualizeFolder).GetFiles("*.*", SearchOption.AllDirectories)
			If Not Directories.ContainsKey(file__1.Directory.FullName) Then
				Directories.Add(file__1.Directory.FullName, New VirtualDirectory())
				Console.WriteLine("Virtualizing Directory: " + file__1.Directory.FullName)
			End If

			Directories(file__1.Directory.FullName).AddFile(New VirtualDirectory.VirtualFile(File.ReadAllBytes(file__1.FullName), File.ReadAllText(file__1.FullName), New FileInfo(file__1.FullName)), file__1.Name)
		Next

		Dim count As Integer = 0
		For Each vDir As VirtualDirectory In Directories.Values
			count += vDir.GetFiles().Length
		Next
		Console.WriteLine("Total virtualized files: " & count)
	End Sub

	Public Sub DeleteDirectory(DirectoryName As String)
		If Directories.ContainsKey(DirectoryName) Then
			Directories.Remove(DirectoryName)
		End If
	End Sub

	Public Class VirtualDirectory
		Private _files As SortedList(Of String, VirtualFile)

		Public Sub New()
			Me._files = New SortedList(Of String, VirtualFile)()
		End Sub

		Public Sub AddFile(VFile As VirtualFile, FileName As String)
			If Not _files.ContainsKey(FileName) Then
				_files.Add(FileName, VFile)
			End If
		End Sub

		Public Function GetFiles() As VirtualFile()
			Dim files As New List(Of VirtualFile)()
			For i As Integer = 0 To _files.Count - 1
				files.Add(_files.Values(i))
			Next
			Return files.ToArray()
		End Function

		Public Function GetFile(FileName As String) As VirtualFile
			If _files.ContainsKey(FileName) Then
				Return _files(FileName)
			End If
			Return Nothing
		End Function

		Public Sub Copy(sourceFileName As String, destFileName As String, overwrite As Boolean)
			If Not _files.ContainsKey(sourceFileName) Then
				Throw New FileNotFoundException("File not found", sourceFileName)
			End If
			If Not overwrite AndAlso _files.ContainsKey(destFileName) Then
				Throw New IOException("Could not overwrite existing file")
			End If
			If sourceFileName = destFileName Then
				Throw New Exception("File already exists")
			End If

			_files.Add(destFileName, _files(sourceFileName))
		End Sub

		Public Sub Create(fileName As String, file As VirtualFile)
			If _files.ContainsKey(fileName) Then
				Throw New Exception("File already exists")
			End If
			_files.Add(fileName, file)
		End Sub

		Public Class VirtualFile
			Private FileBytes As Byte()
			Private FileStrings As String
			Public Fileinfo As FileInfo

			Public Sub New(FileBytes As Byte(), FileStrings As String, Fileinfo As FileInfo)
				Me.FileBytes = FileBytes
				Me.FileStrings = FileStrings
				Me.Fileinfo = Fileinfo
			End Sub

			Public Sub WriteAllBytes(bytes As Byte(), offset As Integer)
				Dim ms As New MemoryStream(FileBytes)
				ms.Write(bytes, offset, bytes.Length)
				FileBytes = ms.ToArray()
			End Sub

			Public Sub WriteAllText(contens As String)
				FileStrings += contens
			End Sub

			Public Function ReadAllBytes() As Byte()
				Return FileBytes
			End Function

			Public Function ReadAllText() As String
				Return FileStrings
			End Function

			Public Function MemoryStreamBytes() As MemoryStream
				Return New MemoryStream(FileBytes)
			End Function
		End Class
	End Class
End Class
I LOVE YOU!!!! no homo... thanks ill try it out and post the results
i love you to... and making a real os isnt that hard. just a ton of code and alot of time

i have over 300k lines of code so far and the os will bootup and have users.
Quote Originally Posted by cosconub View Post
i love you to... and making a real os isnt that hard. just a ton of code and alot of time

i have over 300k lines of code so far and the os will bootup and have users.
1st line: LOLD so bad

2nd line: how many lines of code did you code yourself? 5?
i coded all 300k bubb lol

=)
Quote Originally Posted by cosconub View Post
i coded all 300k bubb lol

=)
Proof or gtfo
@ coscon ---> sorry agree master131, I would like to see some proof as well, at this point a video is the only accepted proof. I'm not saying it's impossible, but deff. improbable, so provide proof or let's end the discussion of it.
mmk, i will get around to it and /request close
Only OP can request close.
Posts 1–15 of 18 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Need help?