hide some stuff under _debug preprocessors
This commit is contained in:
parent
f9f88d761f
commit
fc64a4002a
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
|
#include "Util.h"
|
||||||
|
#include "Hooks/ContentProvider.h"
|
||||||
|
|
||||||
|
ContentProvider__findLocalFile_t ContentProvider__findLocalFile = (ContentProvider__findLocalFile_t)ADDRESS_CONTENTPROVIDER__FINDLOCALFILE;
|
||||||
|
|
||||||
|
int __fastcall ContentProvider__findLocalFile_hook(void* _this, void*, const std::string& url, std::string* filename)
|
||||||
|
{
|
||||||
|
printf("url: %d\n", url.length());
|
||||||
|
|
||||||
|
ContentProvider__findLocalFile(_this, url, filename);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -12,8 +12,10 @@ void InitializeOutput()
|
||||||
outputHandle = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
outputHandle = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
SetStdHandle(STD_OUTPUT_HANDLE, outputHandle);
|
SetStdHandle(STD_OUTPUT_HANDLE, outputHandle);
|
||||||
|
|
||||||
|
printf("PolygonDLL v1.0.0\n");
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf("[[[ DLL COMPILED AS DEBUG ]]]\n");
|
SetConsoleTextAttribute(outputHandle, FOREGROUND_RED | FOREGROUND_GREEN);
|
||||||
|
printf("Compiled as Debug\n\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// lol
|
// lol
|
||||||
|
|
@ -35,6 +37,7 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
|
||||||
message = reinterpret_cast<std::string*>((int)message + 4);
|
message = reinterpret_cast<std::string*>((int)message + 4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
if (message->compare("NewGame") == 0 || message->compare("NewGame2") == 0)
|
if (message->compare("NewGame") == 0 || message->compare("NewGame2") == 0)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
@ -54,7 +57,6 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
|
||||||
game->dataModel->jobId = "deez nuts";
|
game->dataModel->jobId = "deez nuts";
|
||||||
auto scriptContext = ServiceProvider__createScriptContext(game->dataModel.get());
|
auto scriptContext = ServiceProvider__createScriptContext(game->dataModel.get());
|
||||||
|
|
||||||
// BELOW NEEDS TO DIE NOW (PUt tat shit on debug mode)
|
|
||||||
ScriptContext__execute(scriptContext, 5, "print(\"hi this should be inside the dll's created datamodel i think\")", "hi");
|
ScriptContext__execute(scriptContext, 5, "print(\"hi this should be inside the dll's created datamodel i think\")", "hi");
|
||||||
ScriptContext__execute(scriptContext, 5, "print(\"job id: \" .. game.jobId)", "hi");
|
ScriptContext__execute(scriptContext, 5, "print(\"job id: \" .. game.jobId)", "hi");
|
||||||
ScriptContext__execute(scriptContext, 5, "printidentity()", "hi");
|
ScriptContext__execute(scriptContext, 5, "printidentity()", "hi");
|
||||||
|
|
@ -62,6 +64,7 @@ void __fastcall StandardOut__print_hook(int _this, void*, int type, std::string*
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Classes.h"
|
||||||
|
|
||||||
|
// const auto ContentProvider__findLocalFile = (bool(__cdecl*)(const char* url))ADDRESS_CONTENTPROVIDER__ISURL;
|
||||||
|
|
||||||
|
typedef bool(__thiscall* ContentProvider__findLocalFile_t)(void* _this, const std::string& url, std::string* filename);
|
||||||
|
int __fastcall ContentProvider__findLocalFile_hook(void* _this, void*, const std::string& url, std::string* filename);
|
||||||
|
|
||||||
|
extern ContentProvider__findLocalFile_t ContentProvider__findLocalFile;
|
||||||
Loading…
Reference in New Issue