#include "SpectrePrivate.h"
IMPLEMENT_PACKAGE(Spectre);
//extern "C" DLL_EXPORT TCHAR GPackage[];
//DLL_EXPORT TCHAR GPackage[] = TEXT("Spectre");
IMPLEMENT_CLASS(AUIEvents);
IMPLEMENT_FUNCTION(AUIEvents, -1, execgetNewLog);
void AUIEvents::execgetNewLog(FFrame& Stack, RESULT_DECL)
{
guard(AUIEvents::execgetNewLog)
P_FINISH;
//G->Logf(TEXT("in new print log() "));
GLog->Logf(TEXT("in new log() "));
*(TCHAR**)Result = TEXT("Just a test");
unguardexec;
}
You can use:So im trying to make a native dll since im so bored to keep using a limited library for interface, at the moment this is the code:
C++:#include "SpectrePrivate.h" IMPLEMENT_PACKAGE(Spectre); //extern "C" DLL_EXPORT TCHAR GPackage[]; //DLL_EXPORT TCHAR GPackage[] = TEXT("Spectre"); IMPLEMENT_CLASS(AUIEvents); IMPLEMENT_FUNCTION(AUIEvents, -1, execgetNewLog); void AUIEvents::execgetNewLog(FFrame& Stack, RESULT_DECL) { guard(AUIEvents::execgetNewLog) P_FINISH; //G->Logf(TEXT("in new print log() ")); GLog->Logf(TEXT("in new log() ")); *(TCHAR**)Result = TEXT("Just a test"); unguardexec; }
At my mind it was normal but when i open L2 i get Critical Error:
Could anyone give me a light on it?
i checked the post so what i got, is that you need to hook the Core with the Address of the function and pass the function itself, but how should i use this hookcore? make a dll entry? i made some kind of entry, but i couldnt get how it gonna work?You can use:
Как реализовать вызов из unreal script
Всем доброго утра, дня, вечера, ночи. Задался вопросом как реализовать из unreal script передачу параметра в кастомную dll которую прикрепляешь через cff explorer к fire.dll например. Банально передать текст из unreal script и чтобы эта DLL вывела сообщение в окне. Просто пытаюсь сделать...mmo-dev.info
Don't forget post source code after release to help people who have same problems.
#include "stdafx.h"
#include "Core\Inc\Core.h"
#include "Engine\Inc\Engine.h"
#define RESULT_DECL void* const Result
typedef void(*NativeFunc)(FFrame& stack, RESULT_DECL);
typedef BYTE(__cdecl* GRegisterNative_fnType)(INT iNative, NativeFunc Func);
GRegisterNative_fnType volatile GRegisterNative_fn = NULL;
extern "C" DLL_EXPORT TCHAR GPackage[];
DLL_EXPORT TCHAR GPackage[] = TEXT("Spectre");
void hookCore();
BOOL APIENTRY UIEvents( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
hookCore();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
//extern "C" DLL_EXPORT TCHAR GPackage[];
//DLL_EXPORT TCHAR GPackage[] = TEXT("Spectre");
void execgetNewLog(FFrame& Stack, RESULT_DECL)
{
//guard(AUIEvents::getNewLog)
//P_FINISH;
*(const TCHAR**)Result = TEXT("Just a test");
//unguardexec;
}
void hookCore()
{
auto hCore = GetModuleHandleA("Core.dll");
if (hCore) {
GRegisterNative_fn = (GRegisterNative_fnType)GetProcAddress(hCore, "?GRegisterNative@@YAEHABQ8UObject@@AEXAAUFFrame@@QAX@Z@Z");
if (GRegisterNative_fn)
{
GRegisterNative_fn(-1, &execgetNewLog);
}
}
}
What is UIEvents? maybe DllMain?C++:BOOL APIENTRY UIEvents( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: hookCore(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; }
Well on my knowledge i guess it was supposed to connect to Spectre.UIEvents, where Spectre is the File and UIEvents is the class like on .u file, inside Spectre.u theres a class called UIEvents.uc, so i was thinking its the same for dll or was it my mistake?@Spectre, what is UIEvents? maybe DllMain?
Вы не можете просматривать ссылку пожалуйста воспользуйтесь следующими ссылками Вход или Регистрация
This code uses an entry point with an incorrect function name. I have provided a link to more detailed information above. This is if you are trying to connect your DLL and during its initialization get a reference to a certain function from the Core.dllWell on my knowledge i guess it was supposed to connect to Spectre.UIEvents, where Spectre is the File and UIEvents is the class like on .u file, inside Spectre.u theres a class called UIEvents.uc, so i was thinking its the same for dll or was it my mistake?
Try attach with cff explorer DLL to fire.dllI did the changes but i get the same error
I guess thats not the right way to make it workTry attach with cff explorer DLL to fire.dll
you will have to inject the DLL anyway, otherwise it won't workI guess thats not the right way to make it work
#include "stdafx.h"
extern "C" __declspec(dllexport)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) // APIENTRY is alias WINAPI
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
MessageBox(nullptr, L"DLL_PROCESS_ATTACH", L"DllMain", MB_OK);
break;
}
case DLL_THREAD_ATTACH:
{
//MessageBox(nullptr, L"DLL_THREAD_ATTACH", L"DllMain", MB_OK);
break;
}
case DLL_THREAD_DETACH:
{
//MessageBox(nullptr, L"DLL_THREAD_DETACH", L"DllMain", MB_OK);
break;
}
case DLL_PROCESS_DETACH:
{
//MessageBox(nullptr, L"DLL_PROCESS_DETACH", L"DllMain", MB_OK);
break;
}
}
return TRUE;
}
thats what i first understood too, then i asked the author how he would do the hook the dll but he wants to do a native call, to do a native call you need to import through cff with a known original native dllВы не правильно поняли автора темы он хочет вызывать нативные функции из своей dll, используя скрипт *.uc который лежит в своем пакете *.u
Хотелось бы тоже узнать как это сделать)
Там пример есть, но что-то не то)Вы не правильно поняли автора темы он хочет вызывать нативные функции из своей dll, используя скрипт *.uc который лежит в своем пакете *.u
Хотелось бы тоже узнать как это сделать)
Maybe this is not the case for the author of the post, but unfortunately the vast majority of people are only looking for solutions. When they find the solution to their problem, they simply disappear without trying to help others on the forum or in the future who are looking for something along the same lines.Там пример есть, но что-то не то)
Хотелось бы не только вызывать код внутри dll, но и получать из dll например string с текстом.
Хорошо бы разобраться в этом и выложить готовые исходники с инклудами в ресурсы.
Guess current author want only changes for future mods on client or interface.Maybe this is not the case for the author of the post, but unfortunately the vast majority of people are only looking for solutions. When they find the solution to their problem, they simply disappear without trying to help others on the forum or in the future who are looking for something along the same lines.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?