Method and device for obfuscating codes by customizing rules

A custom and rule-based technology, applied in the field of code conversion, can solve problems such as code confusion

Pending Publication Date: 2022-05-06
北京小川在线网络技术有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Among them, code obfuscation will be enabled at the O2 level and above, and the converted code will basically become incomprehensible to developers.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for obfuscating codes by customizing rules
  • Method and device for obfuscating codes by customizing rules
  • Method and device for obfuscating codes by customizing rules

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0055] Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with aspects of the invention as recited in the appended claims.

[0056] figure 1 It is a flowchart of a method for obfuscating code with custom rules according to an exemplary embodiment.

[0057] Such as figure 1 As shown, according to the first aspect of the embodiments of the present invention, a method for obfuscating code with custom rules is provided, including:

[0058] Step S101, analyzing the input Dart source code to determine the semantic struct...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a method and device for customizing rule obfuscation codes, and the method comprises the steps: carrying out the analysis of an input Dart source code, so as to determine the semantic structure features of the Dart source code; constructing a Dart abstract syntax tree according to the semantic structure features of the Dart source code; a JavaScript abstract syntax tree is generated through mapping according to the Dart abstract syntax tree; according to the JavaScript abstract syntax tree, generating a JavaScript statement block, according to the JavaScript abstract syntax tree; a user-defined confusion rule is obtained and analyzed, and the user-defined confusion rule supports replacement of a target variable name or a target function name with a specified name or reservation of an original name; and according to the user-defined confusion rule, processing the JavaScript statement block so as to output a JavaScript source code.

Description

technical field [0001] The invention relates to the technical field of code conversion, in particular to a method and a device for obfuscating code with self-defined rules. Background technique [0002] dart2js is a compilation tool open sourced by Google. It is mainly used to convert Dart language code into JavaScript language code. dart2js supports code optimization at a specified level. Level 0 means no optimization, and converts Dart language code into JavaScript equivalently. language code. Level 1 means to do some default optimizations, such as deleting unreferenced codes during the conversion process. Generally, unreferenced codes are invalid codes and will not be executed by the program. Level 2 means adding some other optimizations that follow the language semantics and are safe for all programs on the basis of level 1. For example, the locally defined variable name book may be confused as a during conversion. The advantage of this is that it reduces the size of t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & AuthorityApplications(China)
IPC IPC(8): G06F21/14
CPCG06F21/14
Inventor刘剑杨春柳
Owner北京小川在线网络技术有限公司