mirror of
https://github.com/34736384/RSAPatch.git
synced 2024-11-16 01:39:18 +00:00
hardcode grasscutter public key
This commit is contained in:
parent
2d3243ccc7
commit
acb9151f17
@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
PVOID oGetPublicKey = nullptr;
|
PVOID oGetPublicKey = nullptr;
|
||||||
PVOID oGetPrivateKey = nullptr;
|
PVOID oGetPrivateKey = nullptr;
|
||||||
|
LPCSTR gcpb = "<RSAKeyValue><Modulus>xbbx2m1feHyrQ7jP+8mtDF/pyYLrJWKWAdEv3wZrOtjOZzeLGPzsmkcgncgoRhX4dT+1itSMR9j9m0/OwsH2UoF6U32LxCOQWQD1AMgIZjAkJeJvFTrtn8fMQ1701CkbaLTVIjRMlTw8kNXvNA/A9UatoiDmi4TFG6mrxTKZpIcTInvPEpkK2A7Qsp1E4skFK8jmysy7uRhMaYHtPTsBvxP0zn3lhKB3W+HTqpneewXWHjCDfL7Nbby91jbz5EKPZXWLuhXIvR1Cu4tiruorwXJxmXaP1HQZonytECNU/UOzP6GNLdq0eFDE4b04Wjp396551G99YiFP2nqHVJ5OMQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
|
||||||
|
|
||||||
PVOID Detour(PVOID func, PVOID jmp, bool attach)
|
PVOID Detour(PVOID func, PVOID jmp, bool attach)
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ PVOID Detour(PVOID func, PVOID jmp, bool attach)
|
|||||||
|
|
||||||
std::string ReadFile(std::string path)
|
std::string ReadFile(std::string path)
|
||||||
{
|
{
|
||||||
std::ifstream ifs(path);
|
std::ifstream ifs(std::filesystem::current_path() / path);
|
||||||
if (!ifs.good())
|
if (!ifs.good())
|
||||||
{
|
{
|
||||||
Utils::ConsolePrint("Failed to Open: %s\n", path.c_str());
|
Utils::ConsolePrint("Failed to Open: %s\n", path.c_str());
|
||||||
@ -103,6 +103,11 @@ Array<BYTE>* __fastcall hkGetRSAKey()
|
|||||||
{
|
{
|
||||||
Utils::ConsolePrint("public\n");
|
Utils::ConsolePrint("public\n");
|
||||||
customKey = ReadFile("PublicKey.txt");
|
customKey = ReadFile("PublicKey.txt");
|
||||||
|
if (customKey.empty())
|
||||||
|
{
|
||||||
|
Utils::ConsolePrint("using grasscutter public key\n");
|
||||||
|
customKey = gcpb;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!customKey.empty())
|
if (!customKey.empty())
|
||||||
@ -262,4 +267,4 @@ void __stdcall TlsCallback(PVOID hModule, DWORD fdwReason, PVOID pContext)
|
|||||||
#pragma comment (linker, "/INCLUDE:_tls_used")
|
#pragma comment (linker, "/INCLUDE:_tls_used")
|
||||||
#pragma comment (linker, "/INCLUDE:tls_callback_func")
|
#pragma comment (linker, "/INCLUDE:tls_callback_func")
|
||||||
#pragma const_seg(".CRT$XLF")
|
#pragma const_seg(".CRT$XLF")
|
||||||
EXTERN_C const PIMAGE_TLS_CALLBACK tls_callback_func = TlsCallback;
|
EXTERN_C const PIMAGE_TLS_CALLBACK tls_callback_func = TlsCallback;
|
||||||
|
Loading…
Reference in New Issue
Block a user