|
Создание консоли из текстового файла |
|
|
Довольно интересная штуковина... Создаёт exe из текстового файла. Поулчается
консольное приложение, в котором печатается заданный текст. Option Explicit
Public Function HiByte(ByVal wParam As Integer)
HiByte = wParam \ &H100 And &HFF&
End Function
Public Function LoByte(ByVal wParam As Integer)
LoByte = wParam And &HFF&
End Function
Private Sub Command1_Click()
Dim a(14) As Byte
Dim i As Integer
Dim s As String
Dim tmp As String
a(0) = 190
a(1) = 15
a(2) = 1
a(3) = 185
a(6) = 252
a(7) = 172
a(8) = 205
a(9) = 41
a(10) = 73
a(11) = 117
a(12) = 250
a(13) = 205
a(14) = 32
Open "C:\1.txt" For Binary As #1
a(4) = LoByte(LOF(1))
a(5) = HiByte(LOF(1))
s = Space$(LOF(1))
Get #1, , s
Close #1
For i = 0 To 14
tmp = tmp & Chr(a(i))
Next
s = tmp & s
Open "C:\1.exe" For Binary As #1
Put #1, , s
Close #1
End Sub
|
|
|
|
|
|
|