home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / MANIC_MINE2218421172012.psc / fMaker.frm < prev    next >
Text File  |  2011-11-30  |  4KB  |  131 lines

  1. VERSION 5.00
  2. Begin VB.Form fMaker 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "fmod.dll Maker"
  5.    ClientHeight    =   3105
  6.    ClientLeft      =   45
  7.    ClientTop       =   390
  8.    ClientWidth     =   4680
  9.    BeginProperty Font 
  10.       Name            =   "Arial"
  11.       Size            =   9
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    LinkTopic       =   "Form1"
  19.    MaxButton       =   0   'False
  20.    MinButton       =   0   'False
  21.    ScaleHeight     =   3105
  22.    ScaleWidth      =   4680
  23.    StartUpPosition =   3  'Windows Default
  24.    Begin VB.CommandButton cmdMakeDAT 
  25.       Caption         =   "Make DAT"
  26.       Height          =   435
  27.       Left            =   3285
  28.       TabIndex        =   2
  29.       Top             =   2520
  30.       Visible         =   0   'False
  31.       Width           =   1275
  32.    End
  33.    Begin VB.CommandButton cmdMakeDLL 
  34.       Caption         =   "Make DLL"
  35.       Height          =   435
  36.       Left            =   1770
  37.       TabIndex        =   1
  38.       Top             =   2520
  39.       Width           =   1275
  40.    End
  41.    Begin VB.ListBox List1 
  42.       BeginProperty Font 
  43.          Name            =   "Courier New"
  44.          Size            =   9
  45.          Charset         =   0
  46.          Weight          =   400
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   2085
  52.       Left            =   105
  53.       TabIndex        =   0
  54.       Top             =   120
  55.       Width           =   4455
  56.    End
  57. End
  58. Attribute VB_Name = "fMaker"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. 'MakeDLL - s short program which decodes the DLL from the DAT file in order to not put an executable onto PSCá':(áMove Comment inside Sub/Function/Property
  64. 'from http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=59767&lngWId=1á
  65. 'by Ron van Tilburg
  66.  
  67. Option Explicit
  68.  
  69. 'This reverses the XOR process shown belowá
  70.  
  71. Private Sub cmdMakeDLL_Click()
  72.  
  73. Dim DLL() As Long, DAT() As Long, XORVal As Long, CheckSum As Long, i As Long
  74.  
  75.     Open App.Path & "\fmod.dat" For Binary Access Read As #1
  76.     List1.AddItem "Got DAT - Length=" & LOF(1) & " bytes"
  77.     Open App.Path & "\fmod.dll" For Binary Access Write As #2
  78.  
  79.     ReDim DAT(0 To LOF(1) \ 4 - 1)
  80.     Get #1, , DAT()
  81.     ReDim DLL(0 To UBound(DAT) - 2) As Long
  82.  
  83.     XORVal = DAT(0) ' RVT9
  84.     CheckSum = DAT(1)
  85.  
  86.     For i = 2 To UBound(DAT)
  87.         DLL(i - 2) = DAT(i) Xor XORVal
  88.         CheckSum = CheckSum Xor DLL(i - 2)
  89.     Next i
  90.     Put #2, , DLL()
  91.     List1.AddItem "DLL Written - Length=" & LOF(2) & " bytes"
  92.     Close #1, #2
  93.  
  94.     If CheckSum = 0 Then
  95.         List1.AddItem "Decompile successful"
  96.         List1.AddItem "copy dll to"
  97.         List1.AddItem "\MM and \JSW folders"
  98.     Else
  99.         List1.AddItem "Decompile failed - the .DAT file"
  100.         List1.AddItem "may be corrupted - Checksum wrong"
  101.     End If
  102.  
  103. End Sub
  104.  
  105. 'This is how the DAT was made - its simple XOR encoding with XOR Checksum
  106.  
  107. Private Sub cmdMakeDAT_Click()
  108.  
  109. Dim DLL() As Long, DAT() As Long, XORVal As Long, CheckSum As Long, i As Long
  110.  
  111.     Open App.Path & "\fmod.dll" For Binary Access Read As #1
  112.     Open App.Path & "\fmod.dat" For Binary Access Write As #2
  113.  
  114.     ReDim DLL(0 To LOF(1) \ 4 - 1)
  115.     Get #1, , DLL()
  116.     ReDim DAT(0 To UBound(DLL) + 2) As Long
  117.  
  118.     XORVal = &H39545652 ' RVT9
  119.     CheckSum = 0
  120.  
  121.     For i = 0 To UBound(DLL)
  122.         CheckSum = CheckSum Xor DLL(i)
  123.         DAT(i + 2) = DLL(i) Xor XORVal
  124.     Next i
  125.     DAT(0) = XORVal
  126.     DAT(1) = CheckSum
  127.     Put #2, , DAT()
  128.     Close #1, #2
  129.  
  130. End Sub
  131.