Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
7d150790
Commit
7d150790
authored
Jul 23, 2020
by
longpanda
Browse files
1.0.16 release
parent
0f8478fb
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
10 deletions
+107
-10
INSTALL/plugin/ventoy/ventoy_grub.cfg
INSTALL/plugin/ventoy/ventoy_grub.cfg
+19
-0
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/ventoy.cpio
+0
-0
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump32.exe
+0
-0
INSTALL/ventoy/vtoyjump64.exe
INSTALL/ventoy/vtoyjump64.exe
+0
-0
INSTALL/ventoy_pack.sh
INSTALL/ventoy_pack.sh
+1
-0
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.c
+86
-9
vtoyjump/vtoyjump/vtoyjump.h
vtoyjump/vtoyjump/vtoyjump.h
+1
-1
No files found.
INSTALL/plugin/ventoy/ventoy_grub.cfg
0 → 100644
View file @
7d150790
menuentry "My Custom Menu" --class=custom {
echo 'This is custom menu ... '
sleep 1
}
submenu 'My Custom SubMenu -->' --class=customsub {
menuentry "My Custom Menu2" --class=custom2 {
echo 'This is custom menu2 ... '
sleep 1
}
menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
echo 'Return ...'
}
}
menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
echo 'Return ...'
}
INSTALL/ventoy/ventoy.cpio
View file @
7d150790
No preview for this file type
INSTALL/ventoy/vtoyjump32.exe
View file @
7d150790
No preview for this file type
INSTALL/ventoy/vtoyjump64.exe
View file @
7d150790
No preview for this file type
INSTALL/ventoy_pack.sh
View file @
7d150790
...
...
@@ -80,6 +80,7 @@ cp -a ./tool $tmpdir/
rm
-f
$tmpdir
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
cp
-a
Ventoy2Disk.sh
$tmpdir
/
cp
-a
README
$tmpdir
/
cp
-a
plugin
$tmpdir
/
cp
-a
CreatePersistentImg.sh
$tmpdir
/
dos2unix
-q
$tmpdir
/Ventoy2Disk.sh
dos2unix
-q
$tmpdir
/CreatePersistentImg.sh
...
...
vtoyjump/vtoyjump/vtoyjump.c
View file @
7d150790
...
...
@@ -704,31 +704,76 @@ static int DeleteVentoyPart2MountPoint(DWORD PhyDrive)
return
1
;
}
static
BOOL
check_tar_archive
(
const
char
*
archive
,
CHAR
*
tarName
)
{
int
len
;
int
nameLen
;
const
char
*
pos
=
archive
;
const
char
*
slash
=
archive
;
while
(
*
pos
)
{
if
(
*
pos
==
'\\'
||
*
pos
==
'/'
)
{
slash
=
pos
;
}
pos
++
;
}
len
=
(
int
)
strlen
(
slash
);
if
(
len
>
7
&&
(
strncmp
(
slash
+
len
-
7
,
".tar.gz"
,
7
)
==
0
||
strncmp
(
slash
+
len
-
7
,
".tar.xz"
,
7
)
==
0
))
{
nameLen
=
(
int
)
sprintf_s
(
tarName
,
MAX_PATH
,
"X:%s"
,
slash
);
tarName
[
nameLen
-
3
]
=
0
;
return
TRUE
;
}
else
if
(
len
>
8
&&
strncmp
(
slash
+
len
-
8
,
".tar.bz2"
,
8
)
==
0
)
{
nameLen
=
(
int
)
sprintf_s
(
tarName
,
MAX_PATH
,
"X:%s"
,
slash
);
tarName
[
nameLen
-
4
]
=
0
;
return
TRUE
;
}
else
if
(
len
>
9
&&
strncmp
(
slash
+
len
-
9
,
".tar.lzma"
,
9
)
==
0
)
{
nameLen
=
(
int
)
sprintf_s
(
tarName
,
MAX_PATH
,
"X:%s"
,
slash
);
tarName
[
nameLen
-
5
]
=
0
;
return
TRUE
;
}
return
FALSE
;
}
static
int
DecompressInjectionArchive
(
const
char
*
archive
,
DWORD
PhyDrive
)
{
int
rc
=
1
;
BOOL
bRet
;
DWORD
dwBytes
;
HANDLE
hDrive
;
CHAR
PhyPath
[
MAX_PATH
];
HANDLE
hOut
;
DWORD
flags
=
CREATE_NO_WINDOW
;
CHAR
StrBuf
[
MAX_PATH
];
CHAR
tarName
[
MAX_PATH
];
STARTUPINFOA
Si
;
PROCESS_INFORMATION
Pi
;
PROCESS_INFORMATION
NewPi
;
GET_LENGTH_INFORMATION
LengthInfo
;
SECURITY_ATTRIBUTES
Sa
=
{
sizeof
(
SECURITY_ATTRIBUTES
),
NULL
,
TRUE
};
Log
(
"DecompressInjectionArchive %s"
,
archive
);
sprintf_s
(
PhyPath
,
sizeof
(
PhyPath
),
"
\\\\
.
\\
PhysicalDrive%d"
,
PhyDrive
);
hDrive
=
CreateFileA
(
PhyPath
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
0
,
OPEN_EXISTING
,
0
,
0
);
sprintf_s
(
StrBuf
,
sizeof
(
StrBuf
),
"
\\\\
.
\\
PhysicalDrive%d"
,
PhyDrive
);
hDrive
=
CreateFileA
(
StrBuf
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
0
,
OPEN_EXISTING
,
0
,
0
);
if
(
hDrive
==
INVALID_HANDLE_VALUE
)
{
Log
(
"Could not open the disk<%s>, error:%u"
,
PhyPath
,
GetLastError
());
Log
(
"Could not open the disk<%s>, error:%u"
,
StrBuf
,
GetLastError
());
goto
End
;
}
bRet
=
DeviceIoControl
(
hDrive
,
IOCTL_DISK_GET_LENGTH_INFO
,
NULL
,
0
,
&
LengthInfo
,
sizeof
(
LengthInfo
),
&
dwBytes
,
NULL
);
if
(
!
bRet
)
{
Log
(
"Could not get phy disk %s size, error:%u"
,
PhyPath
,
GetLastError
());
Log
(
"Could not get phy disk %s size, error:%u"
,
StrBuf
,
GetLastError
());
goto
End
;
}
...
...
@@ -750,17 +795,49 @@ static int DecompressInjectionArchive(const char *archive, DWORD PhyDrive)
CopyFileFromFatDisk
(
"/ventoy/7z/32/7za.exe"
,
"ventoy
\\
7za.exe"
);
}
sprintf_s
(
PhyPath
,
sizeof
(
PhyPath
),
"ventoy
\\
7za.exe x -y -aoa -oX:
\\
%s"
,
archive
);
sprintf_s
(
StrBuf
,
sizeof
(
StrBuf
),
"ventoy
\\
7za.exe x -y -aoa -oX:
\\
%s"
,
archive
);
Log
(
"extract inject to X:"
);
Log
(
"cmdline:<%s>"
,
StrBuf
);
GetStartupInfoA
(
&
Si
);
Si
.
dwFlags
|=
STARTF_USESHOWWINDOW
;
Si
.
wShowWindow
=
SW_HIDE
;
hOut
=
CreateFileA
(
"ventoy
\\
7z.log"
,
FILE_APPEND_DATA
,
FILE_SHARE_WRITE
|
FILE_SHARE_READ
,
&
Sa
,
OPEN_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
Si
.
dwFlags
|=
STARTF_USESTDHANDLES
;
if
(
hOut
!=
INVALID_HANDLE_VALUE
)
{
Si
.
hStdError
=
hOut
;
Si
.
hStdOutput
=
hOut
;
}
CreateProcessA
(
NULL
,
PhyPath
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
Si
,
&
Pi
);
CreateProcessA
(
NULL
,
StrBuf
,
NULL
,
NULL
,
TRUE
,
flags
,
NULL
,
NULL
,
&
Si
,
&
Pi
);
WaitForSingleObject
(
Pi
.
hProcess
,
INFINITE
);
//
// decompress tar archive, for tar.gz/tar.xz/tar.bz2
//
if
(
check_tar_archive
(
archive
,
tarName
))
{
Log
(
"Decompress tar archive...<%s>"
,
tarName
);
sprintf_s
(
StrBuf
,
sizeof
(
StrBuf
),
"ventoy
\\
7za.exe x -y -aoa -oX:
\\
%s"
,
tarName
);
CreateProcessA
(
NULL
,
StrBuf
,
NULL
,
NULL
,
TRUE
,
flags
,
NULL
,
NULL
,
&
Si
,
&
NewPi
);
WaitForSingleObject
(
NewPi
.
hProcess
,
INFINITE
);
Log
(
"Now delete %s"
,
tarName
);
DeleteFileA
(
tarName
);
}
SAFE_CLOSE_HANDLE
(
hOut
);
}
fl_shutdown
();
...
...
vtoyjump/vtoyjump/vtoyjump.h
View file @
7d150790
...
...
@@ -69,7 +69,7 @@ typedef struct ventoy_windows_data
{
char
auto_install_script
[
384
];
char
injection_archive
[
384
];
UINT8
reserved
[
128
];
UINT8
reserved
[
256
];
}
ventoy_windows_data
;
#pragma pack()
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment