Categories > Coding > C++ >
Where to put the wearedevs c++ api's import function ?
Posted
I made a basic hello world project in c++ and I downloaded the api,I dragged it in my builded project when I write the commands that are necessary like dll import it gives me an error and I think that I puted it on a wrong line.Can anyone tell me more clear how to put the code.The project looks like this:
#include <iostream>
using namespace std;
int main(){
cout "Hello world";
}
Where should I put that dll import in this case?
Replied
its there
https://cdn.discordapp.com/attachments/890438114298974209/902051542360817684/unknown.png
Cancel
Post
10 years ago
Replied
I know cpp.Where should I put that dll import code?
Cancel
Post
Replied
I think it's #import dllname.dll
might be wrong tho, haven't done c++ for a while. You should probably check on yt
Cancel
Post
Replied
https://docs.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-160
Cancel
Post
Replied
[DllImport("WeAreDevs_API.cpp.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool LaunchExploit();
[DllImport("WeAreDevs_API.cpp.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool SendLuaCScript(string script);
[DllImport("WeAreDevs_API.cpp.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool SendLuaScript(string script);
Cancel
Post
https://media.discordapp.net/attachments/979496861738086420/981316649661632562/4353979.png
https://cdn.discordapp.com/attachments/930896685230612592/931747495514628207/unknown.png
Replied
@RealChronics they want C/C++ code, and as people have already told OP, they should learn C/C++ and the Windows API functions (LoadLibraryA and GetProcAddress if that helps)
@MINISHXP that walkthrough doesn't really work because WeAreDevs doesn't distribute the lib file to link it during compile-time, so you have to load the library manually, and get its functions pointers
Cancel
Post
Replied
[EDIT]
const auto module = LoadLibraryA("path_to_dll");
const auto launch_exploit = reinterpret_cast<bool(__cdecl*)(void)>(GetProcAddress(module, "LaunchExploit"));
const auto send_luac = reinterpret_cast<bool(__cdecl*)(const char*)>(GetProcAddress(module, "SendLuaCScript"));
const auto send_command = reinterpret_cast<bool(__cdecl*)(const char*)>(GetProcAddress(module, "SendCommand"));
const auto send_l_lua = reinterpret_cast<bool(__cdecl*)(const char*)>(GetProcAddress(module, "SendLimitedLuaScript")); // why
const auto send_lua = reinterpret_cast<bool(__cdecl*)(const char*)>(GetProcAddress(module, "SendLuaScript"));
Cancel
Post
still writing arch v2
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post