keganhollern / infinity Goto Github PK
View Code? Open in Web Editor NEWA plugin and extension framework for the Enfusion engine
License: MIT License
A plugin and extension framework for the Enfusion engine
License: MIT License
Crash occurs on a = "";
Code used to set the value of a, b, and c:
void NonNativeWithThreeOutStringsFunction(Enscript::FunctionContext* pContext, void* pUnkn)
{
Infinity::Logging::Print("NonNativeWithThreeOutStringsFunction was called!");
if (!pContext) {
Logging::Print("pContext was NULL");
return;
}
if (!pContext->GetArgument(0) || !pContext->GetArgument(1) || !pContext->GetArgument(2)) {
Logging::Print("pContext had missing arguments");
return;
}
//value is NULL so this will be blank
//Logging::Print("Argument value before: %s", pContext->GetArgument(0)->Value);
//if we need to ensure that our string's are not released, we need to use "new" and copy our memory into the buffer
char* new_value1 = new char[6];
strcpy(new_value1, "Test0");
char* new_value2 = new char[6];
strcpy(new_value2 , "Test1");
char* new_value3 = new char[6];
strcpy(new_value3, "Test2");
pContext->GetArgument(0)->Value = new_value1; //each of these *need* their own buffers, because they are different strings in Enscript & we don't want a change to string 1 to modify string 2 and 3
pContext->GetArgument(1)->Value = new_value2;
pContext->GetArgument(2)->Value = new_value3;
Logging::Print("Argument Values: %s, %s, %s", pContext->GetArgument(0)->Value, pContext->GetArgument(1)->Value, pContext->GetArgument(2)->Value);
}
This issue occurs because Enfusion expects a special allocation structure for our string. We are missing that structure. When the game goes to free the string from memory, it crashes.
Minhook is already packaged in BIDebugEngine. We should add a HookFunction method to Infinity::Utils that can allow plugins to make use of this library.
Have been working with a few others at the prospect of making a DLL based anti-cheat that monitors for certain RPC calls and detection vectors for things like speedhack etc since BattlEye can't do its' job. I've previously made an RVExtension for DayZ 0.44 that does some of these things. Long story short, will BattlEye accept plugins that are made using this system?
Console Output:
HookInit: Successfully hooked InitModules @ 00007FF660C36890
HookInit: Successfully hooked CanAccessFile @ 00007FF660CC43D0
HookInit: Successfully hooked IsValidForMode @ 00007FF660C4A660
InitModules: Initializing modules...
Loading plugins from: D:\SteamLibrary\steamapps\common\DayZ\Plugins\
Found Plugin: ExamplePlugin
[Plugin] Plugin Load!
[Plugin] RegisterFunction: Registering plugin function TestPluginFunc @ 00007FFC083110B0...
[Plugin] RegisterObject: Registering plugin object ExampleTestClass
[Plugin] RegisterFunction: Registering plugin function Create @ 00007FFC08311010...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.