CN105701410A - Information, device and system for obtaining information in source codes - Google Patents

Information, device and system for obtaining information in source codes Download PDF

Info

Publication number
CN105701410A
CN105701410A CN201511032142.7A CN201511032142A CN105701410A CN 105701410 A CN105701410 A CN 105701410A CN 201511032142 A CN201511032142 A CN 201511032142A CN 105701410 A CN105701410 A CN 105701410A
Authority
CN
China
Prior art keywords
algorithms
character string
target
obfuscating algorithms
mark
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.)
Granted
Application number
CN201511032142.7A
Other languages
Chinese (zh)
Other versions
CN105701410B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201511032142.7A priority Critical patent/CN105701410B/en
Publication of CN105701410A publication Critical patent/CN105701410A/en
Application granted granted Critical
Publication of CN105701410B publication Critical patent/CN105701410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)

Abstract

Embodiments of the invention provide a method, device and system for obtaining information in source codes, relates to the technical field of communication, and aims at directly positioning the character strings with flaws in the source codes before the obfuscation by debugging devices so as to improve the code debugging efficiency. The method comprises the following steps: obtaining a first character string in an obfuscated code by a debugging device; extracting an identifier of a target obfuscation algorithm by the debugging device from the obfuscated code, wherein the target obfuscation algorithm is used for obfuscating a second character string in the source code into the first character string; determining a decryption algorithm corresponding to the identifier of the target obfuscation algorithm in an algorithm library by the debugging device according to the identifier of the target obfuscation algorithm, wherein the algorithm library is used for indicating the corresponding relationship between the identifier of the obfuscation algorithm and the decryption algorithm; and decrypting the first character string by the debugging device by adopting the decryption algorithm corresponding to the identifier of the target obfuscation algorithm, so as to obtain the second character string in the source code.

Description

