Advertisement
lens0021

frmMain.vb from GrfWiz

Sep 13th, 2021
1,850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports VB = Microsoft.VisualBasic
  2.  
  3. Public Class frmMain
  4.     Inherits System.Windows.Forms.Form
  5.  
  6. #Region "Windows フォー? デザイナによって生成されたコード"
  7.     Public Sub New()
  8.         MyBase.New()
  9.         If m_vb6FormDefInstance Is Nothing Then
  10.             If m_InitializingDefInstance Then
  11.                 m_vb6FormDefInstance = Me
  12.             Else
  13.                 Try
  14.                     'スタート・ツェv フォー?については、最?に作成されたイ?スタ?スクm既ゾイ?スタ?スになります。
  15.                    If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
  16.                         m_vb6FormDefInstance = Me
  17.                     End If
  18.                 Catch
  19.                 End Try
  20.             End If
  21.         End If
  22.         '蓼の呼び出しは、Windows フォー? デザイナでアメ要です。
  23.        InitializeComponent()
  24.     End Sub
  25.     'Form は、コ?ポーネ?ト一?に後??を讎行するために dispose をオーバー?イドします。
  26.    Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
  27.         If Disposing Then
  28.             If Not components Is Nothing Then
  29.                 components.Dispose()
  30.             End If
  31.         End If
  32.         MyBase.Dispose(Disposing)
  33.     End Sub
  34.     'Windows フォー? デザイナでアメ要です。
  35.    Private components As System.ComponentModel.IContainer
  36.     Public ToolTip1 As System.Windows.Forms.ToolTip
  37.     Public WithEvents Command1 As System.Windows.Forms.Button
  38.     Public WithEvents Text1 As System.Windows.Forms.TextBox
  39.     Public WithEvents Label3 As System.Windows.Forms.Label
  40.     Public WithEvents Label1 As System.Windows.Forms.Label
  41.     '?? : 以下のプ?シージ?は Windows フォー? デザイナでアメ要です。
  42.    'Windows フォー? デザイナを使って変更でェスます。
  43.    'コードエディタを使って修正しないでください。
  44.    Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
  45.     Friend WithEvents Label2 As System.Windows.Forms.Label
  46.     Friend WithEvents cboDecode As System.Windows.Forms.ComboBox
  47.     Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
  48.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  49.     Friend WithEvents rbListOnly As System.Windows.Forms.RadioButton
  50.     Friend WithEvents Label4 As System.Windows.Forms.Label
  51.     Friend WithEvents cboEncoding As System.Windows.Forms.ComboBox
  52.     Friend WithEvents chkImg As System.Windows.Forms.CheckBox
  53.     Friend WithEvents chkAll As System.Windows.Forms.CheckBox
  54.     Friend WithEvents chkScr As System.Windows.Forms.CheckBox
  55.     Friend WithEvents chkCustomize As System.Windows.Forms.CheckBox
  56.     Friend WithEvents txtCustomize As System.Windows.Forms.TextBox
  57.  
  58.  
  59.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  60.         Me.components = New System.ComponentModel.Container
  61.         Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
  62.         Me.Command1 = New System.Windows.Forms.Button
  63.         Me.Text1 = New System.Windows.Forms.TextBox
  64.         Me.Label3 = New System.Windows.Forms.Label
  65.         Me.Label1 = New System.Windows.Forms.Label
  66.         Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
  67.         Me.Label2 = New System.Windows.Forms.Label
  68.         Me.cboDecode = New System.Windows.Forms.ComboBox
  69.         Me.rbListOnly = New System.Windows.Forms.RadioButton
  70.         Me.RadioButton2 = New System.Windows.Forms.RadioButton
  71.         Me.GroupBox1 = New System.Windows.Forms.GroupBox
  72.         Me.chkImg = New System.Windows.Forms.CheckBox
  73.         Me.chkScr = New System.Windows.Forms.CheckBox
  74.         Me.chkAll = New System.Windows.Forms.CheckBox
  75.         Me.Label4 = New System.Windows.Forms.Label
  76.         Me.cboEncoding = New System.Windows.Forms.ComboBox
  77.         Me.chkCustomize = New System.Windows.Forms.CheckBox
  78.         Me.txtCustomize = New System.Windows.Forms.TextBox
  79.         Me.GroupBox1.SuspendLayout()
  80.         Me.SuspendLayout()
  81.         '
  82.        'Command1
  83.        '
  84.        Me.Command1.BackColor = System.Drawing.SystemColors.Control
  85.         Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
  86.         Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
  87.         Me.Command1.Location = New System.Drawing.Point(0, 42)
  88.         Me.Command1.Name = "Command1"
  89.         Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
  90.         Me.Command1.Size = New System.Drawing.Size(440, 24)
  91.         Me.Command1.TabIndex = 2
  92.         Me.Command1.Text = "クムカ} / Unpack"
  93.         '
  94.        'Text1
  95.        '
  96.        Me.Text1.AcceptsReturn = True
  97.         Me.Text1.AutoSize = False
  98.         Me.Text1.BackColor = System.Drawing.SystemColors.Window
  99.         Me.Text1.Cursor = System.Windows.Forms.Cursors.IBeam
  100.         Me.Text1.ForeColor = System.Drawing.SystemColors.WindowText
  101.         Me.Text1.Location = New System.Drawing.Point(0, 16)
  102.         Me.Text1.MaxLength = 0
  103.         Me.Text1.Name = "Text1"
  104.         Me.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No
  105.         Me.Text1.Size = New System.Drawing.Size(440, 20)
  106.         Me.Text1.TabIndex = 0
  107.         Me.Text1.Text = "C:\Program Files\Arcturus\"
  108.         '
  109.        'Label3
  110.        '
  111.        Me.Label3.BackColor = System.Drawing.SystemColors.Control
  112.         Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  113.         Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
  114.         Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
  115.         Me.Label3.Location = New System.Drawing.Point(0, 144)
  116.         Me.Label3.Name = "Label3"
  117.         Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
  118.         Me.Label3.Size = New System.Drawing.Size(440, 16)
  119.         Me.Label3.TabIndex = 3
  120.         Me.Label3.Text = "Status"
  121.         '
  122.        'Label1
  123.        '
  124.        Me.Label1.BackColor = System.Drawing.SystemColors.Control
  125.         Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
  126.         Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
  127.         Me.Label1.Location = New System.Drawing.Point(0, 0)
  128.         Me.Label1.Name = "Label1"
  129.         Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
  130.         Me.Label1.Size = New System.Drawing.Size(440, 16)
  131.         Me.Label1.TabIndex = 1
  132.         Me.Label1.Text = "スミソ鬢J Ragnarok ク|/Enter Ragnarok Dir (C:\Program Files\Arcturus\)"
  133.         Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
  134.         '
  135.        'ProgressBar1
  136.        '
  137.        Me.ProgressBar1.Location = New System.Drawing.Point(0, 160)
  138.         Me.ProgressBar1.Name = "ProgressBar1"
  139.         Me.ProgressBar1.Size = New System.Drawing.Size(440, 16)
  140.         Me.ProgressBar1.TabIndex = 4
  141.         '
  142.        'Label2
  143.        '
  144.        Me.Label2.Location = New System.Drawing.Point(0, 72)
  145.         Me.Label2.Name = "Label2"
  146.         Me.Label2.Size = New System.Drawing.Size(112, 16)
  147.         Me.Label2.TabIndex = 5
  148.         Me.Label2.Text = "クムタ」カオ・リ / Unpack:"
  149.         '
  150.        'cboDecode
  151.        '
  152.        Me.cboDecode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  153.         Me.cboDecode.Items.AddRange(New Object() {"Data.pak", "Launcher.pak", "Music.pak"})
  154.         Me.cboDecode.Location = New System.Drawing.Point(112, 72)
  155.         Me.cboDecode.Name = "cboDecode"
  156.         Me.cboDecode.Size = New System.Drawing.Size(112, 20)
  157.         Me.cboDecode.TabIndex = 6
  158.         '
  159.        'rbListOnly
  160.        '
  161.        Me.rbListOnly.Checked = True
  162.         Me.rbListOnly.Location = New System.Drawing.Point(240, 72)
  163.         Me.rbListOnly.Name = "rbListOnly"
  164.         Me.rbListOnly.Size = New System.Drawing.Size(136, 16)
  165.         Me.rbListOnly.TabIndex = 7
  166.         Me.rbListOnly.TabStop = True
  167.         Me.rbListOnly.Text = "ヲC・Xタノョラ / List Files"
  168.         '
  169.        'RadioButton2
  170.        '
  171.        Me.RadioButton2.Location = New System.Drawing.Point(240, 88)
  172.         Me.RadioButton2.Name = "RadioButton2"
  173.         Me.RadioButton2.Size = New System.Drawing.Size(152, 16)
  174.         Me.RadioButton2.TabIndex = 8
  175.         Me.RadioButton2.Text = "クムタ」タノョラ / Extract Files"
  176.         '
  177.        'GroupBox1
  178.        '
  179.        Me.GroupBox1.Controls.Add(Me.txtCustomize)
  180.         Me.GroupBox1.Controls.Add(Me.chkCustomize)
  181.         Me.GroupBox1.Controls.Add(Me.chkImg)
  182.         Me.GroupBox1.Controls.Add(Me.chkScr)
  183.         Me.GroupBox1.Controls.Add(Me.chkAll)
  184.         Me.GroupBox1.Location = New System.Drawing.Point(232, 88)
  185.         Me.GroupBox1.Name = "GroupBox1"
  186.         Me.GroupBox1.Size = New System.Drawing.Size(200, 56)
  187.         Me.GroupBox1.TabIndex = 9
  188.         Me.GroupBox1.TabStop = False
  189.         Me.GroupBox1.Text = "GroupBox1"
  190.         '
  191.        'chkImg
  192.        '
  193.        Me.chkImg.Location = New System.Drawing.Point(104, 16)
  194.         Me.chkImg.Name = "chkImg"
  195.         Me.chkImg.Size = New System.Drawing.Size(88, 16)
  196.         Me.chkImg.TabIndex = 2
  197.         Me.chkImg.Tag = "|spr|tga|bmp|"
  198.         Me.chkImg.Text = "spr,tga,bmp"
  199.         '
  200.        'chkScr
  201.        '
  202.        Me.chkScr.Location = New System.Drawing.Point(48, 16)
  203.         Me.chkScr.Name = "chkScr"
  204.         Me.chkScr.Size = New System.Drawing.Size(56, 16)
  205.         Me.chkScr.TabIndex = 1
  206.         Me.chkScr.Tag = "|scr|ini|txt|rsa|rsw|jp|kr|ch"
  207.         Me.chkScr.Text = "Scripts"
  208.         '
  209.        'chkAll
  210.        '
  211.        Me.chkAll.Location = New System.Drawing.Point(8, 16)
  212.         Me.chkAll.Name = "chkAll"
  213.         Me.chkAll.Size = New System.Drawing.Size(40, 16)
  214.         Me.chkAll.TabIndex = 0
  215.         Me.chkAll.Text = "All"
  216.         '
  217.        'Label4
  218.        '
  219.        Me.Label4.Location = New System.Drawing.Point(0, 104)
  220.         Me.Label4.Name = "Label4"
  221.         Me.Label4.Size = New System.Drawing.Size(100, 16)
  222.         Me.Label4.TabIndex = 10
  223.         Me.Label4.Text = "スsスX / Encoding:"
  224.         '
  225.        'cboEncoding
  226.        '
  227.        Me.cboEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  228.         Me.cboEncoding.Items.AddRange(New Object() {" (System Default / ィtイホケwウ]ュネ)", "UTF-8 (GrfWiz Default / ケwウ])", "Big5 (Trad Chinese / チcナ鬢、、�)", "Shift_JIS (Japanese / 、鬢�)", "ISO-2022-KR (Korean / チ妤�)", "GB18030 (Simp Chinese /ツイナ鬢、、�)"})
  229.         Me.cboEncoding.Location = New System.Drawing.Point(112, 104)
  230.         Me.cboEncoding.Name = "cboEncoding"
  231.         Me.cboEncoding.Size = New System.Drawing.Size(112, 20)
  232.         Me.cboEncoding.TabIndex = 11
  233.         '
  234.        'chkCustomize
  235.        '
  236.        Me.chkCustomize.Location = New System.Drawing.Point(8, 32)
  237.         Me.chkCustomize.Name = "chkCustomize"
  238.         Me.chkCustomize.Size = New System.Drawing.Size(80, 16)
  239.         Me.chkCustomize.TabIndex = 3
  240.         Me.chkCustomize.Text = "Customize"
  241.         '
  242.        'txtCustomize
  243.        '
  244.        Me.txtCustomize.Location = New System.Drawing.Point(88, 32)
  245.         Me.txtCustomize.Name = "txtCustomize"
  246.         Me.txtCustomize.Size = New System.Drawing.Size(104, 19)
  247.         Me.txtCustomize.TabIndex = 4
  248.         Me.txtCustomize.Text = ""
  249.         '
  250.        'frmMain
  251.        '
  252.        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
  253.         Me.ClientSize = New System.Drawing.Size(440, 176)
  254.         Me.Controls.Add(Me.cboEncoding)
  255.         Me.Controls.Add(Me.Label4)
  256.         Me.Controls.Add(Me.RadioButton2)
  257.         Me.Controls.Add(Me.rbListOnly)
  258.         Me.Controls.Add(Me.cboDecode)
  259.         Me.Controls.Add(Me.Label2)
  260.         Me.Controls.Add(Me.ProgressBar1)
  261.         Me.Controls.Add(Me.Command1)
  262.         Me.Controls.Add(Me.Text1)
  263.         Me.Controls.Add(Me.Label3)
  264.         Me.Controls.Add(Me.Label1)
  265.         Me.Controls.Add(Me.GroupBox1)
  266.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
  267.         Me.MaximizeBox = False
  268.         Me.MinimizeBox = False
  269.         Me.Name = "frmMain"
  270.         Me.Text = "GrfWiz by ArtForz (Modified Version, 15/7/2004)"
  271.         Me.GroupBox1.ResumeLayout(False)
  272.         Me.ResumeLayout(False)
  273.  
  274.     End Sub
  275. #End Region
  276. #Region "・ツェvィ、?ード ウィザードのサポート コード"
  277.     Private Shared m_vb6FormDefInstance As frmMain
  278.     Private Shared m_InitializingDefInstance As Boolean
  279.     Public Shared Property DefInstance() As frmMain
  280.         Get
  281.             If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
  282.                 m_InitializingDefInstance = True
  283.                 m_vb6FormDefInstance = New frmMain
  284.                 m_InitializingDefInstance = False
  285.             End If
  286.             DefInstance = m_vb6FormDefInstance
  287.         End Get
  288.         Set(ByVal Value As frmMain)
  289.             m_vb6FormDefInstance = Value
  290.         End Set
  291.     End Property
  292. #End Region
  293.  
  294.     Private Declare Function MakeSureDirectoryPathExists Lib "IMAGEHLP.DLL" (ByVal DirPath As String) As Integer
  295.     Private Structure FSEntry
  296.         Dim NameLen As Byte
  297.         Dim ID As Byte
  298.         Dim StartOffset As Integer
  299.         Dim PackedLen As Integer
  300.         Dim UnpackedLen As Integer
  301.         'UPGRADE_NOTE: Name は Name_Renamed に・ツェvィ、?ードされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1061"' をク?ェNしてください。
  302.        Dim Name_Renamed As String
  303.     End Structure
  304.     Private FS() As frmMain.FSEntry
  305.  
  306.     Private Sub UnpackIt(ByRef FSIndex As Short)
  307.         Dim toUnpack As Boolean = False
  308.         Dim suffix As String = FS(FSIndex).Name_Renamed.Substring(FS(FSIndex).Name_Renamed.LastIndexOf(".") + 1)
  309.         If chkAll.Checked Then toUnpack = True
  310.         If chkScr.Checked And chkScr.Tag.IndexOf("|" + suffix + "|") > -1 Then toUnpack = True
  311.         If chkImg.Checked And chkImg.Tag.IndexOf("|" + suffix + "|") > -1 Then toUnpack = True
  312.         If chkCustomize.Checked And txtCustomize.Text.IndexOf("|" + suffix + "|") > -1 Then toUnpack = True
  313.  
  314.         If Not toUnpack Then Exit Sub
  315.  
  316.         'UPGRADE_WARNING: Dir にしい動作クm指ゾされています。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  317.        If Dir(Text1.Text & FS(FSIndex).Name_Renamed) <> "" Then Kill(Text1.Text & FS(FSIndex).Name_Renamed)
  318.         FileOpen(2, Text1.Text & FS(FSIndex).Name_Renamed, OpenMode.Binary, OpenAccess.Write, OpenShare.LockRead)
  319.         Dim posbyte As Byte
  320.         Dim x As Short
  321.         Dim y As Short
  322.         Dim curpos As Integer
  323.         Dim revint As Short
  324.         Dim lenbyte As Byte
  325.  
  326.         Dim inbyte() As Byte
  327.         ReDim inbyte(FS(FSIndex).PackedLen - 1)
  328.  
  329.         Dim outbyte() As Byte
  330.         ReDim outbyte(FS(FSIndex).UnpackedLen - 1)
  331.         Dim outpos As Integer
  332.  
  333.         'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  334.        FileGet(1, inbyte, FS(FSIndex).StartOffset + 1)
  335.         Do While True
  336.             posbyte = inbyte(curpos)
  337.             curpos = curpos + 1
  338.             If outpos >= FS(FSIndex).UnpackedLen Then Exit Do
  339.             For x = 1 To 8
  340.                 If (posbyte And 1) = 0 Then
  341.                     outbyte(outpos) = inbyte(curpos)
  342.                     outpos = outpos + 1
  343.                     If outpos >= FS(FSIndex).UnpackedLen Then Exit Do
  344.                     curpos = curpos + 1
  345.                     posbyte = Int(posbyte / 2)
  346.                 Else
  347.                     revint = inbyte(curpos)
  348.                     curpos = curpos + 1
  349.                     lenbyte = inbyte(curpos)
  350.                     curpos = curpos + 1
  351.                     revint = revint + (CShort(lenbyte And 15) * 256)
  352.                     lenbyte = Int(lenbyte / 16) + 2
  353.                     For y = 0 To lenbyte - 1
  354.                         outbyte(outpos) = outbyte(outpos - revint)
  355.                         outpos = outpos + 1
  356.                         If outpos >= FS(FSIndex).UnpackedLen Then Exit Do
  357.                     Next
  358.                     posbyte = Int(posbyte / 2)
  359.                 End If
  360.             Next
  361.         Loop
  362.         'UPGRADE_WARNING: Put は、FilePut に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  363.        FilePut(2, outbyte, 1)
  364.         FileClose(2)
  365.     End Sub
  366.  
  367.     Private Function RevBitString(ByRef InString As String) As String
  368.         Dim x As Short
  369.         Dim outstr As String
  370.         For x = 1 To Len(InString)
  371.             outstr = outstr & Chr((CShort(Asc(Mid(InString, x, 1)) And CShort(&HFS)) * 16) + Int(CShort(Asc(Mid(InString, x, 1)) And CShort(&HF0S)) / 16))
  372.         Next
  373.         RevBitString = outstr
  374.     End Function
  375.  
  376.     Private Function DecodeFS(ByRef FileName As String) As Boolean
  377.         '        On Error GoTo errie
  378.        FileOpen(1, Text1.Text & FileName, OpenMode.Binary, OpenAccess.Read, OpenShare.LockWrite)
  379.         FileOpen(3, Text1.Text & FileName & "-FS.log", OpenMode.Append)
  380.  
  381.         Dim DummyByte As Byte
  382.         Dim StartOfFS As Integer
  383.         Dim FSEntryCount As Short
  384.         Dim x As Short
  385.  
  386.         Dim encoding As System.Text.Encoding = System.Text.Encoding.GetEncoding(cboEncoding.SelectedItem.Substring(0, cboEncoding.SelectedItem.IndexOf(" ")))
  387.  
  388.         Label3.Text = FileName & " : ・ソヲb、タェRオイコc (Analyzing Structure)"
  389.         System.Windows.Forms.Application.DoEvents()
  390.  
  391.         'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  392.        FileGet(1, FSEntryCount, LOF(1) - 4)
  393.         ReDim FS(FSEntryCount - 1)
  394.  
  395.         'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  396.        FileGet(1, StartOfFS, LOF(1) - 8)
  397.  
  398.         PrintLine(3, Text1.Text)
  399.         PrintLine(3, FileName)
  400.         'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  401.        FileGet(1, DummyByte, StartOfFS)
  402.         For x = 0 To UBound(FS)
  403.             'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  404.            FileGet(1, FS(x).NameLen)
  405.             'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  406.            FileGet(1, FS(x).ID)
  407.             '    If FS(x).ID > 2 Or FS(x).ID < 1 Then MsgBox "ID " + CStr(FS(x).ID)
  408.            'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  409.            FileGet(1, FS(x).StartOffset)
  410.             'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  411.            FileGet(1, FS(x).PackedLen)
  412.             'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  413.            FileGet(1, FS(x).UnpackedLen)
  414.             'FS(x).Name_Renamed = New String(Chr(0), FS(x).NameLen)
  415.            'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  416.            'FileGet(1, FS(x).Name_Renamed)
  417.            Dim bytecode() As Byte
  418.             ReDim bytecode(FS(x).NameLen - 1)
  419.             Dim a
  420.             For a = 1 To FS(x).NameLen
  421.                 FileGet(1, bytecode(a - 1))
  422.             Next a
  423.             'FS(x).Name_Renamed = System.Text.Encoding.GetEncoding(949).GetString(bytecode)
  424.            FS(x).Name_Renamed = encoding.GetString(bytecode)
  425.  
  426.             '    FS(x).Name = Replace(RevBitString(FS(x).Name), "/", "\")
  427.            FS(x).Name_Renamed = Replace(FS(x).Name_Renamed, "/", "\")
  428.             If FS(x).ID = 1 Then
  429.                 PrintLine(3, "F " & FS(x).Name_Renamed)
  430.             Else
  431.                 PrintLine(3, "D " & FS(x).Name_Renamed)
  432.             End If
  433.             'UPGRADE_WARNING: Get は、FileGet に・ツェvィ、?ードされ、しい動作クm指ゾされました。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  434.            FileGet(1, DummyByte)
  435.             '    If DummyByte > 0 Then MsgBox "DB " + CStr(DummyByte)
  436.        Next
  437.         PrintLine(3, "")
  438.         FileClose(3)
  439.  
  440.         If (rbListOnly.Checked) Then
  441.             Label3.Text = FileName & " : ァケヲィヲC・X (Done Listing)"
  442.             FileClose(1)
  443.             FileClose(2)
  444.             Shell(Environ("windir") + "\NotePad.exe """ + Text1.Text & FileName & "-FS.log" + """", AppWinStyle.NormalFocus)
  445.             Exit Function
  446.         Else
  447.  
  448.             For x = 0 To UBound(FS)
  449.                 If FS(x).ID = 2 Then MakeSureDirectoryPathExists(Text1.Text & FS(x).Name_Renamed & "\")
  450.             Next
  451.             For x = 0 To UBound(FS)
  452.                 If FS(x).ID = 1 Then
  453.                     Label3.Text = FileName & " :  ・ソヲbクムカ} (Unpacking) " & VB.Right(FS(x).Name_Renamed, Len(FS(x).Name_Renamed) - InStrRev(FS(x).Name_Renamed, "\"))
  454.                     ToolTip1.SetToolTip(ProgressBar1, CStr(x) & "/" & CStr(UBound(FS)))
  455.                     'UPGRADE_WARNING: オブジェクト ProgressBar1.Value の既ゾプ?パティを解?でェスませんでした。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"' をク?ェNしてください。
  456.                    ProgressBar1.Value = x * 100 / UBound(FS)
  457.                     System.Windows.Forms.Application.DoEvents()
  458.                     If (FS(x).PackedLen > 0) And (FS(x).UnpackedLen > 0) Then UnpackIt(x)
  459.                 End If
  460.             Next
  461.  
  462.             'UPGRADE_WARNING: オブジェクト ProgressBar1.Value の既ゾプ?パティを解?でェスませんでした。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"' をク?ェNしてください。
  463.            ProgressBar1.Value = 0
  464.             Label3.Text = FileName & " : ァケヲィクムカ} (Done Unpacking)"
  465.             FileClose(1)
  466.             FileClose(2)
  467.             DecodeFS = True
  468.             Exit Function
  469.         End If
  470. errie:
  471.         'UPGRADE_WARNING: オブジェクト ProgressBar1.Value の既ゾプ?パティを解?でェスませんでした。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"' をク?ェNしてください。
  472.        ProgressBar1.Value = 0
  473.         Label3.Text = FileName & " : ソ�~。G、wゥムカ} (Error: Unpacking Aborted)"
  474.         FileClose(1)
  475.         FileClose(2)
  476.         FileClose(3)
  477.         DecodeFS = False
  478.     End Function
  479.  
  480.     Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
  481.         Command1.Text = "・ソヲbクムカ} (Unpacking)..."
  482.         Command1.Enabled = False
  483.         Dim retval As Boolean
  484.         Dim x As Short
  485.         Dim tstr As String
  486.         If VB.Right(Text1.Text, 1) = "\" Then
  487.             'UPGRADE_WARNING: Dir にしい動作クm指ゾされています。 詳細については、'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1041"' をク?ェNしてください。
  488.            'If Len(Dir(Text1.Text & "data.pak")) > 0 Then
  489.            '    retval = DecodeFS("data.pak")
  490.            If Len(Dir(Text1.Text & cboDecode.SelectedItem)) > 0 Then
  491.                 retval = DecodeFS(cboDecode.SelectedItem)
  492.                 If Not retval Then GoTo errie
  493.                 '    For x = 0 To 899
  494.                '        If Len(Dir(Text1.Text + "edata" + Format(x, "000") + ".grf")) > 0 Then
  495.                '            retval = DecodeFS("edata" + Format(x, "000") + ".grf")
  496.                '            If Not retval Then GoTo errie
  497.                '        End If
  498.                '        If Len(Dir(Text1.Text + "jdata" + Format(x, "000") + ".grf")) > 0 Then
  499.                '            retval = DecodeFS("jdata" + Format(x, "000") + ".grf")
  500.                '            If Not retval Then GoTo errie
  501.                '        End If
  502.                '        If Len(Dir(Text1.Text + "gdata" + Format(x, "000") + ".grf")) > 0 Then
  503.                '            retval = DecodeFS("gdata" + Format(x, "000") + ".grf")
  504.                '            If Not retval Then GoTo errie
  505.                '        End If
  506.                '    Next
  507.                Label3.Text = "、wクムスXゥメヲウタノョラ (Decoded all Files, have fun)"
  508.             End If
  509.         Else
  510.             tstr = Microsoft.VisualBasic.Right(Text1.Text, Len(Text1.Text) - InStrRev(Text1.Text, "\"))
  511.             Text1.Text = Microsoft.VisualBasic.Left(Text1.Text, InStrRev(Text1.Text, "\"))
  512.             retval = DecodeFS(tstr)
  513.             If Not retval Then GoTo errie
  514.             Label3.Text = "、wクムスX (Decoded) " + tstr + ", have fun"
  515.         End If
  516. errie:
  517.         Command1.Text = "Unpack"
  518.         Command1.Enabled = True
  519.     End Sub
  520.  
  521.     Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  522.  
  523.     End Sub
  524.  
  525.     Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  526.         cboDecode.SelectedIndex = 0
  527.         cboEncoding.Items().Item(0) = System.Text.Encoding.Default.WebName + cboEncoding.Items().Item(0)
  528.         cboEncoding.SelectedIndex = 0
  529.     End Sub
  530.  
  531.     Private Sub chkCustomize_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCustomize.CheckedChanged
  532.         If (chkCustomize.Checked) Then
  533.             MsgBox("ュYュnィマ・ホヲケ・\ッ爍Aスミ・ホ | クケ、タケjゥメヲウゥオヲ�ノョラ。Aィメヲp |*.rsw|*.bmp| エNキ|テB・~クムタ」チY rsw 、ホ bmp タノョラ (スミッdキNウフォeュア、ホウフォ皴アェコ | クケ。I)。C" & vbCrLf & vbCrLf & _
  534.             "To use this function, please use | (Pipe) to seperate all file extensions, e.g. |*.rsw|*.bmp| will extract 'rsw' and 'bmp' files (Please note the | at very first and very last!).", MsgBoxStyle.OKOnly Or MsgBoxStyle.Information)
  535.         End If
  536.     End Sub
  537. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement