Code Monkey home page Code Monkey logo

Comments (9)

nickdu088 avatar nickdu088 commented on June 27, 2024

You need to convert the virtual machine (.vhdx) format to the raw disk format.

from sharpext4.

Keops10 avatar Keops10 commented on June 27, 2024

Can you give an idea on how I can do this?

from sharpext4.

nickdu088 avatar nickdu088 commented on June 27, 2024

https://social.technet.microsoft.com/Forums/en-US/bea9fc55-b7df-42ba-9a38-362ef51e9b74/how-to-convert-vhdx-file-to-raw?forum=winservergen

https://docs.openstack.org/image-guide/convert-images.html

As far as I know, the file header format is different.

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-vhdx/f0efbb98-f555-4efc-8374-4e77945ad422

from sharpext4.

Keops10 avatar Keops10 commented on June 27, 2024

Yep, it doesn't seem to work for me. Actually, I can read the paths of the files with DiscUtils, but I need to export these files. Any idea how it could be?

from sharpext4.

nickdu088 avatar nickdu088 commented on June 27, 2024

If you can use diskutils, you should be able export those files without any issue. Diskutils only provides read permission only from the disk image, but not write.

SharpExt4 allows you to write a file to the disk image.

from sharpext4.

Keops10 avatar Keops10 commented on June 27, 2024

I am reading with this code. If I make any changes to this code, I can export it.

 var disk = new DiscUtils.Vhdx.Disk(secilen.Text, System.IO.FileAccess.Read);
                    DiscUtils.FileSystems.SetupHelper.SetupFileSystems();
                    var manager = new VolumeManager(disk);
                    var logicalVolumes = manager.GetLogicalVolumes();
                    foreach (var volume in logicalVolumes)
                    {
                        var fsInfos = FileSystemManager.DetectFileSystems(volume);

                        foreach (var fsInfo in fsInfos)
                        {
                            var fs = fsInfo.Open(volume);

                            string[] array2 = fs.GetFiles(fs.Root.Name, "*.*", SearchOption.AllDirectories);
                            foreach (string name in array2)
                            {
                                listbox.Items.Add(name);
                            }
                        }
                    }

from sharpext4.

nickdu088 avatar nickdu088 commented on June 27, 2024

listbox.Items.Add(name)
//Open file and read the content from the name
...

from sharpext4.

Keops10 avatar Keops10 commented on June 27, 2024

I don't think it's possible with something like this, but I tried it anyway.

string dd = listbox.SelectedItem.ToString();
FileStream fs = File.Open(dd,FileMode.Open);

from sharpext4.

nickdu088 avatar nickdu088 commented on June 27, 2024

You can't just use File.Open(dd,FileMode.Open). That is the.net native way. You need use diskutils API to open the file. Check diskutils file open API.

from sharpext4.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.