- Joined
- Mar 19, 2007
- Messages
- 879
- Reaction score
- 37
MRSDLL.dll is an easy way for all programmers to be able to access the MAIET
how do i encrypt thr MRS files with this??
anyways thanks
Is this a new version or something really diff.? And a new idea : Make an editor to edit .DLL files <3.
#include <windows.h>
#include <iostream>
using namespace std;
typedef bool (__stdcall* _OpenMRSFile)(char* MRSFileName);
typedef bool (__stdcall* _CloseMRSFile)();
typedef int (__stdcall* _GetFileCount)();
typedef char* (__stdcall* _GetFileName)(int Index);
int main(int argc, char* argv[])
{
_OpenMRSFile OpenMRSFile;
_CloseMRSFile CloseMRSFile;
_GetFileCount GetFileCount;
_GetFileName GetFileName;
HINSTANCE hInst = LoadLibrary(TEXT("MRSDLL.dll"));
OpenMRSFile = (_OpenMRSFile)GetProcAddress(hInst, "OpenMRSFile");
CloseMRSFile = (_CloseMRSFile)GetProcAddress(hInst, "CloseMRSFile");
GetFileCount = (_GetFileCount)GetProcAddress(hInst, "GetFileCount");
GetFileName = (_GetFileName)GetProcAddress(hInst, "GetFileName");
if(OpenMRSFile("model.mrs"))
{
for(int i = 0; i < GetFileCount(); i++)
{
cout << "file " << i << ": " << GetFileName(i) << "\n";
}
CloseMRSFile;
}
return 0;
}
The DLL isn't coded in C++ btw, it's coded in Delphi.
I'm inclined to think you have no idea what a DLL is.
Anyway, since the C++ code given in his example was a little botched and a little hard to read, I made a simple little project showing how to implement the DLL in C++ (using Visual Studio 2005, not sure if it'll work in 2008, I doubt it in a way).
Opens model.mrs and shows all the files in it. Simple enough.Code:#include <windows.h> #include <iostream> using namespace std; typedef bool (__stdcall* _OpenMRSFile)(char* MRSFileName); typedef bool (__stdcall* _CloseMRSFile)(); typedef int (__stdcall* _GetFileCount)(); typedef char* (__stdcall* _GetFileName)(int Index); int main(int argc, char* argv[]) { _OpenMRSFile OpenMRSFile; _CloseMRSFile CloseMRSFile; _GetFileCount GetFileCount; _GetFileName GetFileName; HINSTANCE hInst = LoadLibrary(TEXT("MRSDLL.dll")); OpenMRSFile = (_OpenMRSFile)GetProcAddress(hInst, "OpenMRSFile"); CloseMRSFile = (_CloseMRSFile)GetProcAddress(hInst, "CloseMRSFile"); GetFileCount = (_GetFileCount)GetProcAddress(hInst, "GetFileCount"); GetFileName = (_GetFileName)GetProcAddress(hInst, "GetFileName"); if(OpenMRSFile("model.mrs")) { for(int i = 0; i < GetFileCount(); i++) { cout << "file " << i << ": " << GetFileName(i) << "\n"; } CloseMRSFile; } return 0; }
#include <windows.h>
#include <iostream>
using namespace std;
typedef bool (__stdcall* _OpenMRSFile)(char* MRSFileName);
typedef bool (__stdcall* _CloseMRSFile)();
typedef int (__stdcall* _GetFileCount)();
typedef char* (__stdcall* _GetFileName)(int Index);
int main(int argc, char* argv[])
{
_OpenMRSFile OpenMRSFile;
_CloseMRSFile CloseMRSFile;
_GetFileCount GetFileCount;
_GetFileName GetFileName;
HINSTANCE hInst = LoadLibrary(TEXT("MRSDLL.dll"));
OpenMRSFile = (_OpenMRSFile)GetProcAddress(hInst, "OpenMRSFile");
CloseMRSFile = (_CloseMRSFile)GetProcAddress(hInst, "CloseMRSFile");
GetFileCount = (_GetFileCount)GetProcAddress(hInst, "GetFileCount");
GetFileName = (_GetFileName)GetProcAddress(hInst, "GetFileName");
if(OpenMRSFile("system.mrs"))
{
for(int i = 0; i < GetFileCount(); i++)
{
cout << "file " << i << ": " << GetFileName(i) << "\n";
}
CloseMRSFile;
}
return 0;
}
You can use the .dll with C++... The .dll itself is Delphi, that doesn't have to mean you can't use C++ to program with it.
so for system.mrs is...
Code:#include <windows.h> #include <iostream> using namespace std; typedef bool (__stdcall* _OpenMRSFile)(char* MRSFileName); typedef bool (__stdcall* _CloseMRSFile)(); typedef int (__stdcall* _GetFileCount)(); typedef char* (__stdcall* _GetFileName)(int Index); int main(int argc, char* argv[]) { _OpenMRSFile OpenMRSFile; _CloseMRSFile CloseMRSFile; _GetFileCount GetFileCount; _GetFileName GetFileName; HINSTANCE hInst = LoadLibrary(TEXT("MRSDLL.dll")); OpenMRSFile = (_OpenMRSFile)GetProcAddress(hInst, "OpenMRSFile"); CloseMRSFile = (_CloseMRSFile)GetProcAddress(hInst, "CloseMRSFile"); GetFileCount = (_GetFileCount)GetProcAddress(hInst, "GetFileCount"); GetFileName = (_GetFileName)GetProcAddress(hInst, "GetFileName"); if(OpenMRSFile("system.mrs")) { for(int i = 0; i < GetFileCount(); i++) { cout << "file " << i << ": " << GetFileName(i) << "\n"; } CloseMRSFile; } return 0; }