VB.Net EXE Run It from Memory

First Step Load the EXE file in one stream and read it as an array of bytes: Hide   Copy Code // read the bytes from the application EXE file FileStream fs = new FileStream(filePath, FileMode.Open); BinaryReader br = new BinaryReader(fs); byte[] bin = br.ReadBytes(Convert.ToInt32(fs.Length)); fs.Close(); br.Close();...

read more

Vb.net DynamicAPI class to invoke Dll methods

Class module: NotInheritable Class DynamicAPI#Region "API"    <Runtime.InteropServices.DllImport("kernel32.dll", SetLastError:=True)> Private Shared Function LoadLibrary(ByVal lpFileName As String) As IntPtr    End Function    <Runtime.InteropServices.DllImport("kernel32.dll", SetLastError:=True, CharSet:=Runtime.InteropServices.CharSet.Ansi, ExactSpelling:=True)> Private Shared Function GetProcAddress(ByVal hModule As IntPtr, ByVal procName As String) As IntPtr    End Function    <Runtime.InteropServices.DllImport("kernel32.dll", SetLastError:=True,...

read more

VB.Net call method from DLL

your code in Test.dll Public Module Class1     Public Sub Show()         MsgBox("It works", MsgBoxStyle.Information, "Success")     End Sub End Module use the following code to run: Dim assem As System.Reflection.Assembly = Assembly.LoadFrom("Testdll.dll") Dim ty As Type = assem.GetType("Testdll.Class1") Dim...

read more

Copyright © Source Code Hacking. Designed by Momizat Team. Powered to Blogger by SpicyTweaks.

Scroll to top