Categories > Coding > C++ >

Where to put the wearedevs c++ api's import function ?

Posts: 29

Threads: 18

Joined: Oct, 2021

Reputation: 0

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?

  • 0

Posts: 189

Threads: 19

Joined: Jul, 2021

Reputation: 6

Replied

@_realnickk

its there

https://cdn.discordapp.com/attachments/890438114298974209/902051542360817684/unknown.png

  • 0

10 years ago

Posts: 29

Threads: 18

Joined: Oct, 2021

Reputation: 0

Replied

I know cpp.Where should I put that dll import code?

  • 0

Posts: 504

Threads: 32

Joined: Aug, 2021

Reputation: 54

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

  • 0

MINISHXP

[REDACTED]

Posts: 974

Threads: 3

Joined: Jan, 2021

Reputation: 9

Replied

https://docs.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-160

  • 0

RealChronics

Roblox Trafficker

vip

Posts: 279

Threads: 32

Joined: Dec, 2020

Reputation: 20

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);

  • 0

https://media.discordapp.net/attachments/979496861738086420/981316649661632562/4353979.png

https://cdn.discordapp.com/attachments/930896685230612592/931747495514628207/unknown.png

 

Posts: 5

Threads: 1

Joined: Oct, 2021

Reputation: 1

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

  • 0

Ch0nky

xChonkster

Posts: 71

Threads: 8

Joined: Nov, 2020

Reputation: 8

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"));
  • 0

still writing arch v2

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )