Optimization for VTOY_WIN11_BYPASS_NRO option process.

This commit is contained in:
longpanda 2023-01-06 21:26:31 +08:00
parent 686ed11037
commit 47e1553d23
6 changed files with 13 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -492,7 +492,7 @@ static int Utf8ToUtf16(const char* src, WCHAR * dst)
return MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, size + 1); return MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, size + 1);
} }
static BOOL IsDirExist(const char *Fmt, ...) BOOL IsDirExist(const char *Fmt, ...)
{ {
va_list Arg; va_list Arg;
DWORD Attr; DWORD Attr;
@ -524,7 +524,7 @@ static BOOL IsDirExist(const char *Fmt, ...)
return FALSE; return FALSE;
} }
static BOOL IsFileExist(const char *Fmt, ...) BOOL IsFileExist(const char *Fmt, ...)
{ {
va_list Arg; va_list Arg;
HANDLE hFile; HANDLE hFile;
@ -2204,7 +2204,7 @@ static int Windows11Bypass(const char *isofile, const char MntLetter, UINT8 Chec
HKEY hKey = NULL; HKEY hKey = NULL;
HKEY hSubKey = NULL; HKEY hSubKey = NULL;
LSTATUS Status; LSTATUS Status;
DWORD dwValue; DWORD dwValue = 1;
DWORD dwSize; DWORD dwSize;
Log("Windows11Bypass for <%s> %C: Check:%u NRO:%u", isofile, MntLetter, Check, NRO); Log("Windows11Bypass for <%s> %C: Check:%u NRO:%u", isofile, MntLetter, Check, NRO);
@ -2260,6 +2260,8 @@ static int Windows11Bypass(const char *isofile, const char MntLetter, UINT8 Chec
Status += RegSetValueExA(hSubKey, "BypassNRO", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); Status += RegSetValueExA(hSubKey, "BypassNRO", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));
Log("Create BypassNRO registry %s %u", (Status == ERROR_SUCCESS) ? "SUCCESS" : "FAILED", Status); Log("Create BypassNRO registry %s %u", (Status == ERROR_SUCCESS) ? "SUCCESS" : "FAILED", Status);
SetupMonNroStart(isofile);
} }

View File

@ -195,5 +195,9 @@ int unxz(unsigned char *in, int in_size,
unsigned char *out, int *in_used, unsigned char *out, int *in_used,
void(*error)(char *x)); void(*error)(char *x));
void Log(const char* Fmt, ...);
int SetupMonNroStart(const char* isopath);
BOOL IsFileExist(const char* Fmt, ...);
BOOL IsDirExist(const char* Fmt, ...);
#endif #endif

View File

@ -168,6 +168,7 @@
<ClCompile Include="fat_io_lib\fat_string.c" /> <ClCompile Include="fat_io_lib\fat_string.c" />
<ClCompile Include="fat_io_lib\fat_table.c" /> <ClCompile Include="fat_io_lib\fat_table.c" />
<ClCompile Include="fat_io_lib\fat_write.c" /> <ClCompile Include="fat_io_lib\fat_write.c" />
<ClCompile Include="setupmon.c" />
<ClCompile Include="vtoyjump.c" /> <ClCompile Include="vtoyjump.c" />
<ClCompile Include="xz-embedded-20130513\linux\lib\decompress_unxz.c" /> <ClCompile Include="xz-embedded-20130513\linux\lib\decompress_unxz.c" />
</ItemGroup> </ItemGroup>

View File

@ -45,6 +45,9 @@
<ClCompile Include="xz-embedded-20130513\linux\lib\decompress_unxz.c"> <ClCompile Include="xz-embedded-20130513\linux\lib\decompress_unxz.c">
<Filter>源文件</Filter> <Filter>源文件</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="setupmon.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="vtoyjump.h"> <ClInclude Include="vtoyjump.h">