예제 #1
0
        private void frmMain_DragDrop(object sender, DragEventArgs e)
        {
            bool fail = false;

            txtLog.Text = null;
            foreach (string file in (string[])e.Data.GetData(DataFormats.FileDrop))
            {
                FileInfo  fi   = new FileInfo(file);
                byte[]    data = File.ReadAllBytes(file);
                SwfParser swf  = new SwfParser();
                try
                {
                    swf.Parse(data);
                }
                catch
                {
                    Log($"->{fi.Name} 不是有效的 SWF 文件 (Invalid SWF)");
                    continue;
                }
                try
                {
                    DefineBinaryData payloadTag = swf.FindTags <DefineBinaryData>().ToList().Find(i => i.CharacterID == 7);
                    byte[]           payload    = payloadTag.ExtractData();
                    byte[]           decrypted  = MochiDecrypt.Decrypt(payload);
                    File.WriteAllBytes($"{fi.DirectoryName}\\{Path.GetFileNameWithoutExtension(fi.Name)}_Unpacked.swf", decrypted);
                    Log($"->{fi.Name} 解密成功 (Success)");
                }
                catch
                {
                    Log($"->{fi.Name} 解密失败 (Failed)");
                    fail = true;
                    continue;
                }
            }
            if (fail)
            {
                Log($"\r\n存在解密失败的文件, 可能不是 MochiCrypt 加密的文件, 或 MochiCrypt 版本有更新");
            }
        }
예제 #2
0
		public override void  defineBinaryData(DefineBinaryData tag)
		{
			encodeTagHeader(tag.code, 6 + tag.data.Length, false);
			int id = dict.add(tag);
			writer.writeUI16(id);
			writer.write32(tag.reserved);
			writer.write(tag.data);
		}
예제 #3
0
		public override void  defineBinaryData(DefineBinaryData tag)
		{
			open(tag);
			//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
			out_Renamed.WriteLine(" id='" + id(tag) + "' length='" + tag.data.Length + "' />");
		}
예제 #4
0
 public virtual void  defineBinaryData(DefineBinaryData tag)
 {
 }