This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
modMain.bas
51 lines (40 loc) · 1.65 KB
/
modMain.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Attribute VB_Name = "modMain"
Option Explicit
' Main exec module for CFLDC
#Const ReleaseBuild = 1
Private Sub Main()
Dim success As Boolean
Dim file As String, outFile As String
Dim DecompileTime As Single
outFile = CStr(InStr(1, Command$(), " -o:" & Chr$(34)))
If InStr(1, Command$(), " -o:" & Chr$(34)) > 0 Then
file = LTrim$(RTrim$(Left$(Command$(), CLng(outFile))))
file = UnquoteString(file)
outFile = LTrim$(Right$(Command$(), Len(Command$()) - CLng(outFile)))
outFile = Right$(outFile, Len(outFile) - 3)
outFile = UnquoteString(outFile)
GoTo DecompileLUA
Else ' End If ' If InStr(1, Command$(), " -o:" & Chr$(34)) > 0 Then
file = UnquoteString(Command$())
End If ' If InStr(1, Command$(), " -o:" & Chr$(34)) > 0 Then
If Len(file) > 0 Then
GetFileName:
outFile = Left$(file, InStrRev(file, ".") - 1) & Replace$(file, ".", "_DC.", InStrRev(file, "."))
DecompileLUA:
DecompileTime = Timer
If Not LUA_Decompile(file, outFile) Then _
MsgBox "The LUA was not successfully decompiled!", _
vbApplicationModal + vbCritical + vbDefaultButton1 + vbOKOnly, _
"Cold Fusion LUA Decompiler"
DecompileTime = Timer - DecompileTime
Debug.Print DecompileTime
Else ' If Len(file) > 0 Then
#If ReleaseBuild Then
Load frmMain
frmMain.Show vbModal
#Else
file = App.path & "\Test.lua"
GoTo GetFileName
#End If
End If ' If Len(file) > 0 Then
End Sub