A kind of obtain the method for information, Apparatus and system in source code
Technical field
The present invention relates to communication technical field, particularly relate to and a kind of obtain the method for information, Apparatus and system in source code。
Background technology
Code obfuscation (Obfuscatedcode), also known as flower instruction, is by the code of computer program, converts one to functionally of equal value, but is difficult to the behavior of the form read and understand。Such as, code before compiling exists the function that name is called get_password, the function of this function is to obtain the password of certain application, so, security consideration based on user profile, can pass through obfuscator before program is issued uses Obfuscating Algorithms that it is carried out Code obfuscation, such as, after obscuring, the name of this function is called gvmde, and then the code after obscuring is compiled, the program that most rear line obtains after issuing compiling, the program obtained after this compiling is the binary program corresponding to the code after obscuring。
And announced program can be debugged by user according to debugging apparatus, for instance announced program is modified according to the demand of user, or determine the leak existed in announced program。But, in debugging process, the program after compiling only carries the information of the code after obscuring, and the readability of the code after obscuring is very poor, for instance, commissioning staff can not directly from the implication determining gvmde on literal, existing adjustment method inefficient。
Summary of the invention
Embodiments of the invention provide a kind of and obtain the method for information, Apparatus and system in source code, improve code debugging efficiency so that the leak repairing of code is convenient。
For reaching above-mentioned purpose, embodiments of the invention adopt the following technical scheme that
First aspect, embodiments of the invention provide a kind of and obtain the method for information in source code, including: debugging apparatus obtains the first character string in obfuscated codes;This debugging apparatus extracts the mark of target Obfuscating Algorithms from this obfuscated codes, and this target Obfuscating Algorithms is for obscuring the second character string in source code for this first character string;This debugging apparatus mark according to this target Obfuscating Algorithms, determines this decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms in algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm;This debugging apparatus adopts the decipherment algorithm corresponding with the mark of target Obfuscating Algorithms, this first character string is decrypted, to obtain the second character string in this source code。
Can be seen that, the algorithm for inversion of the Obfuscating Algorithms used during by obtaining from algorithms library and obscuring the first character string, i.e. decipherment algorithm, the source code corresponding to character string that debugging apparatus is capable of determining that in obfuscated codes in debugging process can be made, thus the art-recognized meanings of character string in obfuscated codes can be specified, and, the second character string corresponding with the first character string in the source code before obscuring can be directly obtained, so, when the first character string in obfuscated codes starts a leak, this the second character string is the position started a leak in source code, therefore, debugging apparatus just can orient the position started a leak in source code quickly and accurately, thus improve code debugging efficiency。
In a kind of possible design, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, decipherment algorithm in this algorithms library, this algorithm path is for indicating the storage position identifying corresponding decipherment algorithm of this Obfuscating Algorithms。
So, the above-mentioned debugging apparatus mark according to this target Obfuscating Algorithms, algorithms library is determined the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, specifically include: the debugging apparatus mark according to this target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of this target Obfuscating Algorithms;Debugging apparatus, by the title in this algorithm path and the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, obtains the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms。
That is, algorithms library there is the decipherment algorithm corresponding with the mark of Obfuscating Algorithms without directly storage, but indicated this decipherment algorithm by the algorithm path that the mark of this Obfuscating Algorithms is corresponding, thus complexity when reducing maintenance algorithm storehouse, the confidentiality of decipherment algorithm in algorithms library can be increased simultaneously。
In a kind of possible design, the mark of this Obfuscating Algorithms includes the mark of user-defined Obfuscating Algorithms, this decipherment algorithm includes the algorithm for inversion of this user-defined Obfuscating Algorithms, wherein, this algorithms library includes the corresponding relation between mark and the algorithm for inversion of this user-defined Obfuscating Algorithms of this user-defined Obfuscating Algorithms。
So, owing to user can register self-defining self-defined decipherment algorithm in algorithms library, and in algorithms library, only need to preserve the user-defined identification of self-defined decipherment algorithm, so that when obfuscator calls this self-defined decipherment algorithm, the algorithm path of the user-defined identification inquiry correspondence according to this self-defined decipherment algorithm, and determine the self-defined decipherment algorithm corresponding with the title of this self-defined decipherment algorithm in the storage position indicated by this algorithm path, and algorithms library is not required to preserve this self-defined decipherment algorithm, thus adding the safety of Obfuscating Algorithms, make the Obfuscating Algorithms variation in algorithms library simultaneously。
In a kind of possible design, this debugging apparatus extracts the mark of this target Obfuscating Algorithms from this obfuscated codes, including: this debugging apparatus extracts the mark of this target Obfuscating Algorithms from the appointment global variable of this obfuscated codes。
In a kind of possible design, this debugging apparatus adopts the decipherment algorithm corresponding with the mark of target Obfuscating Algorithms, this first character string is decrypted, obtains the second character string, including: this debugging apparatus obtains this decipherment algorithm by the hook in preset Hook Function;This debugging apparatus calls this decipherment algorithm by this Hook Function, and this first character string is decrypted, and obtains this second character string。
Second aspect, the embodiment of the present invention provides a kind of method of obfuscated codes, including: obfuscator determines the second character string needing to carry out obscuring in source code;This obfuscator selects the target Obfuscating Algorithms being used for obscuring this second character string from algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;This obfuscator uses this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string;This obfuscator is by the identification record of this target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains this second character string according to the decipherment algorithm that the mark of this target Obfuscating Algorithms is corresponding by described first character string, wherein, this obfuscated codes is the code obtained after this source code being obscured according to the Obfuscating Algorithms in this algorithms library, this obfuscated codes includes this first character string, and the decipherment algorithm that the mark of this target Obfuscating Algorithms is corresponding is used for deciphering this first character string。
Can be seen that, this programme is in Code obfuscation process, by using the target Obfuscating Algorithms of algorithms library that the second character string is obscured, to obtain the first character string, and by the identification record of target Obfuscating Algorithms in obfuscated codes, so that follow-up debugging apparatus is capable of determining that the source code corresponding to character string in obfuscated codes in debugging process, such as, the decipherment algorithm of deciphering the first character string can be determined from this algorithms library according to the mark of target Obfuscating Algorithms, and then directly determine the second character string corresponding with the first character string in source code, so, and when the first character string in obfuscated codes starts a leak, just the position started a leak in source code can be oriented quickly and accurately, to improve code debugging efficiency。
In a kind of possible design, this algorithms library is set up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm, this algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of this Obfuscating Algorithms, this storage position can be located at local memory device, it is also possible to is positioned at other storage devices outside place's local memory device or on physical node;Wherein, this obfuscator selects the target Obfuscating Algorithms being used for obscuring this second character string from algorithms library, including: this obfuscator determines the mark obscuring the target Obfuscating Algorithms that this second character string need to use from this algorithms library;This obfuscator mark according to this target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from this algorithms library;This obfuscator is by the title in this algorithm path and the target Obfuscating Algorithms corresponding with the mark of this target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of this second character string。
In a kind of possible design, this target Obfuscating Algorithms includes user-defined Obfuscating Algorithms, the mark of this target Obfuscating Algorithms includes the mark with the self-defining Obfuscating Algorithms in this family, this decipherment algorithm includes the algorithm for inversion of this user-defined Obfuscating Algorithms, wherein, this algorithms library includes the corresponding relation between user-defined Obfuscating Algorithms, the mark of this user-defined Obfuscating Algorithms and the algorithm for inversion of this user-defined Obfuscating Algorithms。
So, owing to user can register self-defining self-defined Obfuscating Algorithms in algorithms library, and in algorithms library, only need to preserve the user-defined identification of self-defined Obfuscating Algorithms, so that when obfuscator calls this self-defined Obfuscating Algorithms, the algorithm path of the user-defined identification inquiry correspondence according to this self-defined Obfuscating Algorithms, and determine the self-defined Obfuscating Algorithms corresponding with the title of this self-defined Obfuscating Algorithms in the storage position indicated by this algorithm path, and algorithms library is not required to preserve this self-defined Obfuscating Algorithms, thus adding the safety of Obfuscating Algorithms, make the Obfuscating Algorithms variation in algorithms library simultaneously。
In a kind of possible design, this obfuscator uses this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string, including: this obfuscator obtains this target Obfuscating Algorithms by the hook of preset Hook Function;This obfuscator calls this target Obfuscating Algorithms by this Hook Function, so that this second character string to be obscured, obtains this first character string。
In a kind of possible design, this obfuscator by the identification record of this target Obfuscating Algorithms to obfuscated codes, including: the mark of this target Obfuscating Algorithms is preserved to the appointment global variable of this obfuscated codes by this obfuscator。
The third aspect, the embodiment of the present invention provides a kind of debugging apparatus, including: acquiring unit, for obtaining the first character string in obfuscated codes;Extracting the mark of target Obfuscating Algorithms from this obfuscated codes, this target Obfuscating Algorithms is for obscuring the second character string in source code for this first character string;Determining unit, for the mark according to this target Obfuscating Algorithms, determine this decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms in algorithms library, this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm;Decryption unit, for adopting the decipherment algorithm corresponding with the mark of target Obfuscating Algorithms, is decrypted this first character string, to obtain the second character string in this source code。
In a kind of possible design, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, decipherment algorithm in this algorithms library, this algorithm path is for indicating the storage position identifying corresponding decipherment algorithm of this target Obfuscating Algorithms;Wherein, this determines unit, specifically for the mark according to this target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of this target Obfuscating Algorithms;By the title in this algorithm path and the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, obtain the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms。
In a kind of possible design, this acquiring unit, specifically for extracting the mark of this target Obfuscating Algorithms from the appointment global variable of this obfuscated codes。
In a kind of possible design, described decryption unit, specifically for obtaining described decipherment algorithm by the hook in preset Hook Function;Call described decipherment algorithm by described Hook Function, described first character string is decrypted, obtain described second character string。
Fourth aspect, the embodiment of the present invention provides a kind of obfuscator, comprises determining that unit, for determining the second character string needing to carry out obscuring in source code;Selecting unit, for selecting the target Obfuscating Algorithms for obscuring this second character string from algorithms library, this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;Obfuscation unit, is used for using this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string;Record unit, for by the identification record of this target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains this second character string according to the decipherment algorithm that the mark of this target Obfuscating Algorithms is corresponding by described first character string, wherein, this obfuscated codes is the code obtained after this source code being obscured according to the Obfuscating Algorithms in this algorithms library, this obfuscated codes includes this first character string, and the decipherment algorithm that the mark of this target Obfuscating Algorithms is corresponding is used for deciphering this first character string。
In a kind of possible design, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm in this algorithms library, this algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of this Obfuscating Algorithms;Wherein, this selection unit, specifically for determining the mark obscuring the target Obfuscating Algorithms that this second character string need to use from this algorithms library;Mark according to this target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from this algorithms library;Title by this algorithm path and the target Obfuscating Algorithms corresponding with the mark of this target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of this second character string。
In a kind of possible design, this obfuscation unit, for obtaining this target Obfuscating Algorithms by the hook of preset Hook Function;Call this target Obfuscating Algorithms by this Hook Function, so that this second character string to be obscured, obtain this first character string。
In a kind of possible design, this record unit, for preserving the mark of this target Obfuscating Algorithms to the appointment global variable of this obfuscated codes。
5th aspect, the embodiment of the present invention provides a kind of debugging apparatus, including: processor, memorizer, bus and communication interface;This memorizer is used for storing computer executed instructions, this processor is connected by this bus with this memorizer, when this debugging apparatus runs, this processor performs this computer executed instructions of this memorizer storage, so that this debugging apparatus performs the method for information in the acquisition source code as according to any one of first aspect。
6th aspect, the embodiment of the present invention provides a kind of obfuscator, including: processor, memorizer, bus and communication interface;This memorizer is used for storing computer executed instructions, this processor is connected by this bus with this memorizer, when this obfuscator runs, this processor performs this computer executed instructions of this memorizer storage, so that the method that this obfuscator performs the obfuscated codes in second aspect as described in any one。
7th aspect, the embodiment of the present invention provides a kind of and obtains the system of information in source code, including the debugging apparatus according to any one of the third aspect, with the obfuscator according to any one of fourth aspect, wherein, this debugging apparatus and this obfuscator share algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm。
Eighth aspect, embodiments provides a kind of computer-readable storage medium, and for saving as the computer software instructions used by above-mentioned debugging apparatus, it comprises for performing above-mentioned aspect is the program designed by debugging apparatus。
9th aspect, embodiments provides a kind of computer-readable storage medium, and for saving as the computer software instructions used by above-mentioned obfuscator, it comprises for performing above-mentioned aspect is the program designed by obfuscator。
Tenth aspect, embodiments provide a kind of equipment processing code, including: obfuscation unit, debugging unit and memory element, described memory element is for storing the algorithms library of the corresponding relation included between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm
Wherein, this obfuscation unit, it is used for: determine the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring this second character string is selected from algorithms library;Use this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string;The corresponding relation of the mark of this target Obfuscating Algorithms with described first character string be recorded in obfuscated codes, wherein, this obfuscated codes is the code obtained after this source code is obscured by described obfuscation unit according to the Obfuscating Algorithms in this algorithms library, and this obfuscated codes includes this first character string;This debugging unit, is used for: obtain the first character string in obfuscated codes;The mark of described target Obfuscating Algorithms is extracted from this obfuscated codes;Identify according to this target Obfuscating Algorithms, this algorithms library is determined the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms;This first character string is decrypted by the decipherment algorithm corresponding to mark adopting this target Obfuscating Algorithms, to obtain the second character string in this source code, in order to the usability of program fragments at described second character string place is debugged。
11st aspect, the embodiment of the present invention provides a kind of equipment processing code, including: processor, memorizer, bus and communication interface;This memorizer is used for storing computer executed instructions, this processor is connected by this bus with this memorizer, when the equipment of this process code runs, this processor performs this computer executed instructions of this memorizer storage, so that the equipment of this process code determines the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring this second character string is selected from this algorithms library;Use this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string;By in the identification record of this target Obfuscating Algorithms to obfuscated codes, wherein, this obfuscated codes is the code obtained after this source code is obscured by this obfuscation unit according to the Obfuscating Algorithms in this algorithms library, and this obfuscated codes includes this first character string;Obtain the first character string in obfuscated codes;The mark of this target Obfuscating Algorithms is extracted from this obfuscated codes;Identify according to this target Obfuscating Algorithms, this algorithms library is determined the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms;Adopt the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms that this first character string is decrypted, to obtain the second character string in this source code。
In the present invention, equipment itself is not constituted restriction by the name of debugging apparatus and obfuscator, and in practical implementations, these equipment can occur with other titles。As long as the function of each equipment is similar with the present invention, belong within the scope of the claims in the present invention and equivalent technologies thereof。
It addition, the technique effect that the third aspect can be brought referring to different designs mode in first aspect or second aspect to the technique effect that any one design in the 11st aspect is brought, repeat no more herein。
The aspects of the invention or other aspects be meeting straightforward more in the following description。
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, the accompanying drawing used required in embodiment or description of the prior art will be briefly described below。
Fig. 1 a kind of obtains the Organization Chart of the system of information in source code for what the embodiment of the present invention provided;
The schematic flow sheet of the method for a kind of obfuscated codes that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of the method for a kind of debugging code that Fig. 3 provides for the embodiment of the present invention;
The structural representation of a kind of debugging apparatus that Fig. 4 provides for the embodiment of the present invention;
The hardware architecture diagram of a kind of debugging apparatus that Fig. 5 provides for the embodiment of the present invention;
The structural representation of a kind of obfuscator that Fig. 6 provides for the embodiment of the present invention;
The hardware architecture diagram of a kind of obfuscator that Fig. 7 provides for the embodiment of the present invention;
The structural representation of a kind of equipment processing code that Fig. 8 provides for the embodiment of the present invention;
The hardware architecture diagram of a kind of equipment processing code that Fig. 9 provides for the embodiment of the present invention。
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments。
It addition, term " first ", " second " are only for descriptive purposes, and it is not intended that indicate or imply relative importance or the implicit quantity indicating indicated technical characteristic。Thus, define " first ", the feature of " second " can express or implicitly include one or more these features。In describing the invention, except as otherwise noted, " multiple " are meant that two or more。
Embodiments of the invention provide a kind of and obtain the method for information in source code, can be applicable in acquisition source code as shown in Figure 1 in the system of information, and wherein, this system includes debugging apparatus 01 and obfuscator 02。
Wherein, obfuscator 02 is for, before issuing in program, carrying out Code obfuscation to source code (namely without the code obscured), thus obtaining obfuscated codes, and then, by obtaining the executable program for issuing after compiling this obfuscated codes。When this executable program starts a leak (bug), the executable program that this debugging apparatus 01 can be used for issuing is debugged, and finally finds the position started a leak in source code。
It should be noted that this debugging apparatus 01 or obfuscator 02, it is possible to it is an entity device, for instance, debugging apparatus 01 is a physical host;Or, this debugging apparatus 01 or obfuscator 02, it is possible to be the logic functional block in an entity device or software unit。It is, of course, also possible to debugging apparatus 01 and obfuscator 02 are integrated in same entity device, this is not limited by the embodiment of the present invention。
Concrete, what the embodiment of the present invention provided obtains the principle of information in source code is: by the mark of the Obfuscating Algorithms of instruction in algorithms library, corresponding relation between Obfuscating Algorithms and decipherment algorithm, set up the incidence relation of debugging apparatus 01 and obfuscator 02, make debugging apparatus 01 in the process of code debugging and obfuscator 02 can share this algorithms library in the process of Code obfuscation, so, the algorithm for inversion of the Obfuscating Algorithms used during by obtaining from algorithms library and obscuring the first character string, i.e. decipherment algorithm, the source code corresponding to character string that debugging apparatus 01 is capable of determining that in obfuscated codes in debugging process can be made, thus the art-recognized meanings of character string in obfuscated codes can be specified, and, the second character string corresponding with the first character string in the source code before obscuring can be directly obtained, and when the first character string in obfuscated codes starts a leak, this the second character string is the position started a leak in source code, therefore, debugging apparatus 01 just can orient the position started a leak in source code quickly and accurately, so that developer carries out leak reparation (i.e. dbug)。
Below, for the ease of setting forth the method for information in the acquisition source code that the embodiment of the present invention provides, first above-mentioned algorithms library is illustrated。
Concrete, algorithms library is the data base for providing Code obfuscation algorithm and decipherment algorithm to obfuscator 02 and debugging apparatus 01, can be confused device 02 with the form of dynamic link library and debugging apparatus 01 calls in the process used。
Wherein, this algorithms library can be used for the corresponding relation indicated between the mark of Obfuscating Algorithms and decipherment algorithm, the mark of this Obfuscating Algorithms can have multiple, this decipherment algorithm can also have multiple, additionally, may be used to indicate that the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm in this algorithms library, certainly, this Obfuscating Algorithms can also have multiple。
Concrete, the form of this algorithms library can be as shown in table 1, and wherein, first is classified as mark, i.e. the mark of Obfuscating Algorithms, and often set Obfuscating Algorithms has a unique mark (such as call number) to distinguish other Obfuscating Algorithms;Second title being classified as Obfuscating Algorithms, such as, the form of the title of any Obfuscating Algorithms is as follows: char*encryption (char*str), namely encryption (encryption) pointer function is defined, its input value is the symbol (i.e. above-mentioned second character string) before obscuring, and its return value is the symbol (i.e. above-mentioned first character string) after obscuring。Additionally, in order to ensure to obscure and the safety of decrypting process, Crypted password can also be defined when using Obfuscating Algorithms, such as, the form of the title of any Obfuscating Algorithms is as follows: char*encryption (char*str, char*pass), namely defines an encryption pointers function, its input value is the second character string before obscuring and Crypted password, and its return value is the first character string after obscuring。
Exemplary, assume that the Obfuscating Algorithms being designated 1 is the assic (AmericanStandardCodeforInformationInterchange to each character, ASCII(American Standard Code for information interchange)) do and add 1 operation, the encryption parameter of definition is 1234, so, when obfuscator 02 call algorithms library is designated the Obfuscating Algorithms of 1 obscure time, input the second character string: abcd, and input Crypted password: 1234, just can return the first character string after obscuring: bcde。
Contrary with above-mentioned Obfuscating Algorithms, in this algorithms library the 3rd is classified as the title of decipherment algorithm, its input value is the first character string after obscuring, its return value is the second character string before obscuring, so, debugging apparatus 01 just can either directly through calling corresponding decipherment algorithm in this algorithms library, it is determined that the second character string corresponding with the first character string before obscuring, thus finding the program paragraph started a leak in the source code before obscuring quickly and accurately。
Additionally, the 4th row in this algorithms library are additionally provided with algorithm path, this algorithm path is for indicating the storage position of the Obfuscating Algorithms that the mark of Obfuscating Algorithms is corresponding and/or decipherment algorithm, so that obfuscator 02 is calling corresponding Obfuscating Algorithms, or debugging apparatus 01 is when calling corresponding decipherment algorithm, corresponding Obfuscating Algorithms or decipherment algorithm are taken out in the storage position indicated by algorithm path。
It should be noted that this storage position can be located at local memory device, it is also possible to be positioned at other storage devices outside place's local memory device or on physical node, the present invention is that this is not intended to be limited in any by embodiment。
Table 1
It should be noted that, user can customize the Obfuscating Algorithms in this algorithms library and decipherment algorithm, and (user-defined Obfuscating Algorithms and decipherment algorithm are called self-defined Obfuscating Algorithms and self-defined decipherment algorithm by the embodiment of the present invention, due to two functions that Obfuscating Algorithms and decipherment algorithm are mutually reverse, namely when Obfuscating Algorithms is determined, the decipherment algorithm of its correspondence also determines that, vice versa, so place only illustrates for self-defining Obfuscating Algorithms)。It is to say, when the second character string in source code is obscured, a certain Obfuscating Algorithms provided in algorithms library can be adopted to obscure, it is possible to use user-defined self-defined Obfuscating Algorithms is obscured。
Such as, the above-mentioned form registering self-defining Obfuscating Algorithms in algorithms library is as follows:
Intregiset_mach (char*path, char*encryption, char*decryption)
Concrete, the self-defined Obfuscating Algorithms write is preserved to certain position by user, obtain the storage position (i.e. path) of this self-defined Obfuscating Algorithms, now, user is by this path, and the registration interface that the function name of this self-defined Obfuscating Algorithms (encryption) input is specified to algorithms library, and then, (this algorithms library can also be managed the obfuscator in management algorithm storehouse by debugging apparatus, or, by independent managing functional module, this is not limited by the embodiment of the present invention) this self-defined Obfuscating Algorithms can be got according to this path, and then search whether this self-defined Obfuscating Algorithms is registered in algorithms library, if this self-defining Obfuscating Algorithms is registered in algorithms library, the mark of the Obfuscating Algorithms identical with this self-defined Obfuscating Algorithms is then directly returned to user;If this self-defined Obfuscating Algorithms is not registration in algorithms library, it can be then the user-defined identification of this self-defined Obfuscating Algorithms one Obfuscating Algorithms of distribution, and in this algorithms library, insert the corresponding relation between title and the corresponding user-defined identification of this path, this self-defined Obfuscating Algorithms, so, follow-up obfuscator just can find the self-defined Obfuscating Algorithms that this user-defined identification is corresponding in algorithms library, and uses this self-defined Obfuscating Algorithms to obscure。
So, owing to user can register self-defining self-defined Obfuscating Algorithms in algorithms library, and in algorithms library, only need to preserve the user-defined identification of self-defined Obfuscating Algorithms, so that when obfuscator 02 calls this self-defined Obfuscating Algorithms, the algorithm path of the user-defined identification inquiry correspondence according to this self-defined Obfuscating Algorithms, and determine the self-defined Obfuscating Algorithms corresponding with the title of this self-defined Obfuscating Algorithms in the storage position indicated by this algorithm path, and algorithms library is not required to preserve this self-defined Obfuscating Algorithms, thus adding the safety of Obfuscating Algorithms, make the Obfuscating Algorithms variation in algorithms library simultaneously。
Certainly, as the design form that another kind is feasible, it is also possible to directly storing the corresponding relation between mark and the Obfuscating Algorithms of Obfuscating Algorithms in algorithms library, this is not limited by the embodiment of the present invention。
Based on the system of information in the acquisition source code shown in Fig. 1, set forth two processes involved in the method for information in the acquisition source code that the embodiment of the present invention provides separately below, namely the process that source code is obscured by obfuscator 02, and the process that obfuscated codes is debugged by debugging apparatus 01。
Embodiments of the invention provide a kind of method of obfuscated codes, as in figure 2 it is shown, include:
101, obfuscator determines the second character string needing to carry out obscuring in source code。
102, obfuscator selects the target Obfuscating Algorithms for obscuring the second character string from algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm。
103, obfuscator uses this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string。
104, this first character string is replaced this second character string in source code by obfuscator, to obtain obfuscated codes。
105, obfuscator is by the identification record of this target Obfuscating Algorithms to this obfuscated codes。
In a step 101, obfuscator is it needs to be determined that in source code before obscuring, need the second character string carrying out obscuring, such as, including the function that symbol is get_password in source code, the function of this function is to obtain the password of certain application, so, security consideration based on user profile, it may be determined that this character string, namely get_password is the second character string needing to carry out obscuring。
In a step 102, obfuscator, from the algorithms library shown in table 1, selects the target Obfuscating Algorithms for obscuring this second character string, it is possible to understand that, this target Obfuscating Algorithms is any Obfuscating Algorithms in the algorithms library shown in table 1。
Concrete, user can by the form of order line, the mark of target Obfuscating Algorithms is inputted to obfuscator, so, obfuscator just can according to the identifier lookup of this target Obfuscating Algorithms algorithm path corresponding with this mark, and then by this algorithm path, it is determined that in the storage position indicated by this algorithm path, the target Obfuscating Algorithms corresponding with the title of the Obfuscating Algorithms of secondary series in table 1。
If it should be noted that user does not specify the mark of target Obfuscating Algorithms, obfuscator can adopt the Obfuscating Algorithms of acquiescence to be target Obfuscating Algorithms, and uses this target Obfuscating Algorithms that the second character string is obscured。
In step 103, obfuscator uses in step 102 this target Obfuscating Algorithms determined, this second character string is obscured, to obtain the first character string, namely this second character string obscure after symbol。
Concrete, obfuscator can obtain above-mentioned target Obfuscating Algorithms by the hook of preset Hook Function;So, obfuscator calls this target Obfuscating Algorithms according in step 101 by this Hook Function, and the second character string is obscured, to obtain the first character string。
Wherein, Hook Function is properly termed as again pointer function, is a part for windows messaging treatment mechanism, and by arranging " hook ", all message, event can be filtered by application program system-level, access the message that cannot access under normal circumstances。Wherein, hook refers to that one section in order to the program processing system message, is called by system, it is linked into system。
Exemplary, assume that the second character string determined in step 101 is: abcd, step 102 have selected the target Obfuscating Algorithms being designated 1, it is the assic to each character to do and add 1 operation, so, in step 103, obfuscator by the hook of Hook Function obtain above-mentioned be designated 1 target Obfuscating Algorithms;And then, obfuscator passes through this Hook Function invocation target Obfuscating Algorithms, this second character string abcd is obscured, the first character string with after being obscured: bcde。
And then, at step 104, the first character string obtained after obscuring is replaced the second character string in above-mentioned source code by obfuscator, to obtain obfuscated codes。
Still illustrating with the example in above-mentioned steps 103, this first character string: bcde now can be replaced the second character string before obscuring in source code by obfuscator: abcd, and the code after replacing is above-mentioned obfuscated codes。
Further, in step 105, obfuscator is by the identification record of target Obfuscating Algorithms to above-mentioned obfuscated codes, so that the decipherment algorithm that debugging apparatus is according to the mark correspondence of this target Obfuscating Algorithms, this the second character string is obtained by this first character string, so that it is determined that the second character string that source code starts a leak。
Concrete, it is possible that multiple needs carry out the second character string obscured in source code, in order to avoid the processes such as code compilation produce too much expense, same target Obfuscating Algorithms can be used to obscure by the method for step 102-103 all of second character string, after generating the first character string of correspondence respectively, with the obfuscated codes after being obscured, now, the mark of the target Obfuscating Algorithms used when obscuring is preserved to the appointment global variable of this obfuscated codes by obfuscator, such as, in intencryption_var, so, when this obfuscated codes is debugged by follow-up debugging apparatus, just can according to the mark of target Obfuscating Algorithms in this appointment global variable, the decipherment algorithm deciphering this first character string is determined from algorithms library。
Certainly, can also to source code needs multiple second character strings of obscuring, different target Obfuscating Algorithms is used to obscure respectively, now, in step 105, also need to the corresponding relation by the mark of different target Obfuscating Algorithms with the second character string and recorded in above-mentioned obfuscated codes, in order to debugging apparatus is according to this corresponding relation, it is determined that obscure the algorithm for inversion of target Obfuscating Algorithms specifically used during each second character string。
Further, after step 101-104, embodiments of the invention provide a kind of method of debugging code, as it is shown on figure 3, include:
201, debugging apparatus obtains the first character string in obfuscated codes。
202, debugging apparatus extracts the mark of target Obfuscating Algorithms from this obfuscated codes。
203, the debugging apparatus mark according to this target Obfuscating Algorithms, determines the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms in algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm。
204, debugging apparatus adopts the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, this first character string is decrypted, to obtain the second character string。
Lookup code vulnerabilities system shown in Figure 1, the obfuscated codes obtained in above-mentioned steps 104 is after compiling, generate executable program (such as binary program file), therefore, in step 201, debugging apparatus can pass through the obfuscated codes after reversely compiling is obscured, now, in the process that obfuscated codes is debugged by debugging apparatus, can detect that the first character string started a leak。
Owing to this first character string is the character string after obscuring, therefore, debugging apparatus is in order to directly determine the second character string corresponding with this first character string in source code, in step 202., debugging apparatus extracts the mark of target Obfuscating Algorithms from obfuscated codes, and this target Obfuscating Algorithms is for obscuring the second character string in source code for this first character string。
Such as, debugging apparatus can first search the appointment global variable encryption in obfuscated codes, and then extracts the mark of Obfuscating Algorithms from this encryption。
Further, in step 201, when bug occurs in this executable program, this debugging apparatus can receive the debug command of outside transmission, for instance, receive the order checking current function call stack information, now, debugging apparatus can be triggered from obfuscated codes, extract the mark of this target Obfuscating Algorithms。
In step 203, the mark of this target Obfuscating Algorithms that debugging apparatus extracts according to step 201, in algorithms library as shown in table 1, it is determined that the decipherment algorithm corresponding with the mark of above-mentioned target Obfuscating Algorithms。
Concrete, debugging apparatus can first mark according to this target Obfuscating Algorithms, algorithms library is determined the algorithm path corresponding with this mark, and then, by this algorithm path, determine the storage position indicated by this algorithm path, the decipherment algorithm corresponding with the title of decipherment algorithm tertial in table 1, the decipherment algorithm that namely this second character string uses。
In step 204, debugging apparatus adopts the decipherment algorithm determined in above-mentioned steps 203, this first character string is decrypted, with the second character string before being obscured, in order to determine the position started a leak in source code。
Concrete, similar with step 103, debugging apparatus can pass through the hook of preset Hook Function and obtain above-mentioned decipherment algorithm;So, debugging apparatus calls this decipherment algorithm by this Hook Function, this first character string is decrypted, to obtain first character string the second character string before obscuring, namely debugging apparatus can directly determine the second character string started a leak in the source code before obscuring, therefore, the function indicated by the second character string in source code directly can be carried out dbug by subsequent development personnel。
So far, embodiments of the invention provide a kind of and obtain the method for information in source code, wherein, debugging apparatus obtains the first character string in obfuscated codes, and from obfuscated codes, extract the mark of target Obfuscating Algorithms, wherein, this target Obfuscating Algorithms is the first character string for the second character string in source code being obscured;And then, owing to algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm, therefore, debugging apparatus according to the mark of this target Obfuscating Algorithms, can determine the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms in algorithms library;And then, debugging apparatus adopts this decipherment algorithm that the first character string is decrypted, to obtain the second character string in source code。Can be seen that, the algorithm for inversion of the Obfuscating Algorithms used during by obtaining from algorithms library and obscuring the first character string, i.e. decipherment algorithm, the source code corresponding to character string that debugging apparatus is capable of determining that in obfuscated codes in debugging process can be made, thus the art-recognized meanings of character string in obfuscated codes can be specified, and, the second character string corresponding with the first character string in the source code before obscuring can be directly obtained, so, when the first character string in obfuscated codes starts a leak, this the second character string is the position started a leak in source code, therefore, debugging apparatus just can orient the position started a leak in source code quickly and accurately, thus improve code debugging efficiency。
The structural representation of a kind of debugging apparatus 01 that Fig. 4 provides for the embodiment of the present invention, the debugging apparatus 01 that the embodiment of the present invention provides may be used for implementing the method that the various embodiments of the present invention shown in above-mentioned Fig. 1-Fig. 3 realize, for the ease of explanation, illustrate only the part relevant to the embodiment of the present invention, concrete ins and outs do not disclose, and refer to the various embodiments of the present invention shown in Fig. 1-Fig. 3。
Concrete, as shown in Figure 4, debugging apparatus 01 includes: acquiring unit 11, determine unit 12 and decryption unit 13。
Acquiring unit 11, for obtaining the first character string in obfuscated codes;Extracting the mark of target Obfuscating Algorithms from described obfuscated codes, described target Obfuscating Algorithms is for obscuring the second character string in source code for described first character string;
Determining unit 12, for the mark according to described target Obfuscating Algorithms, determine the described decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms in algorithms library, described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm;
Decryption unit 13, for adopting the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, is decrypted described first character string, to obtain the second character string in described source code。
Further, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding decipherment algorithm of described target Obfuscating Algorithms;Wherein, described determine unit 12, specifically for the mark according to described target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of described target Obfuscating Algorithms;By the title in described algorithm path and the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, obtain the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms。
Further, described acquiring unit 11, specifically for extracting the mark of described target Obfuscating Algorithms from the appointment global variable of described obfuscated codes。
Further, described decryption unit 13, specifically for obtaining described decipherment algorithm by the hook in preset Hook Function;Call described decipherment algorithm by described Hook Function, described first character string is decrypted, obtain described second character string。
Based on the debugging apparatus 01 shown in Fig. 4, the embodiment of the present invention also provides for the hardware architecture diagram of a kind of debugging apparatus 01 as shown in Figure 5, wherein, this debugging apparatus 01 includes processor 21, communication interface 22 and memorizer 23, further, this processor 21, communication interface 22 and memorizer 23 are communicated by bus 24。
Such as, above-mentioned acquiring unit 11, determine that unit 12 and decryption unit 13 can be passed through the instruction that the processor 21 shown in Fig. 5 call in memorizer 23 and realize。
Concrete, described memorizer 23 is used for storing computer executed instructions, described processor 21 is connected by described bus 24 with described memorizer 23, when this debugging apparatus 01 runs, described processor 21 performs the computer executed instructions of described memorizer 23 storage, so that this debugging apparatus 01 performs the method for information in acquisition source code as described in Figure 2。
Exemplary, processor 21 obtains the first character string in the obfuscated codes that obfuscator generates by communication interface 22, and then, processor 21 extracts the mark of target Obfuscating Algorithms from obfuscated codes, and this target Obfuscating Algorithms is the first character string for the second character string in source code being obscured;Then, the processor 21 mark according to this target Obfuscating Algorithms, algorithms library is determined the decipherment algorithm that the mark of the target Obfuscating Algorithms corresponding with the first character string is corresponding, algorithms library is used for the corresponding relation indicated between mark and the decipherment algorithm of target Obfuscating Algorithms, such as, algorithms library is storable in memorizer 23;Finally, memorizer 23 adopts the decipherment algorithm corresponding with the mark of target Obfuscating Algorithms, the first character string is decrypted, to obtain the second character string in source code。
Wherein, processor 21, it is possible to for central processing unit (English: centralprocessingunit, abbreviation: CPU)。Described processor 21 can also be other general processors, digital signal processor (English: digitalsignalprocessing, be called for short DSP), special IC (English: applicationspecificintegratedcircuit, be called for short ASIC), field programmable gate array (English: field-programmablegatearray, to be called for short FPGA) or other PLDs, discrete gate or transistor logic, discrete hardware components etc.。The processor etc. that general processor can be microprocessor or this processor can also be any routine。
Processor 21 is the control centre of described debugging apparatus 01, and processor 21 is processed by the data that transceiver 22 is received, and calls the software in memorizer 23 or program, performs the various functions of described debugging apparatus 01。
Communication interface 22, can be specially interface circuit, and for receiving and sending messages or in the process asked, the reception of signal and transmission, communication interface 22 processes to processor 21 after receiving the information that terminal sends;Communicate it addition, communication interface 22 can pass through radio communication with network and other equipment。
Memorizer 23, it is possible to include volatile memory (English: volatilememory), for instance random access memory (English: random-accessmemory, abbreviation: RAM);It is (English: non-volatilememory) that described memorizer 31 can also include nonvolatile memory, such as read only memory is (English: read-onlymemory, abbreviation: ROM), flash memory is (English: flashmemory), hard disk is (English: harddiskdrive, abbreviation: HDD) or solid state hard disc (English: solid-statedrive, abbreviation: SSD);Described memorizer 31 can also include the combination of the memorizer of mentioned kind。Processor 21 can pass through to run the software program being stored in memorizer 23, thus performing the application of various functions and the data process of described debugging apparatus 01。
And bus 24 can include data/address bus, power bus, control bus and signal condition bus etc.。In order to know explanation in the present embodiment, in Figure 5 various buses are all illustrated as bus 24。
So far, embodiments of the invention provide a kind of debugging apparatus, wherein, debugging apparatus obtains the first character string in obfuscated codes, and from obfuscated codes, extract the mark of target Obfuscating Algorithms, wherein, this target Obfuscating Algorithms is for the second character string in source code to be obscured be the first character string;And then, owing to algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm, therefore, debugging apparatus according to the mark of this target Obfuscating Algorithms, can determine the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms in algorithms library;And then, debugging apparatus adopts this decipherment algorithm that the first character string is decrypted, to obtain the second character string in source code。Can be seen that, the algorithm for inversion of the Obfuscating Algorithms used during by obtaining from algorithms library and obscuring the first character string, i.e. decipherment algorithm, the source code corresponding to character string that debugging apparatus is capable of determining that in obfuscated codes in debugging process can be made, thus the art-recognized meanings of character string in obfuscated codes can be specified, and, the second character string corresponding with the first character string in the source code before obscuring can be directly obtained, so, when the first character string in obfuscated codes starts a leak, this the second character string is the position started a leak in source code, therefore, debugging apparatus just can orient the position started a leak in source code quickly and accurately, thus improve code debugging efficiency。
Additionally, the structural representation of a kind of obfuscator 02 that Fig. 6 provides for the embodiment of the present invention, the obfuscator 02 that the embodiment of the present invention provides may be used for implementing the method that the various embodiments of the present invention shown in above-mentioned Fig. 1-Fig. 3 realize, for the ease of explanation, illustrate only the part relevant to the embodiment of the present invention, concrete ins and outs do not disclose, and refer to the various embodiments of the present invention shown in Fig. 1-Fig. 3。
Concrete, as shown in Figure 6, obfuscator 02 comprises determining that unit 31, selects unit 32, obfuscation unit 33 and record unit 34。
Determine unit 31, for determining the second character string needing to carry out obscuring in source code;
Selecting unit 32, for selecting the target Obfuscating Algorithms for obscuring described second character string from algorithms library, described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;
Obfuscation unit 33, is used for using described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;
Record unit 34, for by the identification record of described target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains described second character string according to the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding by described first character string, wherein, described obfuscated codes is the code obtained after described source code being obscured according to the Obfuscating Algorithms in described algorithms library, described obfuscated codes includes described first character string, and the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding is used for deciphering described first character string。
Further, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of described Obfuscating Algorithms;Wherein, described selection unit 32, specifically for determining the mark obscuring the target Obfuscating Algorithms that described second character string need to use from described algorithms library;Mark according to described target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from described algorithms library;Title by described algorithm path and the target Obfuscating Algorithms corresponding with the mark of described target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of described second character string。
Further, described obfuscation unit 33, for obtaining described target Obfuscating Algorithms by the hook of preset Hook Function;Call described target Obfuscating Algorithms by described Hook Function, so that described second character string to be obscured, obtain described first character string。
Further, described record unit 34, for preserving the mark of described target Obfuscating Algorithms to the appointment global variable of described obfuscated codes。
Based on the obfuscator 02 shown in Fig. 6, the embodiment of the present invention also provides for the hardware architecture diagram of a kind of obfuscator 02 as shown in Figure 7, wherein, this obfuscator 02 includes processor 41, communication interface 42 and memorizer 43, further, this processor 41, communication interface 42 and memorizer 43 are communicated by bus 44。
Such as, the above-mentioned instruction realization determining that unit 31, selection unit 32, obfuscation unit 33 and record unit 34 can call in memorizer 43 by the processor 41 shown in Fig. 7。
Concrete, described memorizer 43 is used for storing computer executed instructions, described processor 41 is connected by described bus 44 with described memorizer 43, when this obfuscator 02 runs, described processor 41 performs the computer executed instructions of described memorizer 43 storage, so that the method that this obfuscator 02 performs obfuscated codes as described in Figure 3。
Exemplary, the second character string needing to carry out obscuring determined by processor 41 from the source code of memorizer 43;And then, processor 41 selects the target Obfuscating Algorithms being used for obscuring the second character string from algorithms library, and this algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;Processor 41 uses this target Obfuscating Algorithms that the second character string is obscured, to obtain the first character string;And by the identification record of target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains the second character string according to the decipherment algorithm that the mark of target Obfuscating Algorithms is corresponding, wherein, this obfuscated codes is the code obtained after source code being obscured according to the Obfuscating Algorithms in algorithms library, this obfuscated codes includes the first character string, and the decipherment algorithm that the mark of this target Obfuscating Algorithms is corresponding is used for deciphering the first character string。
Wherein, processor 41, it is possible to for central processing unit (English: centralprocessingunit, abbreviation: CPU)。Described processor 41 can also be other general processors, digital signal processor (English: digitalsignalprocessing, be called for short DSP), special IC (English: applicationspecificintegratedcircuit, be called for short ASIC), field programmable gate array (English: field-programmablegatearray, to be called for short FPGA) or other PLDs, discrete gate or transistor logic, discrete hardware components etc.。The processor etc. that general processor can be microprocessor or this processor can also be any routine。
Processor 41 is the control centre of described obfuscator 01, and processor 41 is processed by the data that transceiver 42 is received, and calls the software in memorizer 43 or program, performs the various functions of described obfuscator 01。
Communication interface 42, can be specially interface circuit, and for receiving and sending messages or in the process asked, the reception of signal and transmission, communication interface 42 processes to processor 41 after receiving the information that terminal sends;Communicate it addition, communication interface 42 can pass through radio communication with network and other equipment。
Memorizer 43, it is possible to include volatile memory (English: volatilememory), for instance random access memory (English: random-accessmemory, abbreviation: RAM);It is (English: non-volatilememory) that described memorizer 31 can also include nonvolatile memory, such as read only memory is (English: read-onlymemory, abbreviation: ROM), flash memory is (English: flashmemory), hard disk is (English: harddiskdrive, abbreviation: HDD) or solid state hard disc (English: solid-statedrive, abbreviation: SSD);Described memorizer 31 can also include the combination of the memorizer of mentioned kind。Processor 41 can pass through to run the software program being stored in memorizer 43, thus performing the application of various functions and the data process of described obfuscator 01。
And bus 44 can include data/address bus, power bus, control bus and signal condition bus etc.。In order to know explanation in the present embodiment, in the figure 7 various buses are all illustrated as bus 44。
So far, embodiments of the invention provide a kind of obfuscator, and wherein, first this obfuscator determines in source code the second character string needing to carry out obscuring;And then from algorithms library, select the target Obfuscating Algorithms for obscuring the second character string;Now, obfuscator uses target Obfuscating Algorithms that the second character string is obscured, to obtain the first character string;And, obfuscator is by the identification record of target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains the second character string according to the decipherment algorithm that the mark of target Obfuscating Algorithms is corresponding, can be seen that, second character string is obscured by the target Obfuscating Algorithms of use algorithms library by this programme in process of obfuscation, to obtain the first character string, and by the identification record of target Obfuscating Algorithms in obfuscated codes, so that follow-up debugging apparatus is capable of determining that the source code corresponding to character string in obfuscated codes in debugging process, such as, the decipherment algorithm of deciphering the first character string can be determined from this algorithms library according to the mark of target Obfuscating Algorithms, and then directly determine the second character string corresponding with the first character string in source code, so, and when the first character string in obfuscated codes starts a leak, just the position started a leak in source code can be oriented quickly and accurately, to improve code debugging efficiency。
Further, the structural representation of a kind of equipment 03 processing code that Fig. 8 provides for the embodiment of the present invention, the equipment 03 processing code that the embodiment of the present invention provides may be used for implementing the method that the various embodiments of the present invention shown in above-mentioned Fig. 1-Fig. 3 realize, for the ease of explanation, illustrate only the part relevant to the embodiment of the present invention, concrete ins and outs do not disclose, and refer to the various embodiments of the present invention shown in Fig. 1-Fig. 3。
Wherein, the equipment 03 of this process code specifically includes: debugging unit 51, obfuscation unit 52 and memory element 53, and wherein, memory element 53 is for storing the algorithms library of the corresponding relation included between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm。
Concrete, this obfuscation unit 52, it is used for: determine the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring this second character string is selected from algorithms library;Use this target Obfuscating Algorithms that this second character string is obscured, to obtain the first character string;The corresponding relation of the mark of this target Obfuscating Algorithms with described first character string be recorded in obfuscated codes, wherein, this obfuscated codes is the code obtained after this source code is obscured by described obfuscation unit according to the Obfuscating Algorithms in this algorithms library, and this obfuscated codes includes this first character string。
This debugging unit 51, is used for: obtain the first character string in obfuscated codes;The mark of described target Obfuscating Algorithms is extracted from this obfuscated codes;Identify according to this target Obfuscating Algorithms, this algorithms library is determined the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms;This first character string is decrypted by the decipherment algorithm corresponding to mark adopting this target Obfuscating Algorithms, to obtain the second character string in this source code, in order to the usability of program fragments at described second character string place is debugged。
Exemplary, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm in algorithms library in memory element 53, this algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of Obfuscating Algorithms。
Now, when debugging unit 51 is in the mark according to this target Obfuscating Algorithms, when algorithms library is determined the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, specifically include: the mark according to this target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of this target Obfuscating Algorithms;By the title in this algorithm path and the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms, obtain the decipherment algorithm corresponding with the mark of this target Obfuscating Algorithms。
Accordingly, when obfuscation unit 52 selects the target Obfuscating Algorithms being used for obscuring this second character string from algorithms library, specifically include: from this algorithms library, determine the mark obscuring the target Obfuscating Algorithms that this second character string need to use;Mark according to this target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from this algorithms library;Title by this algorithm path and the target Obfuscating Algorithms corresponding with the mark of this target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of this second character string。
Further, when debugging unit 51 extracts the mark with target Obfuscating Algorithms from obfuscated codes, specifically include: from the appointment global variable of this obfuscated codes, extract the mark of this target Obfuscating Algorithms。
Accordingly, when obfuscation unit 52 time in the identification record of this target Obfuscating Algorithms to obfuscated codes, will specifically include: the mark of this target Obfuscating Algorithms is preserved to the appointment global variable of this obfuscated codes。
Further, when debugging unit 51 adopts the decipherment algorithm corresponding with the mark of target Obfuscating Algorithms that this first character string is decrypted, when obtaining the second character string, specifically include: obtain this decipherment algorithm by the hook in preset Hook Function;Call this decipherment algorithm by this Hook Function, this first character string is decrypted, obtain this second character string。
Accordingly, when obfuscation unit 52 uses this target Obfuscating Algorithms that this second character string is obscured, during to obtain the first character string, specifically include: obtain this target Obfuscating Algorithms by the hook of preset Hook Function;Call this target Obfuscating Algorithms by this Hook Function, so that this second character string to be obscured, obtain this first character string。
Additionally, this target Obfuscating Algorithms includes user-defined Obfuscating Algorithms, the mark of this target Obfuscating Algorithms includes the mark with the self-defining Obfuscating Algorithms in this family, this decipherment algorithm includes the algorithm for inversion of this user-defined Obfuscating Algorithms, wherein, this algorithms library includes the corresponding relation between user-defined Obfuscating Algorithms, the mark of this user-defined Obfuscating Algorithms and the algorithm for inversion of this user-defined Obfuscating Algorithms。
Based on a kind of equipment 03 processing code shown in Fig. 8, the embodiment of the present invention also provides for the hardware architecture diagram of a kind of a kind of equipment 03 processing code as shown in Figure 9, wherein, the equipment 03 of this process code includes processor 61, communication interface 62 and memorizer 63, further, this processor 61, communication interface 62 and memorizer 63 are communicated by bus 64。
Such as, above-mentioned debugging unit 51 and obfuscation unit 52 can pass through the instruction realization that the processor 61 shown in Fig. 9 calls in memorizer 63, and said memory cells can be specially the memorizer 63 shown in Fig. 9。
Concrete, described memorizer 63 is used for storing computer executed instructions, described processor 61 is connected by described bus 64 with described memorizer 63, when the equipment 03 processing code runs, described processor 61 performs the computer executed instructions of described memorizer 63 storage, so that the equipment of described process code determines the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring described second character string is selected from described algorithms library;Use described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;By in the identification record of described target Obfuscating Algorithms to obfuscated codes, wherein, described obfuscated codes is the code obtained after described source code is obscured by described obfuscation unit according to the Obfuscating Algorithms in described algorithms library, and described obfuscated codes includes described first character string;Obtain the first character string in obfuscated codes;The mark of described target Obfuscating Algorithms is extracted from described obfuscated codes;Identify according to described target Obfuscating Algorithms, described algorithms library is determined the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms;Adopt the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms that described first character string is decrypted, to obtain the second character string in described source code。
Wherein, processor 61, it is possible to for central processing unit (English: centralprocessingunit, abbreviation: CPU)。Described processor 61 can also be other general processors, digital signal processor (English: digitalsignalprocessing, be called for short DSP), special IC (English: applicationspecificintegratedcircuit, be called for short ASIC), field programmable gate array (English: field-programmablegatearray, to be called for short FPGA) or other PLDs, discrete gate or transistor logic, discrete hardware components etc.。The processor etc. that general processor can be microprocessor or this processor can also be any routine。
Processor 61 is the control centre of described obfuscator 01, and processor 61 is processed by the data that transceiver 42 is received, and calls the software in memorizer 63 or program, performs the various functions of described obfuscator 01。
Communication interface 62, can be specially interface circuit, and for receiving and sending messages or in the process asked, the reception of signal and transmission, communication interface 62 processes to processor 61 after receiving the information that terminal sends;Communicate it addition, communication interface 62 can pass through radio communication with network and other equipment。
Memorizer 63, it is possible to include volatile memory (English: volatilememory), for instance random access memory (English: random-accessmemory, abbreviation: RAM);It is (English: non-volatilememory) that described memorizer 31 can also include nonvolatile memory, such as read only memory is (English: read-onlymemory, abbreviation: ROM), flash memory is (English: flashmemory), hard disk is (English: harddiskdrive, abbreviation: HDD) or solid state hard disc (English: solid-statedrive, abbreviation: SSD);Described memorizer 31 can also include the combination of the memorizer of mentioned kind。Processor 61 can pass through to run the software program being stored in memorizer 63, thus performing the application of various functions and the data process of described obfuscator 01。
And bus 64 can include data/address bus, power bus, control bus and signal condition bus etc.。In order to know explanation in the present embodiment, in fig .9 various buses are all illustrated as bus 64。
Can be seen that, the algorithm for inversion of the Obfuscating Algorithms used when the equipment 03 of this process code by obtaining and obscuring the first character string from algorithms library, i.e. decipherment algorithm, the source code corresponding to character string that debugging unit is capable of determining that in obfuscated codes in debugging process can be made, thus the art-recognized meanings of character string in obfuscated codes can be specified, and, the second character string corresponding with the first character string in the source code before obscuring can be directly obtained, so, when the first character string in obfuscated codes starts a leak, this the second character string is the position started a leak in source code, therefore, debugging unit just can orient the position started a leak in source code quickly and accurately, thus improve code debugging efficiency。
Those skilled in the art is it can be understood that arrive, for convenience and simplicity of description, only it is illustrated with the division of above-mentioned each functional module, in practical application, as desired above-mentioned functions distribution can be completed by different functional modules, it is divided into different functional modules, to complete all or part of function described above by the internal structure of device。The specific works process of the system of foregoing description, device and unit, it is possible to reference to the corresponding process in preceding method embodiment, do not repeat them here。
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, it is possible to realize by another way。Such as, device embodiment described above is merely schematic, such as, the division of described module or unit, being only a kind of logic function to divide, actual can have other dividing mode when realizing, for instance multiple unit or assembly can in conjunction with or be desirably integrated into another system, or some features can ignore, or do not perform。Another point, shown or discussed coupling each other or direct-coupling or communication connection can be through INDIRECT COUPLING or the communication connection of some interfaces, device or unit, it is possible to be electrical, machinery or other form。
The described unit illustrated as separating component can be or may not be physically separate, and the parts shown as unit can be or may not be physical location, namely may be located at a place, or can also be distributed on multiple NE。Some or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme。
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it is also possible to be that unit is individually physically present, it is also possible to two or more unit are integrated in a unit。Above-mentioned integrated unit both can adopt the form of hardware to realize, it would however also be possible to employ the form of SFU software functional unit realizes。
If described integrated unit is using the form realization of SFU software functional unit and as independent production marketing or use, it is possible to be stored in a computer read/write memory medium。Based on such understanding, part or all or part of of this technical scheme that prior art is contributed by technical scheme substantially in other words can embody with the form of software product, this computer software product is stored in a storage medium, including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) perform all or part of step of method described in each embodiment of the present invention。And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-OnlyMemory), the various media that can store program code such as random access memory (RAM, RandomAccessMemory), magnetic disc or CD。
The above; being only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, any those familiar with the art is in the technical scope that the invention discloses; change can be readily occurred in or replace, all should be encompassed within protection scope of the present invention。Therefore, protection scope of the present invention should be as the criterion with described scope of the claims。

Claims (23)

1. one kind obtains the method for information in source code, it is characterised in that including:
Debugging apparatus obtains the first character string in obfuscated codes;
Described debugging apparatus extracts the mark of target Obfuscating Algorithms from described obfuscated codes, and described target Obfuscating Algorithms is for obscuring the second character string in source code for described first character string;
The described debugging apparatus mark according to described target Obfuscating Algorithms, determines the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms in algorithms library, and described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm;
Described debugging apparatus adopts the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, described first character string is decrypted, to obtain the second character string in described source code。
2. method according to claim 1, it is characterized in that, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding decipherment algorithm of described Obfuscating Algorithms;
Wherein, the described debugging apparatus mark according to described target Obfuscating Algorithms, algorithms library is determined the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, including:
The described debugging apparatus mark according to described target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of described target Obfuscating Algorithms;
Described debugging apparatus, by the title in described algorithm path and the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, obtains the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms。
3. method according to claim 1 and 2, it is characterized in that, the mark of described Obfuscating Algorithms includes the mark of user-defined Obfuscating Algorithms, described decipherment algorithm includes the algorithm for inversion of described user-defined Obfuscating Algorithms, wherein, described algorithms library includes the corresponding relation between mark and the algorithm for inversion of described user-defined Obfuscating Algorithms of described user-defined Obfuscating Algorithms。
4. the method according to any one of claim 1-3, it is characterised in that described debugging apparatus extracts the mark of target Obfuscating Algorithms from described obfuscated codes, including:
Described debugging apparatus extracts the mark of described target Obfuscating Algorithms from the appointment global variable of described obfuscated codes。
5. the method according to any one of claim 1-4, it is characterised in that described debugging apparatus adopts the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, described first character string is decrypted, obtains the second character string, including:
Described debugging apparatus obtains described decipherment algorithm by the hook in preset Hook Function;
Described debugging apparatus calls described decipherment algorithm by described Hook Function, and described first character string is decrypted, and obtains described second character string。
6. the method for an obfuscated codes, it is characterised in that including:
Obfuscator determines the second character string needing to carry out obscuring in source code;
Described obfuscator selects the target Obfuscating Algorithms being used for obscuring described second character string from algorithms library, and described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;
Described obfuscator uses described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;
Described obfuscator is by the identification record of described target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains described second character string according to the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding by described first character string, wherein, described obfuscated codes is the code obtained after described source code being obscured according to the Obfuscating Algorithms in described algorithms library, described obfuscated codes includes described first character string, and the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding is used for deciphering described first character string。
7. method according to claim 6, it is characterized in that, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of described Obfuscating Algorithms;
Wherein, described obfuscator selects the target Obfuscating Algorithms being used for obscuring described second character string from algorithms library, including:
Described obfuscator determines the mark obscuring the target Obfuscating Algorithms that described second character string need to use from described algorithms library;
The described obfuscator mark according to described target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from described algorithms library;
Described obfuscator is by the title in described algorithm path and the target Obfuscating Algorithms corresponding with the mark of described target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of described second character string。
8. the method according to claim 6 or 7, it is characterized in that, described target Obfuscating Algorithms includes user-defined Obfuscating Algorithms, the mark of described target Obfuscating Algorithms includes the mark with the self-defining Obfuscating Algorithms in described family, described decipherment algorithm includes the algorithm for inversion of described user-defined Obfuscating Algorithms, wherein, described algorithms library includes the corresponding relation between user-defined Obfuscating Algorithms, the mark of described user-defined Obfuscating Algorithms and the algorithm for inversion of described user-defined Obfuscating Algorithms。
9. the method according to any one of claim 6-8, it is characterised in that described obfuscator uses described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string, including:
Described obfuscator obtains described target Obfuscating Algorithms by the hook of preset Hook Function;
Described obfuscator calls described target Obfuscating Algorithms by described Hook Function, so that described second character string to be obscured, obtains described first character string。
10. the method according to any one of claim 6-9, it is characterised in that described obfuscator by the identification record of described target Obfuscating Algorithms to obfuscated codes, including:
The mark of described target Obfuscating Algorithms is preserved to the appointment global variable of described obfuscated codes by described obfuscator。
11. a debugging apparatus, it is characterised in that including:
Acquiring unit, for obtaining the first character string in obfuscated codes;Extracting the mark of target Obfuscating Algorithms from described obfuscated codes, described target Obfuscating Algorithms is for obscuring the second character string in source code for described first character string;
Determining unit, for the mark according to described target Obfuscating Algorithms, determine the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding in algorithms library, described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms and decipherment algorithm;
Decryption unit, for adopting the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, is decrypted described first character string, to obtain the second character string in described source code。
12. debugging apparatus according to claim 11, it is characterized in that, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding decipherment algorithm of described Obfuscating Algorithms;Wherein,
Described determine unit, specifically for the mark according to described target Obfuscating Algorithms, it is determined that the algorithm path corresponding with the mark of described target Obfuscating Algorithms;By the title in described algorithm path and the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms, obtain the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms。
13. the debugging apparatus according to claim 11 or 12, it is characterised in that
Described acquiring unit, specifically for extracting the mark of described target Obfuscating Algorithms from the appointment global variable of described obfuscated codes。
14. the debugging apparatus according to any one of claim 11-13, it is characterised in that
Described decryption unit, specifically for obtaining described decipherment algorithm by the hook in preset Hook Function;Call described decipherment algorithm by described Hook Function, described first character string is decrypted, obtain described second character string。
15. an obfuscator, it is characterised in that including:
Determine unit, for determining the second character string needing to carry out obscuring in source code;
Selecting unit, for selecting the target Obfuscating Algorithms for obscuring described second character string from algorithms library, described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm;
Obfuscation unit, is used for using described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;
Record unit, for by the identification record of described target Obfuscating Algorithms to obfuscated codes, so that debugging apparatus obtains described second character string according to the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding by described first character string, wherein, described obfuscated codes is the code obtained after described source code being obscured according to the Obfuscating Algorithms in described algorithms library, described obfuscated codes includes described first character string, and the decipherment algorithm that the mark of described target Obfuscating Algorithms is corresponding is used for deciphering described first character string。
16. obfuscator according to claim 15, it is characterized in that, setting up the corresponding relation between the title and the algorithm path that have the mark of Obfuscating Algorithms, the title of Obfuscating Algorithms, decipherment algorithm in described algorithms library, described algorithm path is for indicating the storage position identifying corresponding Obfuscating Algorithms of described Obfuscating Algorithms;Wherein,
Described selection unit, specifically for determining the mark obscuring the target Obfuscating Algorithms that described second character string need to use from described algorithms library;Mark according to described target Obfuscating Algorithms, determines the algorithm path that the mark of this target Obfuscating Algorithms is corresponding from described algorithms library;Title by described algorithm path and the target Obfuscating Algorithms corresponding with the mark of described target Obfuscating Algorithms, it is determined that the target Obfuscating Algorithms of described second character string。
17. the obfuscator according to claim 15 or 16, it is characterised in that
Described obfuscation unit, for obtaining described target Obfuscating Algorithms by the hook of preset Hook Function;Call described target Obfuscating Algorithms by described Hook Function, so that described second character string to be obscured, obtain described first character string。
18. the obfuscator according to any one of claim 15-17, it is characterised in that
Described record unit, for preserving the mark of described target Obfuscating Algorithms to the appointment global variable of described obfuscated codes。
19. a debugging apparatus, it is characterised in that including: processor, memorizer, bus and communication interface;
Described memorizer is used for storing computer executed instructions, described processor is connected by described bus with described memorizer, when described debugging apparatus runs, described processor performs the described computer executed instructions of described memorizer storage, so that described debugging apparatus performs the method for information in the acquisition source code as described in claim 1-5 any one。
20. an obfuscator, it is characterised in that including: processor, memorizer, bus and communication interface;
Described memorizer is used for storing computer executed instructions, described processor is connected by described bus with described memorizer, when described obfuscator runs, described processor performs the described computer executed instructions of described memorizer storage, so that the method that described obfuscator performs the obfuscated codes as described in claim 6-10 any one。
21. the equipment processing code, it is characterised in that including: obfuscation unit, debugging unit and memory element, described memory element is for storing the algorithms library of the corresponding relation included between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm, wherein,
Described obfuscation unit, for determining the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring described second character string is selected from described algorithms library;Use described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;By in the identification record of described target Obfuscating Algorithms to obfuscated codes, wherein, described obfuscated codes is the code obtained after described source code is obscured by described obfuscation unit according to the Obfuscating Algorithms in described algorithms library, and described obfuscated codes includes described first character string;
Described debugging apparatus, is used for: obtain the first character string in obfuscated codes;The mark of described target Obfuscating Algorithms is extracted from described obfuscated codes;Identify according to described target Obfuscating Algorithms, described algorithms library is determined the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms;Adopt the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms that described first character string is decrypted, to obtain the second character string in described source code。
22. the equipment processing code, it is characterised in that including: processor, memorizer, bus and communication interface;
Described memorizer is used for storing computer executed instructions, described processor is connected by described bus with described memorizer, described processor is by performing the described computer executed instructions of described memorizer storage, so that the equipment of described process code determines the second character string needing to carry out obscuring in source code;The target Obfuscating Algorithms for obscuring described second character string is selected from described algorithms library;Use described target Obfuscating Algorithms that described second character string is obscured, to obtain the first character string;By in the identification record of described target Obfuscating Algorithms to obfuscated codes, wherein, described obfuscated codes is the code obtained after described source code is obscured by described obfuscation unit according to the Obfuscating Algorithms in described algorithms library, and described obfuscated codes includes described first character string;Obtain the first character string in obfuscated codes;The mark of described target Obfuscating Algorithms is extracted from described obfuscated codes;Identify according to described target Obfuscating Algorithms, described algorithms library is determined the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms;Adopt the decipherment algorithm corresponding with the mark of described target Obfuscating Algorithms that described first character string is decrypted, to obtain the second character string in described source code。
23. one kind obtains the system of information in source code, it is characterized in that, including the debugging apparatus according to any one of such as claim 11-14 and the obfuscator as according to any one of claim 15-18, wherein, described debugging apparatus and described obfuscator share algorithms library, and described algorithms library is for indicating the corresponding relation between the mark of Obfuscating Algorithms, Obfuscating Algorithms and decipherment algorithm。
CN201511032142.7A 2015-12-31 2015-12-31 The method, apparatus and system of information in a kind of acquisition source code Active CN105701410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511032142.7A CN105701410B (en) 2015-12-31 2015-12-31 The method, apparatus and system of information in a kind of acquisition source code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511032142.7A CN105701410B (en) 2015-12-31 2015-12-31 The method, apparatus and system of information in a kind of acquisition source code

Publications (2)

Publication Number Publication Date
CN105701410A true CN105701410A (en) 2016-06-22
CN105701410B CN105701410B (en) 2019-03-01

Family

ID=56226749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511032142.7A Active CN105701410B (en) 2015-12-31 2015-12-31 The method, apparatus and system of information in a kind of acquisition source code

Country Status (1)

Country Link
CN (1) CN105701410B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107748838A (en) * 2017-10-13 2018-03-02 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of installation kit generation
CN107992725A (en) * 2017-12-29 2018-05-04 北京星河星云信息技术有限公司 A kind of code encryption, decryption method and device
CN108595921A (en) * 2018-03-22 2018-09-28 北京奇艺世纪科技有限公司 Character string obscures method and apparatus in a kind of source code
CN108664389A (en) * 2017-03-31 2018-10-16 腾讯科技(深圳)有限公司 A kind of test method, device and terminal
CN109409033A (en) * 2018-09-11 2019-03-01 平安科技(深圳)有限公司 Code encryption method, apparatus, computer installation and storage medium
CN110135133A (en) * 2019-04-19 2019-08-16 肖银皓 A kind of integrated source code of compression towards microcontroller obscures method and system
CN110347390A (en) * 2018-04-03 2019-10-18 武汉斗鱼网络科技有限公司 A kind of method quickly generating WEB page, storage medium, equipment and system
CN111049897A (en) * 2019-12-10 2020-04-21 北京百度网讯科技有限公司 Method, device, equipment and medium for encrypted uploading and decrypted deployment of small program package
CN111562916A (en) * 2019-02-13 2020-08-21 百度在线网络技术(北京)有限公司 Method and device for sharing algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986326A (en) * 2010-12-01 2011-03-16 浙江核新同花顺网络信息股份有限公司 Method and device for protecting software security
CN102223309A (en) * 2011-07-07 2011-10-19 谢海春 Safe communication system and implementation method based on message load segmentation, encryption and reorder
CN104331644A (en) * 2014-11-24 2015-02-04 北京邮电大学 Transparent encryption and decryption method for intelligent terminal file
CN104751026A (en) * 2013-12-25 2015-07-01 中国移动通信集团公司 Software protection method and software application method of android system, and related devices
US20150310193A1 (en) * 2014-04-23 2015-10-29 Nxp B.V. Control flow flattening for code obfuscation where the next block calculation needs run-time information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986326A (en) * 2010-12-01 2011-03-16 浙江核新同花顺网络信息股份有限公司 Method and device for protecting software security
CN102223309A (en) * 2011-07-07 2011-10-19 谢海春 Safe communication system and implementation method based on message load segmentation, encryption and reorder
CN104751026A (en) * 2013-12-25 2015-07-01 中国移动通信集团公司 Software protection method and software application method of android system, and related devices
US20150310193A1 (en) * 2014-04-23 2015-10-29 Nxp B.V. Control flow flattening for code obfuscation where the next block calculation needs run-time information
CN104331644A (en) * 2014-11-24 2015-02-04 北京邮电大学 Transparent encryption and decryption method for intelligent terminal file

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664389A (en) * 2017-03-31 2018-10-16 腾讯科技(深圳)有限公司 A kind of test method, device and terminal
CN107748838A (en) * 2017-10-13 2018-03-02 东软集团股份有限公司 The method, apparatus and storage medium and electronic equipment of installation kit generation
CN107992725A (en) * 2017-12-29 2018-05-04 北京星河星云信息技术有限公司 A kind of code encryption, decryption method and device
CN108595921A (en) * 2018-03-22 2018-09-28 北京奇艺世纪科技有限公司 Character string obscures method and apparatus in a kind of source code
CN110347390A (en) * 2018-04-03 2019-10-18 武汉斗鱼网络科技有限公司 A kind of method quickly generating WEB page, storage medium, equipment and system
CN110347390B (en) * 2018-04-03 2023-07-11 广州洋葱时尚集团有限公司 Method, storage medium, equipment and system for rapidly generating WEB page
CN109409033A (en) * 2018-09-11 2019-03-01 平安科技(深圳)有限公司 Code encryption method, apparatus, computer installation and storage medium
CN111562916A (en) * 2019-02-13 2020-08-21 百度在线网络技术(北京)有限公司 Method and device for sharing algorithm
CN110135133A (en) * 2019-04-19 2019-08-16 肖银皓 A kind of integrated source code of compression towards microcontroller obscures method and system
CN110135133B (en) * 2019-04-19 2021-08-17 佛山市微风科技有限公司 Microcontroller-oriented compression integrated source code obfuscation method and system
CN111049897A (en) * 2019-12-10 2020-04-21 北京百度网讯科技有限公司 Method, device, equipment and medium for encrypted uploading and decrypted deployment of small program package
CN111049897B (en) * 2019-12-10 2023-02-17 北京百度网讯科技有限公司 Method, device, equipment and medium for encrypted uploading and decrypted deployment of small program package

Also Published As

Publication number Publication date
CN105701410B (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN105701410A (en) Information, device and system for obtaining information in source codes
CN100578473C (en) Embedded system and method for increasing embedded system security
CN102385671B (en) Software enciphering method and system
US9343162B2 (en) Protection against side-channel attacks on non-volatile memory
US10698840B2 (en) Method and apparatus to generate zero content over garbage data when encryption parameters are changed
CN105637800A (en) Keying infrastructure
CN103177210A (en) Method of implanting dynamic stain analysis module in Android
CN101968834A (en) Encryption method and device for anti-copy plate of electronic product
CN103500586B (en) Detect the method and apparatus of flash memory device capacity
US10884862B2 (en) Method and apparatus for processing failure of cipher change of ciphertext in database
CN105446865A (en) Test method and device under multi-environment
US11620398B2 (en) Techniques to protect fuses against non-destructive attacks
CN103093130A (en) Hardware binding information encryption method and network device
US10013517B1 (en) High level programming language core protection for high level synthesis
CN102971984A (en) Method for authenticating a storage device, machine-readable storage medium, and host device
CN105335679A (en) Serial number writing-in method and device
US10216433B2 (en) Accessing a virtual volume on a storage array
CN104504336A (en) Method and device for preventing embedded system from being maliciously debugged online
CN111782605A (en) Chip card file management method, device, terminal and storage medium
CN104536897A (en) Automatic testing method and system based on keyword
CN111339523B (en) Authorization method and device for embedded equipment
CN104898985A (en) Storage device, controller, and data writing method
CN100464301C (en) Applied program processing method and system
CN105307161A (en) Repair method and apparatus of SIM card encrypted files
CN103645966A (en) WAT test program backup method and backup device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant