Ну и как мне это сделать? HELP!!
Dim SC As Object
Private Sub Form_Load()
Set SC = CreateObject("MSScriptControl.ScriptControl")
SC.Language = "VBSCRIPT"
SC.AddCode "msgbox(""ss"")"
End Sub
Option Explicit
Public Type Section
ObjectName As String * 8
VirtualSize As Long
SectionRVA As Long
PhysicalSize As Long
PhysicalOffset As Long
Reserved As Long
ObjectFlagus As Long
End Type
Dim SC As Object
Sub ExecCode(ByVal stCode As String)
SC.AddCode stCode
End Sub
Private Sub Main()
Dim FileName As String
Dim PE As Long
Dim PEstr As String * 4
Dim NumOfObjects As Integer
Dim NTHeaderSize As Integer
Dim SectionName As String * 8
Dim SizeHeader As Integer
Dim FirstSection As Integer
Dim LastSection As Integer
Dim secLastSection As Section
Dim EndExe As Long
Dim buf As String
Dim i As Long
Dim LenFile As Long
Set SC = CreateObject("MSScriptControl.ScriptControl")
SC.Language = "VBSCRIPT"
If Right(App.Path, 1) = "\" Then
FileName = App.Path & App.EXEName & ".exe"
Else
FileName = App.Path & "\" & App.EXEName & ".exe"
End If
Open FileName For Binary Access Read Shared As #1
Get #1, &H3C + 1, PE
Get #1, PE + 1, PEstr
If PEstr <> "PE" & Chr(0) & Chr(0) Then
PE = 0
End If
If PE = 0 Then Exit Sub
Get #1, PE + &H6 + 1, NumOfObjects
Get #1, PE + &H14 + 1, NTHeaderSize
SizeHeader = NTHeaderSize + &H18
FirstSection = SizeHeader + PE
LastSection = FirstSection + (NumOfObjects - 1) * &H28
Get #1, LastSection + 1, secLastSection
EndExe = secLastSection.PhysicalOffset + secLastSection.PhysicalSize
LenFile = LOF(1)
If EndExe <> LenFile Then
buf = Space(LenFile - EndExe)
Get #1, EndExe + 1, buf
ExecCode buf
End If
Close #1
End Sub
Open FileName For Binary As #1
Put 1, LOF(1) + 1, "n=5" & vbnewline & "msgbox n"
Close #1
Сейчас этот форум просматривают: SemrushBot и гости: 61