[Main]
Title=Ramdisk-ImDisk
Description=adds ImDisk RAMDrive to PE
Level=1
Selected=None
Author=Kare
Version=7
Date=21.04.2018
Translation_DE=MaineCoon


[Interface]
pTextLabel1=Ramdisk Settings:,10,0,Bold,7,50,230,20
pFrame1=,707070,0,0,7,70,350,80
pTextBox1=25,Size in MB or #$p,0,0,16,90,40,21
pScrollBox1=%,1,0,0,73,110,40,20,%,MB
pTextBox2=Imdisk,Volume Name,0,0,180,90,150,20

pTextLabel2=Format:,10,0,Bold,7,171,230,20
pFrame2=,707070,0,0,7,190,355,80

pRadioButton1=False,FAT,0,1,16,210,80,20
pRadioButton2=False,FAT32,0,1,124,210,80,20
pRadioButton3=True,NTFS,0,1,16,240,80,20
pCheckBox1=True,Associate with .iso files,0,0,12,300,160,18
//
tEcho_1=Copying files..
tEcho_2=Writing new values on registry hive..

[Interface.07]
Description=Integriert das ImDisk RAM-Laufwerk in Windows PE

pTextLabel1=Ramdisk-Einstellungen:,10,0,Bold,7,50,230,20
pFrame1=,707070,0,0,7,70,350,80
pTextBox1=25,Größe in MB oder #$p,0,0,16,90,40,21
pscrollbox1=%,1,0,0,73,110,40,20,%,MB
pTextBox2=Imdisk,Laufwerksbezeichnung,0,0,180,90,150,20

pTextLabel2=Format:,10,0,Bold,7,171,230,20
pFrame2=,707070,0,0,7,190,355,80
pRadioButton1=False,FAT,0,1,16,210,80,20
pRadioButton2=False,FAT32,0,1,124,210,80,20
pRadioButton3=True,NTFS,0,1,16,240,80,20
pCheckBox1=True,Verknüpfe mit .iso Datei,0,0,12,300,160,18
//
tEcho_1=Dateien werden kopiert...
tEcho_2=Registry wird aktualisiert...


[Process]

Echo,%tEcho_1%
filecopy,%Tools%\%Arch%\ImDisk\imdisk.sys,%target_sys%\drivers\
filecopy,%Tools%\%Arch%\ImDisk\imdisk.exe,%target_sys%\
filecopy,%Tools%\%Arch%\ImDisk\imdsksvc.exe,%target_sys%\
filecopy,%Tools%\%Arch%\ImDisk\imdisk.cpl,%target_sys%\
filecopy,%Tools%\%Arch%\ImDisk\awealloc.sys,%target_sys%\drivers\

CopyOrExpand,%source_win%\Format.com,%target_sys%
CopyOrExpand,%source_win%\ifsutil.dll,%target_sys%
CopyOrExpand,%source_win%\CfgMgr32.dll,%target_sys%
CopyOrExpand,%source_win%\ulib.dll,%target_sys%
If,%OS%,=,Win2003,then
   CopyOrExpand,%source_win%\VSSAPI.DLL,%target_sys%
   CopyOrExpand,%source_win%\ATL.DLL,%target_sys%
end
If,%Arch%,=,X64,then
   CopyOrExpand,%source_win%\VSSAPI.DLL,%target_sys%
   CopyOrExpand,%source_win%\ATL.DLL,%target_sys%
end

Echo,%tEcho_2%
RegLoad,%RegSystem%,PE-SYSTEM
RegLoad,%RegSoftware%,PE-SOFTWARE
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDisk,Type,1
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDisk,Start,3
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDisk,ErrorControl,0
RegWrite,HKLM,0x2,PE-System\ControlSet001\Services\ImDisk,ImagePath,system32\DRIVERS\imdisk.sys
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\ImDisk,DisplayName,ImDisk Virtual Disk Driver
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\ImDisk,Description,Disk emulation driver
RegWrite,HKLM,0x3,PE-System\ControlSet001\Services\ImDisk\Security,Security,01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDskSvc,Type,16
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDskSvc,Start,3
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\ImDskSvc,ErrorControl,0
RegWrite,HKLM,0x2,PE-System\ControlSet001\Services\ImDskSvc,ImagePath,%SystemRoot%\system32\imdsksvc.exe
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\ImDskSvc,DisplayName,ImDisk Virtual Disk Driver Helper
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\ImDskSvc,ObjectName,LocalSystem
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\ImDskSvc,Description,Helper service for ImDisk Virtual Disk Driver.
RegWrite,HKLM,0x3,PE-System\ControlSet001\Services\ImDskSvc\Security,Security,01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
RegWrite,HKLM,0x7,PE-System\ControlSet001\Control\Lsa,Authentication Packages,msv1_0
RegWrite,HKLM,0x3,PE-System\ControlSet001\Control\Lsa,Bounds,00,30,00,00,00,20,00,00
RegWrite,HKLM,0x4,PE-System\ControlSet001\Control\Lsa,restrictanonymous,0x0

RegWrite,HKLM,0x3,PE-Software\Microsoft\Non-Driver Signing,Policy,00
RegWrite,HKLM,0x3,PE-Software\Microsoft\Driver Signing,Policy,00

If,%pRadioButton1%,=,True,then,Set,%Format%,FAT
If,%pRadioButton2%,=,True,then,Set,%Format%,FAT32
If,%pRadioButton1%,=,True,then,Set,%FAT%,1
If,%pRadioButton2%,=,True,then,Set,%FAT%,1
If,%pRadioButton3%,=,True,then,Set,%Format%,NTFS

IniWrite,%Target_sys%\PEinit.ini,Init,002,Ramdisk|%pTextBox1%|%pScrollBox1%|imdisk.exe -a -t vm -m %RamDrive% -s %Rsize%M -p #$q/fs:%Format% /q /y /v:%pTextBox2%#$q

CopyOrExpand,%source_win%\lpk.dll,%target_sys%
CopyOrExpand,%source_win%\ufat.dll,%target_sys%
RegWrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT,NextInstance,1
RegWrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,Service,fastfat
RegWrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,Legacy,1
RegWrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,ConfigFlags,32
RegWrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,Class,LegacyDriver
RegWrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,ClassGUID,{8ECC055D-047F-11D1-A537-0000F8753ED1}
RegWrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000,DeviceDesc,fastfat
RegWrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_FASTFAT\0000\Control,ActiveService,Fastfat
RegWrite,HKLM,0x2,PE-System\ControlSet001\Services\Eventlog\System\fastfat,EventMessageFile,%SystemRoot%\System32\IoLogMsg.dll
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Eventlog\System\fastfat,TypesSupported,7
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Fastfat,ErrorControl,1
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\Fastfat,Group,Boot file system
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Fastfat,Start,4
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Fastfat,Type,2
RegWrite,HKLM,0x1,PE-System\ControlSet001\Services\Fastfat\Enum,0,Root\LEGACY_FASTFAT\0000
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Fastfat\Enum,Count,1
RegWrite,HKLM,0x4,PE-System\ControlSet001\Services\Fastfat\Enum,NextInstance,1

//AWE
Regwrite,HKLM,0x4,PE-System\ControlSet001\services\AWEAlloc,Type,1
Regwrite,HKLM,0x4,PE-System\ControlSet001\services\AWEAlloc,Start,2
Regwrite,HKLM,0x4,PE-System\ControlSet001\services\AWEAlloc,ErrorControl,0
Regwrite,HKLM,0x2,PE-System\ControlSet001\services\AWEAlloc,ImagePath,system32\DRIVERS\awealloc.sys
Regwrite,HKLM,0x1,PE-System\ControlSet001\services\AWEAlloc,DisplayName,AWE Memory Allocation Driver
Regwrite,HKLM,0x1,PE-System\ControlSet001\services\AWEAlloc,Description,Driver for physical memory allocation through AWE
Regwrite,HKLM,0x1,PE-System\ControlSet001\services\AWEAlloc\Enum,0,Root\LEGACY_AWEALLOC\0000
Regwrite,HKLM,0x4,PE-System\ControlSet001\services\AWEAlloc\Enum,Count,1
Regwrite,HKLM,0x4,PE-System\ControlSet001\services\AWEAlloc\Enum,NextInstance,1

Regwrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC,NextInstance,1
Regwrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,Service,AWEAlloc
Regwrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,Legacy,1
Regwrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,ConfigFlags,0
Regwrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,Class,LegacyDriver
Regwrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,ClassGUID,{8ECC055D-047F-11D1-A537-0000F8753ED1}
Regwrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,DeviceDesc,AWE Memory Allocation Driver
Regwrite,HKLM,0x4,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000,Capabilities,0
Regwrite,HKLM,0x1,PE-System\ControlSet001\Enum\Root\LEGACY_AWEALLOC\0000\Control,ActiveService,AWEAlloc

if,%pCheckBox1%,=,true,then
	RegWrite,HKLM,0x1,PE-Software\Classes\.iso,,ISOimage
	RegWrite,HKLM,0x1,PE-Software\Classes\ISOimage,,"CD\DVDROM Image Files"
	RegWrite,HKLM,0x1,PE-Software\Classes\ISOimage\DefaultIcon,,"imdisk.cpl#$c3"
	RegWrite,HKLM,0x1,PE-Software\Classes\ISOimage\Shell\Open,,"Mount as ImDisk Virtual Disk"
	RegWrite,HKLM,0x1,PE-Software\Classes\ISOimage\Shell\Open\Command,,"rundll32.exe#$simdisk.cpl#$cRunDLL_MountFile#$s%1"
end

RegUnLoad,PE-SYSTEM
RegUnLoad,PE-SOFTWARE

[Script-Pic]
0=2097,2604,ZLB64
1=eNqlkWk41Hsbx3//WSzDabKVSA0mOY7BICbJJPuSpUSmJE1CdjEoy6TI8jiaebTQyTAKbco2JJlE2SoV2SYySEaW0TKcmJkznet5zpvnzXOd873vF/f3+r64P/d1iwfFY2Cts72TPYAkdURSQCwCm13trG0xXoHk4IjIsMigkMCTGKcIsgHGG29ghAdiDrABsH8oyZbtqKTggJhj5MioxCRjIzzeUNJGeIzRdgsTSRujvAJPxuI8bFC2dt52ru4eOCM7Y2uCvSkQt0FMACAk9KfAfwTB4AiklLSMLEoOAnDov/qfcC2AQXA4DAFHIhEISZIsyQBCAamoibeWUvIMkNaKVjY+QyuR0d5d1aKy9zUfa3I0Jk0WtW696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