Jump to content











Photo
- - - - -

Low-level command line interface to Arsenal Image Mounter

arsenal imdisk mount vmdk vdi

  • Please log in to reply
16 replies to this topic

#1 Antonjo

Antonjo
  • Members
  • 9 posts
  •  
    Italy

Posted 05 January 2017 - 02:08 AM

When I try to mount an image I get:

    > aim_ll -a -t file -o ro,fksig -f "c:\winows10 efi.vdi"  -m #:
    Creating device...
    Created device 000000 -> c:\winows10 efi.vdi
    Disk device is \\?\PhysicalDrive1
    No volumes attached. Disk could be offline or not partitioned.
    Done.


Everything works with the GUI Arsenal Image Mounter.

 



#2 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 05 January 2017 - 08:14 AM

VDI images are mounted thru discutils.

 

May be this is where you issue is : 

-is the discutils available?

-dont you need a specific command line switch to mention that you want to use discutils?

 

More here : http://reboot.pro/to...-image-mounter/ .



#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13333 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 January 2017 - 10:14 AM

As a side note, command line it is not particularly low level (or lower level than GUI).

 

As a matter of fact, see specifically:
http://reboot.pro/to...unter/?p=195261

 

aim_ll.exe can ONLY mount the RAW image, you need to use either the .Net :ph34r: aim_cmd.exe aim_cli.exe or use devio as proxy (with libyall libraries) with aim_ll.exe.

 

 

:duff:

Wonko


Edited by Wonko the Sane, 05 January 2017 - 10:59 AM.


#4 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 05 January 2017 - 10:19 AM

As a side note, command line it is not particularly low level (or lower level than GUI).

 

As a matter of fact, see specifically:
http://reboot.pro/to...unter/?p=195261

 

aim_ll.exe can ONLY mount the RAW image, you need to use either the .Net :ph34r: aim_cmd.exe or use devio as proxy (with libyall libraries).

 

 

:duff:

Wonko

 

 

Should not the dotnet version be able to mount images other than RAW?

Using devio works but is less user friendly (you need to trigger 2 processes in a batch using the start command).

 

 

aim_cli.exe (formerly ArsenalImageMounterService.exe)

This is a .NET 4.0 command line tool that has most of the features you find in the .NET GUI application. There are command line switches to mount files like vdi, vhd etc through DiscUtils.dll, which is included embedded in this application.



#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13333 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 January 2017 - 10:50 AM

Should not the dotnet version be able to mount images other than RAW?
Using devio works but is less user friendly (you need to trigger 2 processes in a batch using the start command).

 
Sure :),  (typo) I meant you can use either  aim_cmd.exe aim_cli.exe (the .Net version) or the aim_ll.exe (but that needs devio proxy and lybiall).

If you prefer:
1) if you use aim_ll.exe (alone) you can only mount the RAW image, etc. 
2) if you use aim_cli.exe (which is .Net) you can access anything the discutils libary allow
3) if you don't want (or cannot have) .Net you can use aim_ll.exe to connect to the alternate llbyall libraries through devio
 
See: 
http://reboot.pro/to...unter/?p=195261
and:
http://reboot.pro/to...vio-and-imdisk/
 
:duff:
Wonko



#6 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 05 January 2017 - 11:23 AM

Very clean summary, thanks for that.

 

I am personnaly a big fan of Olof's work and also Joachim Metz work (libtal libraries).

 

These two solutions put together can do miracles :)



#7 Antonjo

Antonjo
  • Members
  • 9 posts
  •  
    Italy

Posted 05 January 2017 - 01:10 PM

I don't actually need low level things, I am only interested in batch mounting.
 
Now everything works, but not in a scriptble mode.  
I am missing the purpose of aim_cli.exe or simply I don't get how to use it in a batch. 
 
It does not exit, unless  Ctrl+C is pressed!
I could use something similar to:
 
    START aim_cli  /mount /filename="path\to\foo.vdi"
    ping 127.0.0.1  -w 2000 >NUL
    FOR /F "usebackq" %%i IN (`aim_ll.exe -l -n`) DO SET drive=%%i
    Echo %drive%
 
but I don't know how long aim_cli takes to mount. 
 
How do you use these tools in batches?
Can you point me to some example?

Edited by Antonjo, 05 January 2017 - 01:51 PM.


#8 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 05 January 2017 - 01:20 PM

With "Arsenal Image Mounter v2.0.010.0.exe" suffices to put DiscUtils.dll in the same dir.

I did the same for "x64\aim_ll.exe".

Is it correct? 

 

 

See post  .

 

It is either aim_ll.exe + devio OR aim_cli.exe + discutils.

 

if you have .Net installed, I recommend aim_cli.exe (easier).



#9 Antonjo

Antonjo
  • Members
  • 9 posts
  •  
    Italy

Posted 05 January 2017 - 01:54 PM

erwan.l sorry didn't read everything, please see edited version of my post

...you are so fast in replying)



#10 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 05 January 2017 - 02:04 PM

erwan.l sorry didn't read everything, please see edited version of my post

...you are so fast in replying)

 

for the exact batch you should either ask our batch master Wonko or the author himself Olof.



#11 Antonjo

Antonjo
  • Members
  • 9 posts
  •  
    Italy

Posted 05 January 2017 - 02:08 PM

thank you



#12 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13333 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 January 2017 - 04:00 PM

for the exact batch you should either ask our batch master Wonko or the author himself Olof.

Don't count on me :(, I use the leftover 7' 1/2 sticks (from Vista :w00t: :ph34r: times):

http://www.msfn.org/...&comment=732379

to NOT touch .Net, let alone .Net v 4.0.

 

.Net is essentially evil.  :diablo: (actually much worse than Vista).

 

Seriously, I have no handy way to run the aim_cli.exe, as I have no running system with .NET 4.0 available.

 

IF the question is how to send a CTRL+C from batch?

http://stackoverflow...tion-on-windows

http://www.latenight...003/sendSignal/

 

:duff:

Wonko



#13 Antonjo

Antonjo
  • Members
  • 9 posts
  •  
    Italy

Posted 07 January 2017 - 01:12 AM

 
@Wonko the Sane
 
`aim_cli.exe` is not extremely CLI friendly.    
It tries to mount the disk and after a while returns a success/failure message, but never returns.
For example in case of success.
 
    Virtual disk created. Press Ctrl+C to remove virtual disk And exit.
 
 
So, in batches, it is a bit  uncomfortable to use it. 
 
With my script above, I start `aim_cli.exe` asynchronously through Windows `start`.
Then I wait a bunch  seconds with the `ping` trick.
After, I run the non-.Net app "aim_ll.exe", which can return the virtual drive number with the `-l -n` switches or an empty string in case of failure.  The `for` line  can capture the output into the variable `drive`.
 
So the script works, but it is very convoluted since `aim_cli.exe` does not return.
Also it depends on the wait argument of the `ping`: if the mounting takes more of the set time one misses a successful mount. 
 
But probably there is some switch that I am missing.


#14 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 07 January 2017 - 11:49 AM

You may be more confortable with using aim_il.exe+devio or imdisk+devio : easier to batch.

 

I use something like below which usually give me good results.

 

%1 is the path to my image.

%2 is the proxy.dll

%3 is my drive as in "x:"

start devio --dll=%2;dllopen shm:test_proxy %1
timeout 5
imdisk -a -t proxy -o shm -o ro -f test_proxy -m %3
pause
imdisk -D -m %3


#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13333 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 January 2017 - 12:49 PM

You can use a loop instead of a timeout.

 

SET drive=

SET /A counter=0

START aim_cli /mount /filename="path\to\foo.vdi"

:loop

SET /A counter+=1
ping 127.0.0.1 -w 100 >NUL
FOR /F "usebackq" %%i IN (`aim_ll.exe -l -n`) DO SET drive=%%i

IF %counter% GTR 50 ECHO No drive Found after 50 attempts&PAUSE&GOTO :EOF

IF NOT DEFINED drive GOTO :loop
Echo %drive%

Echo found after %counter% attempts ...

 

This way if the mounting is faster you don't have to wait much, but you allow for slower instances.

 

:duff:

Wonko



#16 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 07 January 2017 - 12:49 PM

As for the -l -n, I am getting mixed results on my system (using imdisk).

it gives me a list of number from 0 to 21 without any extra details.

 

If you want to find what is your drive letter ("R:" in my example), you could use vmount like below.

Although you would need to wonder about your drive letter if you use the batch provided in previous post (since you provide that information to imdisk command line).

>vmount partitions
C: [SYSTEME]    NTFS            \device\harddisk0\partition2    91227MB
R: [RAMDRIVE]   NTFS            \Device\ImDisk0 1023MB


#17 erwan.l

erwan.l

    Gold Member

  • Developer
  • 1860 posts
  • Location:Nantes - France
  •  
    France

Posted 07 January 2017 - 12:52 PM

You can use a loop instead of a timeout.

 

SET drive=

SET /A counter=0

START aim_cli /mount /filename="path\to\foo.vdi"

:loop

SET /A counter+=1
ping 127.0.0.1 -w 100 >NUL
FOR /F "usebackq" %%i IN (`aim_ll.exe -l -n`) DO SET drive=%%i

IF %counter% GTR 50 ECHO No drive Found after 50 attempts&PAUSE&GOTO :EOF

IF NOT DEFINED drive GOTO :loop
Echo %drive%

Echo found after %counter% attempts ...

 

This way if the mounting is faster you don't have to wait much, but you allow for slower instances.

 

:duff:

Wonko

 

why not use the -m mountpoint option from aim_il?

this way you can specify your own drive letter and dont have to search for it afterwards?

 

see previous post about aim_ll.exe -l -n or imdisk -l -n : does not give good results for me.

 

edit : question above is valid only if we use aim_il to mount the image.

i realised you used aim_cli in that batch.







Also tagged with one or more of these keywords: arsenal, imdisk, mount, vmdk, vdi

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users