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
Private Sub Main()
'(c) ism, 2005
'i-s-m@inbox.ru
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
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
MsgBox "Информация из зада: " & buf
End If
Close #1
End Sub
tyomitch писал(а):Santa, а где противоречие-то?.
tyomitch писал(а):Santa, RAR именно дописывает архив в конец SFX-модуля. Это не ресурс никакой.
Santa писал(а):tyomitch писал(а):Santa, RAR именно дописывает архив в конец SFX-модуля. Это не ресурс никакой.
Но почему с ресурсом всё проходит как с SFX-ом!
Сейчас этот форум просматривают: AhrefsBot и гости: 124