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
2c65eec9
Commit
2c65eec9
authored
Sep 13, 2022
by
longpanda
Browse files
[update] Make injection plugin available in WIMBOOT mode. (#1834)
parent
0c310c5b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
67 deletions
+6
-67
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump32.exe
+0
-0
INSTALL/ventoy/vtoyjump64.exe
INSTALL/ventoy/vtoyjump64.exe
+0
-0
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.c
+6
-58
vtoyjump/vtoyjump/vtoyjump.h
vtoyjump/vtoyjump/vtoyjump.h
+0
-9
No files found.
INSTALL/ventoy/vtoyjump32.exe
View file @
2c65eec9
No preview for this file type
INSTALL/ventoy/vtoyjump64.exe
View file @
2c65eec9
No preview for this file type
vtoyjump/vtoyjump/vtoyjump.c
View file @
2c65eec9
...
@@ -36,7 +36,6 @@ static ventoy_guid g_ventoy_guid = VENTOY_GUID;
...
@@ -36,7 +36,6 @@ static ventoy_guid g_ventoy_guid = VENTOY_GUID;
static
HANDLE
g_vtoylog_mutex
=
NULL
;
static
HANDLE
g_vtoylog_mutex
=
NULL
;
static
HANDLE
g_vtoyins_mutex
=
NULL
;
static
HANDLE
g_vtoyins_mutex
=
NULL
;
static
INT
g_winpeshl_ini_updated
=
0
;
static
DWORD
g_vtoy_disk_drive
;
static
DWORD
g_vtoy_disk_drive
;
static
CHAR
g_prog_full_path
[
MAX_PATH
];
static
CHAR
g_prog_full_path
[
MAX_PATH
];
...
@@ -1965,31 +1964,6 @@ static BOOL CheckVentoyDisk(DWORD DiskNum)
...
@@ -1965,31 +1964,6 @@ static BOOL CheckVentoyDisk(DWORD DiskNum)
return
FALSE
;
return
FALSE
;
}
}
static
int
GetWinpeshlIniFileAttr
(
WinpeshlIniAttr
*
pAttr
)
{
HANDLE
hFile
;
SYSTEMTIME
systime
;
hFile
=
CreateFileA
(
WINPESHL_INI
,
FILE_READ_EA
,
FILE_SHARE_READ
,
0
,
OPEN_EXISTING
,
0
,
0
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
{
Log
(
"Could not open the file<%s>, error:%u"
,
WINPESHL_INI
,
GetLastError
());
return
1
;
}
pAttr
->
FileSize
=
(
INT
)
GetFileSize
(
hFile
,
NULL
);
GetFileTime
(
hFile
,
&
pAttr
->
CreateTime
,
&
pAttr
->
LastAccessTime
,
&
pAttr
->
LastWriteTime
);
FileTimeToSystemTime
(
&
pAttr
->
LastWriteTime
,
&
systime
);
Log
(
"Winpeshl.ini size:%d LastWriteTime:<%04u/%02u/%02u %02u:%02u:%02u.%03u>"
,
pAttr
->
FileSize
,
systime
.
wYear
,
systime
.
wMonth
,
systime
.
wDay
,
systime
.
wHour
,
systime
.
wMinute
,
systime
.
wSecond
,
systime
.
wMilliseconds
);
CloseHandle
(
hFile
);
return
0
;
}
static
int
VentoyHook
(
ventoy_os_param
*
param
)
static
int
VentoyHook
(
ventoy_os_param
*
param
)
{
{
...
@@ -2012,8 +1986,6 @@ static int VentoyHook(ventoy_os_param *param)
...
@@ -2012,8 +1986,6 @@ static int VentoyHook(ventoy_os_param *param)
Log
(
"VentoyHook Path:<%s>"
,
param
->
vtoy_img_path
);
Log
(
"VentoyHook Path:<%s>"
,
param
->
vtoy_img_path
);
g_winpeshl_ini_updated
=
0
;
if
(
IsUTF8Encode
(
param
->
vtoy_img_path
))
if
(
IsUTF8Encode
(
param
->
vtoy_img_path
))
{
{
Log
(
"This file is UTF8 encoding"
);
Log
(
"This file is UTF8 encoding"
);
...
@@ -2210,35 +2182,9 @@ static int VentoyHook(ventoy_os_param *param)
...
@@ -2210,35 +2182,9 @@ static int VentoyHook(ventoy_os_param *param)
sprintf_s
(
IsoPath
,
sizeof
(
IsoPath
),
"%C:%s"
,
VtoyLetter
,
g_windows_data
.
injection_archive
);
sprintf_s
(
IsoPath
,
sizeof
(
IsoPath
),
"%C:%s"
,
VtoyLetter
,
g_windows_data
.
injection_archive
);
if
(
IsFileExist
(
"%s"
,
IsoPath
))
if
(
IsFileExist
(
"%s"
,
IsoPath
))
{
{
int
rc1
=
-
1
,
rc2
=
-
1
;
WinpeshlIniAttr
Attr1
,
Attr2
;
memset
(
&
Attr1
,
0
,
sizeof
(
Attr1
));
memset
(
&
Attr2
,
0
,
sizeof
(
Attr2
));
Log
(
"decompress injection archive %s..."
,
IsoPath
);
Log
(
"decompress injection archive %s..."
,
IsoPath
);
if
(
IsFileExist
(
WINPESHL_INI
))
{
rc1
=
GetWinpeshlIniFileAttr
(
&
Attr1
);
}
DecompressInjectionArchive
(
IsoPath
,
VtoyDiskNum
);
DecompressInjectionArchive
(
IsoPath
,
VtoyDiskNum
);
if
(
IsFileExist
(
WINPESHL_INI
))
{
rc2
=
GetWinpeshlIniFileAttr
(
&
Attr2
);
if
(
rc1
==
rc2
&&
rc1
==
0
)
{
if
(
Attr1
.
FileSize
!=
Attr2
.
FileSize
||
Attr1
.
LastWriteTime
.
dwHighDateTime
!=
Attr2
.
LastWriteTime
.
dwHighDateTime
||
Attr1
.
LastWriteTime
.
dwLowDateTime
!=
Attr2
.
LastWriteTime
.
dwLowDateTime
)
{
Log
(
"winpeshl.ini file updated"
);
g_winpeshl_ini_updated
=
1
;
}
}
}
if
(
IsFileExist
(
"%s"
,
AUTO_RUN_BAT
))
if
(
IsFileExist
(
"%s"
,
AUTO_RUN_BAT
))
{
{
HANDLE
hOut
;
HANDLE
hOut
;
...
@@ -2526,11 +2472,13 @@ int real_main(int argc, char **argv)
...
@@ -2526,11 +2472,13 @@ int real_main(int argc, char **argv)
if
(
strstr
(
argv
[
0
],
"vtoyjump.exe"
))
if
(
strstr
(
argv
[
0
],
"vtoyjump.exe"
))
{
{
wimboot
=
1
;
wimboot
=
1
;
rc
=
VentoyJumpWimboot
(
argc
,
argv
,
LunchFile
);
DeleteFileA
(
WINPESHL_INI
);
IsFileExist
(
WINPESHL_INI
);
rc
=
VentoyJumpWimboot
(
argc
,
argv
,
LunchFile
);
}
}
else
else
{
{
rc
=
VentoyJump
(
argc
,
argv
,
LunchFile
);
rc
=
VentoyJump
(
argc
,
argv
,
LunchFile
);
}
}
Log
(
"LunchFile=<%s> CallParam=<%s>"
,
LunchFile
,
CallParam
);
Log
(
"LunchFile=<%s> CallParam=<%s>"
,
LunchFile
,
CallParam
);
...
@@ -2548,10 +2496,10 @@ int real_main(int argc, char **argv)
...
@@ -2548,10 +2496,10 @@ int real_main(int argc, char **argv)
sprintf_s
(
LunchFile
,
sizeof
(
LunchFile
),
"%s"
,
g_prog_full_path
);
sprintf_s
(
LunchFile
,
sizeof
(
LunchFile
),
"%s"
,
g_prog_full_path
);
Log
(
"Final lunchFile is <%s>"
,
LunchFile
);
Log
(
"Final lunchFile is <%s>"
,
LunchFile
);
}
}
else
if
(
wimboot
&&
g_winpeshl_ini_updated
)
else
if
(
wimboot
&&
IsFileExist
(
WINPESHL_INI
)
)
{
{
sprintf_s
(
LunchFile
,
MAX_PATH
,
"X:
\\
Windows
\\
system32
\\
winpeshl.exe"
);
sprintf_s
(
LunchFile
,
MAX_PATH
,
"X:
\\
Windows
\\
system32
\\
winpeshl.exe"
);
Log
(
"
R
ecall winpeshl.exe"
);
Log
(
"
winpeshl.ini updated, now r
ecall winpeshl.exe"
);
}
}
else
else
{
{
...
...
vtoyjump/vtoyjump/vtoyjump.h
View file @
2c65eec9
...
@@ -152,15 +152,6 @@ typedef struct VTOY_GPT_INFO
...
@@ -152,15 +152,6 @@ typedef struct VTOY_GPT_INFO
#pragma pack()
#pragma pack()
typedef
struct
WinpeshlIniAttr
{
INT
FileSize
;
FILETIME
CreateTime
;
FILETIME
LastAccessTime
;
FILETIME
LastWriteTime
;
}
WinpeshlIniAttr
;
typedef
struct
VarDiskInfo
typedef
struct
VarDiskInfo
{
{
UINT64
Capacity
;
UINT64
Capacity
;
...
...
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