Secret of Flash Tool - Swf2exe

zhaozj2021-02-16  50

Online We can download a lot of wonderful flash animations, they usually * .swf form, if there is no flash or Flash player installed in our computer, then they cannot shine in our computer. This will be a very unfortunate thing, we can write a tool with VB, convert the Flash animation of the SWF into an executable (exe)? Of course, let's take a step by step to make this gadget - Swf2exe. In order to write this gadget, we must first analyze the basic format of the SWF form and the EXE form FLASH file. Due to the space limit, given a lot of articles in the SWF form and EXE format in the online, I just briefly explain the knowledge you're used in this program, other no longer say, please refer to yourself related articles. You can also use UltraEdit to analyze it. The EXE form file is divided into four parts: the player, SWF file, an identifier in the form of Flash (16) is 56 34 12 FA) and the size of the corresponding SWF file. Understand the format of the exe form Flash file, let's take a step-by-step programming. The first step: Define the resource file to open VB and create an EXE file. Add the player FlashPla.exe from Flash5 to a custom resource and saved as project 1.RES. The property is as follows: Type: "Custom" No .: 101 Language: Chinese (China) Step 2: Creating a Program Interface () Control Add as shown in Figure 1, the control property is default. Step 3: Writing the code The following is the code part of this program, relatively simple, and the comments are also more detailed, I believe that everyone can easily understand.

PRIVATE SUB Command1_Click () const filesize = 376832 'Define Generated Player Some Size DIM EXTOG AS Long' Defines EXE Formal Identifier DIM Filelong As Long Dim Copy () AS Byte Copy = LoadResData (101, "Custom") 'Put resources File storage in copy () Open text1.text for binary as # 1 'Open the SWF file Open text2.text for binary as # 2' creates the generated EXE file 'to write the player in binary form Content Writing File 2 for Filelong = 0 To FileSize - 1 Put # 2, Copy (filelong) Next Filelong 'Write SWF file into file 2 Filelong = Lof (1) Redim Copy (Filelong - 1) AS BYTE GET # 1,, Copy Put # 2, Copy 'Write EXE File Identifier Filelong = LOF (2) EXETOG = 1193046' 1193046 is the first three words in the form of EXE form (56 34 12 FA) The decimal value of the section 56 34 12 PUT # 2, EXTOG Seek # 2, Filelong 4 'Adjustment file pointer to the Filelong 4 byte EXTOG = 250' 250 is the last byte of the identifier in the form of the identifier for the final byte fa Value Put # 2, EXETOG Seek # 2, Filelong 5 'Adjust file pointer to Filelong 5 byte' Write SWF file length Filelong = Lof (1) Put # 2, Filelong Close # 1 Close # 21nd Subprivate SUB command2_click () end 'Exit End Sub

Private Sub Form_Load () 'Initialization Form1.caption = "EX2SWF" Label1.caption = "SWF file path:" label2.caption = "EXE file path:" text1.text = "Text2.text =" "Command1.caption = "Conversion" command2.caption = "Exit" End Sub

http://sl_zyy.y365.com

转载请注明原文地址:https://www.9cbs.com/read-26216.html

New Post(0)