Код:
//sample.c
#define UNICODE
#include <windows.h>
#define DLL_EXPORT __declspec(dllexport) __stdcall
void DLL_EXPORT FromClient(wchar_t* pck)
{
if (pck[0]==0x38 && pck[1]==0x78 && pck[3]==0x78)
MessageBox(0,L"medved",L"preved",0);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
return TRUE;
}
Код:
//samplescript.txt
var
lib:Integer;
procedure Init;
begin
lib:=loadLibrary('sample.dll');
end;
procedure Free;
begin
FreeLibrary(lib);
end;
begin
if FromClient then
begin
CallFunction(lib,'FromClient',1,[pck]);
end;
end.
примерно вот так :D