Forum > Coding >

How to execute a C# function in my exploit by Lua

Posts: 21

Threads: 6

Joined: May, 2018

Reputation: 0

Posted

Didn't really know where to ask this. I can make a script that retrieves a value from the game (that's not that hard), and I can make a C# function that handles the retrieved values, but how do I get my Lua script to run my C# function?

  • 0

Posts: 146

Threads: 28

Joined: Sep, 2019

Reputation: 19

Replied

I'm pretty sure the only way you would be able to acomplish this is through a custom function in a DLL

  • 0

jex

yes

Posts: 1791

Threads: 110

Joined: Nov, 2019

Reputation: 13

Replied

@AtlasDevelopment stop saying everything i was gonna say

 

;(

  • 0

yes

Posts: 21

Threads: 6

Joined: May, 2018

Reputation: 0

Replied

A custom function in exploit-main.dll or WeAreDevs_API.dll?

  • 0

Posts: 63

Threads: 18

Joined: Jan, 2020

Reputation: 0

Replied

zesty meant something else... you need to create your own dll, not the wearedevs api.

 

Whatever... ...the WeAreDevs API added a lua function that can call C# or C++ functions...

 

function dosomethin()

WrapGlobal("some code here...");

end

  • 0

Added

btw just stop listening ti Jex and zesty, cuz they think that Wearedevs API is bad, and they tell us to make a custom dll, when they cant...

 

  • 0

Posts: 21

Threads: 6

Joined: May, 2018

Reputation: 0

Replied

So my script should be like:

 

function dosomething()

    WrapGlobal("Test('Hello World!');")

end

 

dosomething()

 

and my exploit's code like:

 

namespace Exploit {

    public partial class Form1 : Form {

        Exploit api = new ExploitAPI();

 

        void Test(string a) {

            label1.Text = a;

        }

 

        public Form1() {

            InitializeComponent();

        }

 

        private void InjectButton_Click(object sender, EventArgs e) {

            api.LaunchExploit();

        }

 

        private void ExecuteButton_Click(object sender, EventArgs e) {

            api.SendLuaScript(richTextbox1.Text);

        }

    }

}

? I really don't know anything about the WrapGlobal function.

  • 0

Posts: 63

Threads: 18

Joined: Jan, 2020

Reputation: 0

Replied

I believe so... ...Or it might just execute C++ instead of C#... ...I'm gonna just have to research this...

  • 0

Posts: 21

Threads: 6

Joined: May, 2018

Reputation: 0

Replied

@Exblox Hmmm that might be a problem, my exploit has one job which is downloading roblox places (aka saveInstance). However, to write .rbxl files I use a C# DLL and I don't know if C++ code would be able to use it. And the code I tried didn't work (the example above) :/

  • 0

Users viewing this thread:

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