Supercharge Your Innovation With Domain-Expert AI Agents!

Python byte code reverse prevention method

A technology of bytecode files and bytes, which is applied in the direction of program/content distribution protection, etc., and can solve problems such as developer losses

Inactive Publication Date: 2019-10-25
SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to provide a Python bytecode anti-reverse method, which is used to solve the problem in the prior art that the Python bytecode is easily decompiled by an attacker to generate the source code, which brings losses 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
  • Python byte code reverse prevention method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] combined with figure 1 As shown, a Python bytecode anti-reverse method, including:

[0031] Step S100: the Python interpreter compiles the source code file written in the Python language into bytecode by using the compiling module;

[0032] Step S200: the virtual machine replaces the non-critical opcodes in the opcode sequence contained in the bytecode file with new values, so that the new opcodes are included.

[0033] The essence of opcode replacement is to replace the non-key opcode in the opcode sequence (co_code) contained in the bytecode file with a new value, so that it contains a new opcode, thereby changing the content and structure of the opcode sequence, To achieve the purpose of anti-reversal.

[0034] Further, step S200 specifically includes:

[0035] Step S210: Parameter definition

[0036] The set of n operations defined in the virtual machine is:

[0037] OP={op 1 ,op 2 ,op i ,...,op n}

[0038] Among them, op i Indicates the i-th operation su...

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 discloses a Python byte code reverse prevention method. The method comprises the following steps of S100: a Python interpreter compiles a source code file compiled by adopting a Python language into a byte code by utilizing a compiling module; S200, the virtual machine replaces the non-key operation code in the operation code sequence contained in the byte code file with a new valueto enable the non-key operation code to contain the new operation code. Substantially, the operation codes are replaced by replacing the non-key operation codes in the operation code sequence contained in the byte code file with new values to enable the non-key operation codes to contain the new operation codes. Therefore, the content and the structure of the operation code sequence are changed, and the anti-reversion purpose is achieved. On the premise of ensuring correct Python byte code operation result and logic, the non-key operation code in the byte code is replaced. The content and thestructure of the operation code sequence in the byte code file are changed, so that the byte code cannot be reversely decompiled to obtain the source code.

Description

technical field [0001] The invention relates to the technical field of software reverse engineering, in particular to a method for preventing reverse reverse engineering of Python bytecodes. Background technique [0002] At present, Python is the most used programming language in the world, and the way Python programs run is quite unique. Python first compiles the source code file with the suffix .py into a bytecode file, stores it in the project directory __pycache__, and then converts it into binary code by the virtual machine for execution by the CPU. In order to achieve cross-platform, Python bytecode files retain all the information in the source code. It is precisely because of this characteristic of Python bytecode that attackers can easily decompile the bytecode file into the source code, which brings losses to developers. Contents of the invention [0003] The purpose of the present invention is to provide a Python bytecode anti-reversal method, which is used to...

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
IPC IPC(8): G06F21/14
CPCG06F21/14
Inventor 严松罗阿文常清雪江佳峻
Owner SICHUAN CHANGHONG ELECTRIC CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More