CN103226672B - The bulk encryption method of the SWF file of AS2.0 script exploitation and device - Google Patents

The bulk encryption method of the SWF file of AS2.0 script exploitation and device Download PDF

Info

Publication number
CN103226672B
CN103226672B CN201310120603.0A CN201310120603A CN103226672B CN 103226672 B CN103226672 B CN 103226672B CN 201310120603 A CN201310120603 A CN 201310120603A CN 103226672 B CN103226672 B CN 103226672B
Authority
CN
China
Prior art keywords
label
file
swf file
doinitaction
doaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310120603.0A
Other languages
Chinese (zh)
Other versions
CN103226672A (en
Inventor
程思敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
4399 NETWORK Co Ltd
Original Assignee
4399 NETWORK Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 4399 NETWORK Co Ltd filed Critical 4399 NETWORK Co Ltd
Priority to CN201310120603.0A priority Critical patent/CN103226672B/en
Publication of CN103226672A publication Critical patent/CN103226672A/en
Application granted granted Critical
Publication of CN103226672B publication Critical patent/CN103226672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides bulk encryption method and the device of the SWF file of a kind of AS2.0 script exploitation, described method comprises the source SWF file obtaining user and upload; According to File header information, parsing source SWF file acquisition File header information, judges whether the release type of source SWF file belongs to AVM1 type; If AVM1 type, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption is obscured to DOACTION label and DOINITACTION label; All labels after restructuring encryption, generate encryption SWF file.User uploads the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to the SWF file of a large amount of AS2.0 script exploitation, thus substantially increase encryption efficiency, and do not take the hard disk resources of client.

Description

The bulk encryption method of the SWF file of AS2.0 script exploitation and device
Technical field
The present invention relates to video display arts, particularly relate to bulk encryption method and the device of the SWF file of a kind of AS2.0 script exploitation.
Background technology
SWF file is the professional format of Flash, is the Animation File Format of a kind of support vector and dot pattern, is widely used in webpage design, the fields such as cartoon making, and SWF file is also referred to as Flash file usually.Usual game developer is not at will usurped amendment to protect the SWF file write of oneself, usually can be encrypted SWF file.
In the conventional technology, the means be encrypted SWF file are download the software that can be encrypted from the Internet, are encrypted single SWF file.But said method can only to single SWF file encryption, inefficiency, and needs user oneself to download application file from the Internet, takies hard drive space.
Summary of the invention
For the above-mentioned defect of conventional art, the bulk encryption method of the SWF file that the embodiment of the present invention provides a kind of AS2.0 script to develop and device, make user can be uploaded the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to a large amount of SWF file, thus substantially increase encryption efficiency, and do not take the hard disk resources of client.
The bulk encryption method of the SWF file that the embodiment of the present invention provides a kind of AS2.0 script to develop, comprising:
Obtain the source SWF file that user uploads;
Read described source SWF file by binary stream, resolve described source SWF file acquisition File header information, judge whether the release type of described source SWF file belongs to AVM1 type according to described File header information;
If the release type of described source SWF file is AVM1 type, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption is obscured to described DOACTION label and described DOINITACTION label;
All labels after restructuring encryption, generate encryption SWF file.
Preferably, before judging according to described File header information whether the release type of described source SWF file belongs to AVM1 type step, also comprise:
Judge whether described source SWF file is compressed file according to described File header information, if then SWF file in source described in decompress(ion).
Preferably, if the release type of described source SWF file is AVM1 type, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encrypting step is obscured to described DOACTION label and described DOINITACTION label, comprising:
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Resolve described DOACTION label and described DOINITACTION label, obtain class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source are carried out obscuring encryption.
The bulk encryption device of the SWF file that the embodiment of the present invention provides a kind of AS2.0 script to develop, comprising:
Receiver module, for obtaining the source SWF file that user uploads;
First judge module, resolves described source SWF file acquisition File header information, judges whether the release type of described source SWF file belongs to AVM1 type according to described File header information;
Encrypting module, if be AVM1 type for the release type of described source SWF file, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption is obscured to described DOACTION label and described DOINITACTION label;
Recombination module, for all labels after encryption of recombinating, generates encryption SWF file.
Preferably, this device also comprises:
Second judge module, for judging according to described File header information whether described source SWF file is compressed file, if then SWF file in source described in decompress(ion).
Preferably, encrypting module comprises:
First positioning unit, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
Second positioning unit, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Obfuscation unit, for resolving described DOACTION label and described DOINITACTION label, obtaining class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source being carried out obscuring encryption.
In the technical scheme of the present embodiment, user uploads the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to a large amount of SWF file, thus substantially increases encryption efficiency, and do not take the hard disk resources of client.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of bulk encryption method first embodiment of the SWF file of AS2.0 script of the present invention exploitation;
Fig. 2 is the structural representation of bulk encryption device first embodiment of the SWF file of AS2.0 script of the present invention exploitation;
Fig. 3 is the structural representation of bulk encryption device second embodiment of the SWF file of AS2.0 script of the present invention exploitation.
Embodiment
Fig. 1 is the process flow diagram of bulk encryption method first embodiment of the SWF file of AS2.0 script of the present invention exploitation, as shown in Figure 1, the bulk encryption device of the SWF file that the bulk encryption method of the SWF file of AS2.0 script that the present embodiment provides exploitation is developed by AS2.0 script performs, this device is located on the server of network side, this device obtains user and uploads source SWF file from end side batch, respectively each source SWF file is encrypted, and the source SWF compressing file of encryption is sent to the local directory of terminal.This device can adopt the form of software and/or hardware to realize, and the method comprises:
Step S100, obtains the source SWF file that user uploads;
Step S102, resolve described source SWF file acquisition File header information, judge whether the release type of described source SWF file belongs to AVM1 type according to described File header information, if the release type of described source SWF file is AVM1 type, then enter step S104, then flow process terminates if not;
Step S104, according to described File header information, navigates to DOACTION label and DOINITACTION label, obscures encryption to described DOACTION label and described DOINITACTION label;
Step S106, all labels after restructuring encryption, generate encryption SWF file.
Particularly, SWF file is made up of file header and data volume; Wherein, data volume is defined by multiple different types of label and obtains.Such as: shape definition tag, sound definition label and end-tag etc.When SWF file is generated by AS2.0 scripting language, the label storing AS2.0 script is DOACTION label and DOINITACTION label.
When after the batch source SWF file that the bulk encryption device reception user of the SWF file of AS2.0 script exploitation uploads, first need to resolve each source SWF file, concrete analytic method can for read each source SWF file by binary stream, File header information in the SWF file of parsing source, comprising the version information of this source SWF file, such as 0x06 represents version 6.
Judge according to version information whether the release type of source SWF file belongs to AVM1 type, and whether AVM1 type is generated by AS2.0 scripting language, dissimilar SWF file, the version information in its file header is different.
Further, user is when uploading source SWF file, and source SWF file may be compressed file, therefore needs to judge whether this file is compressed before being encrypted this file, if then need first to decompress.The file header of source SWF file starts with three identifiers, and three described identifiers are 0x46,0x57 and 0x53 or 0x46,0x57 and 0x43, if three identifiers of the file header of source SWF file are 0x46,0x57 and 0x53, is then uncompressed file; If three identifiers of the file header of source SWF file are 0x46,0x57 and 0x43, be then compressed file.
Further, the concrete methods of realizing of step S104 is:
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Resolve described DOACTION label and described DOINITACTION label, obtain class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source are carried out obscuring encryption.
Particularly; because DOACTION label and DOINITACTION label are abstract factory; for storing concrete code information; therefore the character informations such as bag name important in a large number, class name, method name, attribute-name and parameter name are wherein comprised; by the mode that these important character informations are replaced with mess code, it is encrypted, thus reaches the effect of protection source SWF file.
In the technical scheme of the present embodiment, user uploads the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to a large amount of SWF file, thus substantially increases encryption efficiency, and do not take the hard disk resources of client.
Fig. 2 is the structural representation of bulk encryption device first embodiment of the SWF file of AS2.0 script of the present invention exploitation, as shown in Figure 2, this device is located on the server of network side, after acquisition user uploads source SWF file from end side batch, respectively each source SWF file is encrypted, and the source SWF compressing file of encryption is sent to the local directory of terminal.This device can adopt the form of software and/or hardware to realize, and the method comprises:
Receiver module 10, for obtaining the source SWF file that user uploads;
First judge module 11, resolves described source SWF file acquisition File header information, judges whether the release type of described source SWF file belongs to AVM1 type according to described File header information;
Encrypting module 12, if be AVM1 type for the release type of described source SWF file, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption is obscured to described DOACTION label and described DOINITACTION label;
Recombination module 13, for all labels after encryption of recombinating, generates encryption SWF file.
The bulk encryption device of the SWF file of AS2.0 script that the embodiment of the present invention provides exploitation, for the bulk encryption method of the SWF file of AS2.0 script exploitation performing the embodiment of the present invention and provide, possesses corresponding functional module, does not repeat them here.
In the technical scheme of the present embodiment, user uploads the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to a large amount of SWF file, thus substantially increases encryption efficiency, and do not take the hard disk resources of client.
Fig. 3 is the structural representation of bulk encryption device second embodiment of the SWF file of AS2.0 script of the present invention exploitation, and the present embodiment is based on further refinement embodiment illustrated in fig. 2, and as shown in Figure 3, this device also comprises:
Second judge module 14, for judging according to described File header information whether described source SWF file is compressed file, if then SWF file in source described in decompress(ion).
Wherein encrypting module 12 comprises:
First positioning unit 121, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
Second positioning unit 122, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Obfuscation unit 123, for resolving described DOACTION label and described DOINITACTION label, obtaining class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source being carried out obscuring encryption.
The bulk encryption device of the SWF file of AS2.0 script that the embodiment of the present invention provides exploitation, for the bulk encryption method of the SWF file of AS2.0 script exploitation performing the embodiment of the present invention and provide, possesses corresponding functional module, does not repeat them here.
In the technical scheme of the present embodiment, user uploads the bulk encryption device of the SWF file that SWF file is developed to AS2.0 script by batch, bulk encryption is carried out to a large amount of SWF file, thus substantially increases encryption efficiency, and do not take the hard disk resources of client.
It is noted that above embodiment is only in order to illustrate the present invention and unrestricted, the present invention is also not limited in above-mentioned citing, and all do not depart from technical scheme and the improvement thereof of the spirit and scope of the present invention, and it all should be encompassed in right of the present invention.

Claims (4)

1. a bulk encryption method for the SWF file of AS2.0 script exploitation, is characterized in that, comprising:
Obtain the source SWF file that user uploads;
Resolve described source SWF file acquisition File header information, judge whether the release type of described source SWF file belongs to AVM1 type according to described File header information;
If the release type of described source SWF file is AVM1 type, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption obscured to described DOACTION label and described DOINITACTION label: comprising:
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
According to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Resolve described DOACTION label and described DOINITACTION label, obtain class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source are carried out obscuring encryption;
All labels after restructuring encryption, generate encryption SWF file.
2. the bulk encryption method of the SWF file of AS2.0 script according to claim 1 exploitation, is characterized in that, described judge whether the release type of described source SWF file belongs to AVM1 type according to described File header information before, also comprise:
Judge whether described source SWF file is compressed file according to described File header information, if then SWF file in source described in decompress(ion).
3. a bulk encryption device for the SWF file of AS2.0 script exploitation, is characterized in that, comprising:
Receiver module, for obtaining the source SWF file that user uploads;
First judge module, resolves described source SWF file acquisition File header information, judges whether the release type of described source SWF file belongs to AVM1 type according to described File header information;
Encrypting module, if be AVM1 type for the release type of described source SWF file, then according to described File header information, navigate to DOACTION label and DOINITACTION label, encryption is obscured to described DOACTION label and described DOINITACTION label;
Described encrypting module comprises:
First positioning unit, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOACTION label, and carry out read group total, obtain the positional value of described DOACTION label, be directly targeted to described DOACTION label according to the positional value of described DOACTION label;
Second positioning unit, for according to described File header information, obtain the length value of described source SWF file file head and be positioned at the length value of each label before described DOINITACTION label, and carry out read group total, obtain the positional value of described DOINITACTION label, be directly targeted to described DOINITACTION label according to the positional value of described DOINITACTION label;
Obfuscation unit, for resolving described DOACTION label and described DOINITACTION label, obtaining class name, variable name and function name in the SWF file of described source, class name, variable name and function name in the SWF file of described source being carried out obscuring encryption;
Recombination module, for all labels after encryption of recombinating, generates encryption SWF file.
4. the bulk encryption device of the SWF file of AS2.0 script exploitation according to claim 3, it is characterized in that, described device also comprises:
Second judge module, for judging according to described File header information whether described source SWF file is compressed file, if then SWF file in source described in decompress(ion).
CN201310120603.0A 2013-04-09 2013-04-09 The bulk encryption method of the SWF file of AS2.0 script exploitation and device Active CN103226672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310120603.0A CN103226672B (en) 2013-04-09 2013-04-09 The bulk encryption method of the SWF file of AS2.0 script exploitation and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310120603.0A CN103226672B (en) 2013-04-09 2013-04-09 The bulk encryption method of the SWF file of AS2.0 script exploitation and device

Publications (2)

Publication Number Publication Date
CN103226672A CN103226672A (en) 2013-07-31
CN103226672B true CN103226672B (en) 2015-09-16

Family

ID=48837116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310120603.0A Active CN103226672B (en) 2013-04-09 2013-04-09 The bulk encryption method of the SWF file of AS2.0 script exploitation and device

Country Status (1)

Country Link
CN (1) CN103226672B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169319A (en) * 2017-03-31 2017-09-15 武汉斗鱼网络科技有限公司 A kind of method and device protected to Flash codes

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222624A (en) * 2007-12-07 2008-07-16 四川长虹电器股份有限公司 Multimedia data encryption method based on AVI format
CN101626293B (en) * 2008-07-09 2011-10-26 上海格尔软件股份有限公司 Method for encryption protection and decryption of data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009027126A1 (en) * 2007-08-24 2009-03-05 International Business Machines Corporation System and method for protection of content stored in a storage device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222624A (en) * 2007-12-07 2008-07-16 四川长虹电器股份有限公司 Multimedia data encryption method based on AVI format
CN101626293B (en) * 2008-07-09 2011-10-26 上海格尔软件股份有限公司 Method for encryption protection and decryption of data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SWF矢量动画解析框架设计;倪应华等;《计算机系统应用》;20100315;第19卷(第3期);第165、202-205页 *
对SWF文件实现加密保护;王明瑞;《福建电脑》;20120325(第3期);第140、158页 *

Also Published As

Publication number Publication date
CN103226672A (en) 2013-07-31

Similar Documents

Publication Publication Date Title
CN103531218B (en) A kind of online multimedia file editing method and system
CN104602238A (en) Wireless network connecting method, device and system
CN103347258A (en) Downloading method, system and server of application program and terminal equipment
CN104158908B (en) Method and system based on WiFi equipment transmission file
US20150373150A1 (en) Server, client, system and method for preloading browsed page in browser
CN103944944A (en) Webpage link sharing method and system, and electronic device
CN105141567A (en) Interactive data processing method and system of terminal application and service end and interaction method
US10419798B2 (en) Method and apparatus for just-in-time transcoding
CN104516693A (en) Wireless printing method and system
WO2015081856A1 (en) Method, apparatus and system for file encryption and decryption
CN103634391A (en) Method and system for realizing conversation sharing
JP2018519596A5 (en)
US9432489B2 (en) Systems and methods for processing encoded data streams
CN110225510A (en) Method and apparatus for burning embedded SIM card
CN105530590A (en) Method and electronic equipment for realizing resource sharing between equipment
CN103401931B (en) A kind of method and system for downloading file
CN103138871B (en) The server data processing system of application program and method in mobile communcations system
CN103347215B (en) A kind of multi-screen interaction method and Set Top Box
CN107463536A (en) A kind of method and system for realizing document in online preview server in Android device
CN103226672B (en) The bulk encryption method of the SWF file of AS2.0 script exploitation and device
CN103207958B (en) The SWF files in batch encryption method of AS3.0 script exploitation and device
CN103856475A (en) Method and device for providing verification
CN103218547B (en) SWF files in batch encryption method and device
JP2009252153A (en) Information processing device and information processing method, and computer program
CN102984676B (en) Method and terminal for processing message session

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant