[VB.Net] Download and Execute in Memory

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
Hello, the code works fine with .Net applications but here is the problem, it doesnt work with C++ applications

here my code

C#:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        DownloadExecute("https://example.com/test.exe")
    End Sub

    Public Sub DownloadExecute(ByVal url As String)
        Dim c As New WebClient
        Execute(c.DownloadData(url))
    End Sub

    Public Sub Execute(ByVal bytes As Byte())
        Dim t As New Thread(AddressOf DoExecute)
        t.TrySetApartmentState(ApartmentState.STA)
        t.Start(bytes)
    End Sub

    Public Sub DoExecute(ByVal d As Byte())
        Dim asm As Assembly = Assembly.Load(d)
            Dim entryPoint As MethodInfo = asm.EntryPoint
            Dim o As Object() = Nothing
            If entryPoint.GetParameters().Length > 0 Then
                o = New Object() {New String() {"1"}}
            End If
            entryPoint.Invoke(Nothing, o)
            Application.Exit()
    End Sub
do you guys have any clue?
 

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
Hello, the code works fine with .Net applications but here is the problem, it doesnt work with C++ applications

here my code

C#:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        DownloadExecute("https://example.com/test.exe")
    End Sub

    Public Sub DownloadExecute(ByVal url As String)
        Dim c As New WebClient
        Execute(c.DownloadData(url))
    End Sub

    Public Sub Execute(ByVal bytes As Byte())
        Dim t As New Thread(AddressOf DoExecute)
        t.TrySetApartmentState(ApartmentState.STA)
        t.Start(bytes)
    End Sub

    Public Sub DoExecute(ByVal d As Byte())
        Dim asm As Assembly = Assembly.Load(d)
            Dim entryPoint As MethodInfo = asm.EntryPoint
            Dim o As Object() = Nothing
            If entryPoint.GetParameters().Length > 0 Then
                o = New Object() {New String() {"1"}}
            End If
            entryPoint.Invoke(Nothing, o)
            Application.Exit()
    End Sub
do you guys have any clue?
It's because Assembly.Load is limited to .NET assemblies (.NET files). Is it by choice that you're not saving the file to your hard drive, or by coincidence? It will be a lot easier to simply save the file to your hard drive and then run it, than running it directly from memory, although it is of course possible. I'll see if you've responded tomorrow and see if I can code a solution for you, but it's late now, so I'm going to bed.
 

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
ya if you could would be awesome, as i don't know how this is done, could also learn from it :)
 

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
ya if you could would be awesome, as i don't know how this is done, could also learn from it :)
I'm on vacation atm, so I won't have time to code anything for you, not even pseudo code. I'll have a look at it again on the 28 of April. Seems like you only check back in intervals, so that should be just fine.

EDIT: Have a look at manual map injection. That method of injection basically acts like the Windows loader (which is what you need), before injecting the file. I believe that there's a C# library out there, you can either look through the code and take what you need, or you can simply compile to solution and then add a reference to the output dll, and then use it.

Search results here!
 
Last edited:

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
I'm on vacation atm, so I won't have time to code anything for you, not even pseudo code. I'll have a look at it again on the 28 of April. Seems like you only check back in intervals, so that should be just fine.

EDIT: Have a look at manual map injection. That method of injection basically acts like the Windows loader (which is what you need), before injecting the file. I believe that there's a C# library out there, you can either look through the code and take what you need, or you can simply compile to solution and then add a reference to the output dll, and then use it.

Search results here!
thx for the reply Helios :), but the file im using is not a dll, it's a .exe file, well we will get back to this when ur home from vacation :)

enjoy your vacation man :)
 

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
thx for the reply Helios :), but the file im using is not a dll, it's a .exe file, well we will get back to this when ur home from vacation :)

enjoy your vacation man :)
I had a bit of time on my hand this evening, so I thought I'd have a look at the thread. It should be able to inject any native win32 executable (exe, dll, sys, fon, etc.). Give it a try if you haven't already.

Thanks man, I will :D
 

mcdeliver18

Newbie
Full Member
Apr 9, 2013
16
212
0
thx Helios for your help, but this is still drama for me :p haha, i'll put the file on harddisk, i have it working on that way, it will dump the file in the Temp location and then execute it :)

btw are you the Helios from AA?
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods