CN113360407A - Function positioning method and device, electronic equipment and readable storage medium - Google Patents

Function positioning method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113360407A
CN113360407A CN202110753195.7A CN202110753195A CN113360407A CN 113360407 A CN113360407 A CN 113360407A CN 202110753195 A CN202110753195 A CN 202110753195A CN 113360407 A CN113360407 A CN 113360407A
Authority
CN
China
Prior art keywords
function
stack information
call stack
function call
instantiation
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
CN202110753195.7A
Other languages
Chinese (zh)
Other versions
CN113360407B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110753195.7A priority Critical patent/CN113360407B/en
Publication of CN113360407A publication Critical patent/CN113360407A/en
Application granted granted Critical
Publication of CN113360407B publication Critical patent/CN113360407B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/53Decompilation; Disassembly

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a function positioning method and device, electronic equipment and a readable storage medium, and relates to the technical field of computers, in particular to the technical field of reverse. The specific implementation scheme is as follows: monitoring an instantiation object of a pre-specified target class in a target program when the target program is operated; when the instantiated object calling function is monitored, determining whether the page content corresponding to the instantiated object meets a preset content filtering condition; and if so, acquiring function call stack information of the instantiated object, wherein the function call stack information is used for determining the function called by the instantiated object. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.

Description

Function positioning method and device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for locating a function, an electronic device, and a readable storage medium.
Background
Currently, in the reverse work of an Android Application (APP), after obtaining a decompiled program code in a reverse direction, a key function in the decompiled program code needs to be located.
When the code amount of the target program which is reversed out is huge and confusion exists, difficulty exists in locating the key function.
Disclosure of Invention
In order to solve at least one of the above drawbacks, the present disclosure provides a method and an apparatus for locating a function, an electronic device, and a readable storage medium.
According to a first aspect of the present disclosure, there is provided a method of locating a function, the method comprising:
monitoring an instantiation object of a pre-specified target class in a target program when the target program is operated;
when the instantiated object calling function is monitored, determining whether the page content corresponding to the instantiated object meets a preset content filtering condition;
and if so, acquiring function call stack information of the instantiated object, wherein the function call stack information is used for determining the function called by the instantiated object.
According to a second aspect of the present disclosure, there is provided a method of locating a function, the method comprising:
acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by first equipment, wherein the function call stack information is provided for second equipment when the first equipment monitors the instantiation object call function in the process of running the target program and page content corresponding to the instantiation object meets a preset content filtering condition;
the function called by the instantiated object is determined based on the function call stack information.
According to a third aspect of the present disclosure, there is provided a function locating apparatus, comprising:
the monitoring module is used for monitoring an instantiation object of a pre-specified target class in the target program when the target program is operated;
the filtering module is used for determining whether the page content corresponding to the instantiation object meets the preset content filtering condition or not when the instantiation object calling function is monitored;
and the function call stack information module is used for acquiring the function call stack information of the instantiated object when the page content corresponding to the instantiated object meets the preset content filtering condition, and the function call stack information is used for determining the function called by the instantiated object.
According to a fourth aspect of the present disclosure, there is provided a positioning apparatus of another function, the apparatus comprising:
the function call stack information acquisition module is used for acquiring function call stack information of an instantiation object of a pre-specified target class in a target program provided by first equipment, wherein the function call stack information is provided for second equipment when the first equipment monitors the instantiation object call function in the process of running the target program and page content corresponding to the instantiation object meets a preset content filtering condition;
and the function determining module is used for determining the function called by the instantiation object based on the function call stack information.
According to a fifth aspect of the present disclosure, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for locating functions.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the positioning method of the above function.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the positioning method of the above-described function.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become readily apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart of a function positioning method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another function positioning method provided in the embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a positioning device for a function provided in accordance with the present disclosure;
FIG. 4 is a schematic diagram of a positioning device according to another function provided by the present disclosure;
fig. 5 is a block diagram of an electronic device for implementing a location method of a function of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 shows a schematic flowchart of a method for locating a function according to an embodiment of the present disclosure, and as shown in fig. 1, the method mainly includes:
step S110: monitoring an instantiation object of a pre-specified target class in a target program when the target program is operated;
step S120: when the instantiated object calling function is monitored, determining whether the page content corresponding to the instantiated object meets a preset content filtering condition;
step S130: and if so, acquiring function call stack information of the instantiated object, wherein the function call stack information is used for determining the function called by the instantiated object.
In this embodiment of the present disclosure, the target program may be an APP for which the reverse work is performed, the target class may be a class required when some key contents (such as characters, pictures, videos, and the like) in a page of the target program are implemented, the classes required for implementing the key contents are generally json, array, map, and string, and the json, array, map, and string classes may be used as the target class.
The instantiation object is an object obtained by instantiating the target class. The behavior of the instantiated object call function may be snooped at runtime of the target program. Since the instantiated objects may be numerous and the corresponding page content may not belong to the key content in the page, the instantiated objects may be filtered according to the preset content filtering condition, so that the page content corresponding to the filtered instantiated objects is the key content, and the function called by the filtered instantiated objects, that is, the key function, may be considered.
In the embodiment of the disclosure, the function call stack information includes the relevant information of the function called by the instantiation object, and the function call stack information can be analyzed to determine the key function, so that a basis is provided for positioning the key function in the decompiled program code, and the huge code amount of the target program and the confusion in the code are avoided, which affects the positioning of the target function.
According to the method provided by the embodiment of the disclosure, when the target program is operated, the instantiation object of the target class pre-designated in the target program is monitored, and when the instantiation object calling function is monitored, whether the page content corresponding to the instantiation object meets the preset content filtering condition is determined, and the function calling stack information of the instantiation object meeting the preset content filtering condition is obtained, so that the function called by the instantiation object is determined based on the analysis of the function calling stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
In an alternative embodiment of the disclosure, the content filtering condition includes at least one of:
page content corresponding to the instantiation object belongs to a preset content type;
the data length of the page content corresponding to the instantiation object is not less than the specified value;
the page content corresponding to the instantiation object comprises preset content.
In the implementation of the present disclosure, the preset content types may include texts, pictures, videos, and the like, and these types of contents may be considered as key contents in the page, so that the instantiated objects may be filtered through the preset content types.
In the implementation of the present disclosure, for the page content of the text type, filtering may be performed by setting a specified value of the data length, and specifically, it may be considered that the page content is a key content when the data length of the page content corresponding to the instance object is long. The specified values can be configured according to actual needs.
In the implementation of the present disclosure, the filtering may be performed through preset content, for example, the preset content may be a keyword, and when the page content corresponding to the instance object includes the keyword, the page content is considered as a key content.
In an optional implementation manner of the present disclosure, acquiring function call stack information of an instantiated object includes:
writing the function call stack information of the instantiated object into a system log;
function call stack information is extracted from the system log.
In the embodiment of the present disclosure, the first device may be deployed with a pre-constructed operating system, the operating system is constructed according to requirements in the embodiment of the present disclosure, and compared with a standard Android system, the Android system constructed in the embodiment of the present disclosure modifies a system code, so that when a target object in a target program calls a function, call related information of the function is written into a system log, and then function call stack information may be extracted from the system log.
In the disclosed embodiments, a listener may be registered when an instance is created for a target class. The behavior of the instantiated object calling function is monitored through the monitor. A listener may be registered, and the listener is configured to filter the instantiated object based on the content filtering condition when the instantiated object calls the function.
In an optional implementation manner of the embodiment of the present disclosure, before writing the function call stack information of the instantiated object into the system log, the method further includes:
acquiring a page image of a current display page of a target program;
matching the corresponding page content of the instantiation object with the page image to obtain a matching result;
and adding a criticality identification to the function call stack information of the instantiation object based on the matching result.
Writing function call stack information of the instantiated object into a system log, comprising:
and writing the function call stack information added with the criticality identification into a system log.
In the embodiment of the disclosure, the page image of the currently displayed page of the target program can be acquired, the page content contained in the page image is identified, the identified page content is matched with the page content corresponding to the instantiated object, and the key degree identifier is added to the function call stack information of the instantiated object according to the matching result.
The criticality identification can identify the criticality of the page content corresponding to the instantiation object in the page, and in actual use, the criticality identification can respectively correspond to multiple criticality levels.
Specifically, instantiated objects that can be matched to key content in a page, such as a main title of the page, a main graph of the page, and a large text in the page, may be determined to be higher in level of criticality, and function call stack information of the instantiated objects may be added with a criticality identifier with a higher level of criticality.
And adding a key degree identifier for the function call stack information, and writing the function call stack information added with the key degree identifier into a system log, so that the function call stack information can be conveniently searched in the system log through the key degree identifier.
Specifically, the function call stack information corresponding to the key level identifier with the higher key level may be extracted by preferentially searching the key level identifier with the higher key level from the system log.
In an optional implementation of the embodiments of the present disclosure, the method further comprises any one of:
determining a function called by the instantiation object based on the function call stack information;
the function call stack information is provided to the second device to cause the second device to determine a function called by the instantiated object based on the function call stack information.
In the embodiment of the present disclosure, the first device may obtain function call stack information, and determine a function called by the instantiation object according to the number call stack information. Function call stack information may also be provided to a second device, with the second device determining the function called by the instantiated object based on the function call stack information.
Fig. 2 shows a schematic flow chart of a positioning method of another function provided in the embodiment of the present disclosure, and as shown in fig. 2, the method mainly includes:
step S210: acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by first equipment, wherein the function call stack information is provided for second equipment when the first equipment monitors the instantiation object call function in the process of running the target program and page content corresponding to the instantiation object meets a preset content filtering condition;
step S220: the function called by the instantiated object is determined based on the function call stack information.
Wherein the object program is executable in the first device. The target program may be an APP for which reverse work is performed, the target class may be a class required for implementing some key contents (such as text, picture, video, and the like) in a page of the target program, the classes required for implementing the key contents are generally json, array, map, and string, and the json, array, map, and string classes may be used as the target classes.
The instantiation object is an object obtained by instantiating the target class. The behavior of the instantiated object call function may be snooped at runtime of the target program. Since the instantiated objects may be numerous and the corresponding page content may not belong to the key content in the page, the instantiated objects may be filtered according to the preset content filtering condition, so that the page content corresponding to the filtered instantiated objects is the key content, and the function called by the filtered instantiated objects, that is, the key function, may be considered.
In the embodiment of the disclosure, the function call stack information includes the relevant information of the function called by the instantiation object, and the function call stack information can be analyzed to determine the key function, so that a basis is provided for positioning the key function in the decompiled program code, and the huge code amount of the target program and the confusion in the code are avoided, which affects the positioning of the target function.
According to the method provided by the embodiment of the disclosure, the instantiated object call function is monitored by the first device in the process of running the target program, and when the page content corresponding to the instantiated object meets the preset content filtering condition, the function call stack information is provided for the second device, and the second device determines the function called by the instantiated object based on the function call stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
In an optional implementation manner of the present disclosure, obtaining function call stack information of an instantiation object of a pre-specified target class in a target program provided by a first device includes:
acquiring a system log provided by first equipment;
and extracting function call stack information of an instantiation object of a target class pre-specified in the target program from the system log.
In the embodiment of the present disclosure, the function call stack information may be extracted from the system log by obtaining the system log from the first device.
The first device may be deployed with a pre-constructed operating system, the operating system is constructed according to requirements in the embodiment of the present disclosure, and compared with a standard Android system, the Android system constructed in the embodiment of the present disclosure modifies system codes, so that when a target object in a target program calls a function, call related information of the function is written into a system log, and then function call stack information may be extracted from the system log.
In the disclosed embodiments, a listener may be registered when an instance is created for a target class. The behavior of the instantiated object calling function is monitored through the monitor. A listener may be registered, and the listener is configured to filter the instantiated object based on the content filtering condition when the instantiated object calls the function.
In an optional implementation manner of the present disclosure, function call stack information in a system log is added with a key level identifier of an instantiated object, and function call stack information of the instantiated object of a pre-specified target class in a target program is extracted from the system log, including:
and extracting function call stack information of the instantiation object of the target class pre-specified in the target program from the system log based on the criticality identification.
In the embodiment of the disclosure, in the first device, a page image of a currently displayed page of the target program may be acquired, page content included in the page image is identified, the identified page content is matched with page content corresponding to an instantiation object, and a key degree identifier is added to function call stack information of the instantiation object according to a matching result.
The criticality identification can identify the criticality of the page content corresponding to the instantiation object in the page, and in actual use, the criticality identification can respectively correspond to multiple criticality levels.
Specifically, instantiated objects that can be matched to key content in a page, such as a main title of the page, a main graph of the page, and a large text in the page, may be determined to be higher in level of criticality, and function call stack information of the instantiated objects may be added with a criticality identifier with a higher level of criticality.
And adding a key degree identifier for the function call stack information, and writing the function call stack information added with the key degree identifier into a system log, so that the function call stack information can be conveniently searched in the system log through the key degree identifier.
Specifically, the function call stack information corresponding to the key level identifier with the higher key level may be extracted by preferentially searching the key level identifier with the higher key level from the system log.
Based on the same principle as the method shown in fig. 1, fig. 3 shows a schematic structural diagram of a function positioning apparatus provided by the embodiment of the present disclosure, and as shown in fig. 3, the function positioning apparatus 30 may include:
the monitoring module 310 is configured to monitor an instantiated object of a pre-specified target class in a target program when the target program is running;
the filtering module 320 is configured to determine whether the page content corresponding to the instantiation object meets a preset content filtering condition when the instantiation object call function is monitored;
the function call stack information module 330 is configured to, when the page content corresponding to the instantiated object meets a preset content filtering condition, obtain function call stack information of the instantiated object, where the function call stack information is used to determine a function called by the instantiated object.
The device provided by the embodiment of the disclosure monitors an instantiation object of a pre-specified target class in a target program when the target program is running, determines whether page content corresponding to the instantiation object meets a preset content filtering condition when an instantiation object calling function is monitored, and obtains function calling stack information of the instantiation object which meets the preset content filtering condition or not, so as to determine a function called by the instantiation object based on analysis of the function calling stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
Optionally, the content filtering condition comprises at least one of:
page content corresponding to the instantiation object belongs to a preset content type;
the data length of the page content corresponding to the instantiation object is not less than the specified value;
the page content corresponding to the instantiation object comprises preset content.
Optionally, when the function call stack information module obtains the function call stack information of the instantiated object, the function call stack information module is specifically configured to:
writing the function call stack information of the instantiated object into a system log;
function call stack information is extracted from the system log.
Optionally, the apparatus further comprises:
the key degree identification module is used for acquiring a page image of a current display page of the target program before writing the function call stack information of the instantiated object into a system log;
matching the corresponding page content of the instantiation object with the page image to obtain a matching result;
and adding a criticality identification to the function call stack information of the instantiation object based on the matching result.
When writing the function call stack information of the instantiated object into the system log, the function call stack information module is specifically configured to:
and writing the function call stack information added with the criticality identification into a system log.
Optionally, the apparatus further comprises any one of:
the function positioning module is used for determining the function called by the instantiation object based on the function calling stack information;
and the function call stack information providing module is used for providing the function call stack information to the second equipment so that the second equipment determines the function called by the instantiation object based on the function call stack information.
It is understood that the above modules of the positioning device of the function in the embodiment of the present disclosure have functions of implementing the corresponding steps of the positioning method of the function in the embodiment shown in fig. 1. The functions can be realized by hardware, and can also be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the function positioning apparatus, reference may be specifically made to the corresponding description of the function positioning method in the embodiment shown in fig. 1, and details are not repeated here.
Based on the same principle as the method shown in fig. 2, fig. 4 shows a schematic structural diagram of a function positioning apparatus provided by the embodiment of the present disclosure, and as shown in fig. 4, the function positioning apparatus 40 may include:
a function call stack information obtaining module 410, configured to obtain function call stack information of an instantiated object of a pre-specified target class in a target program provided by a first device, where the function call stack information is provided to a second device when the first device monitors the instantiated object call function in a process of running the target program and page content corresponding to the instantiated object meets a preset content filtering condition;
a function determining module 420, configured to determine a function called by the instantiated object based on the function call stack information.
According to the device provided by the embodiment of the disclosure, the instantiated object call function is monitored by the first device in the process of running the target program, and when the page content corresponding to the instantiated object meets the preset content filtering condition, the function call stack information is provided for the second device, and the second device determines the function called by the instantiated object based on the function call stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
Optionally, when the function call stack information obtaining module obtains the function call stack information of the instantiation object of the target class pre-specified in the target program provided by the first device, the function call stack information obtaining module is specifically configured to:
acquiring a system log provided by first equipment;
and extracting function call stack information of an instantiation object of a target class pre-specified in the target program from the system log.
Optionally, the function call stack information in the system log is added with a key degree identifier of an instantiated object, and when the function call stack information of the instantiated object of the pre-specified target class in the target program is extracted from the system log, the function call stack information acquiring module is specifically configured to:
and extracting function call stack information of the instantiation object of the target class pre-specified in the target program from the system log based on the criticality identification.
It is understood that the above modules of the positioning device of the function in the embodiment of the present disclosure have functions of implementing the corresponding steps of the positioning method of the function in the embodiment shown in fig. 2. The functions can be realized by hardware, and can also be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described functions. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the function positioning apparatus, reference may be specifically made to the corresponding description of the function positioning method in the embodiment shown in fig. 2, and details are not repeated here.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
The electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a positioning method as provided by embodiments of the present disclosure.
Compared with the prior art, the electronic equipment monitors the instantiation object of the pre-designated target class in the target program when the target program is operated, determines whether the page content corresponding to the instantiation object meets the preset content filtering condition or not when the instantiation object calling function is monitored, and obtains the function calling stack information of the instantiation object meeting the preset content filtering condition or not, so that the function called by the instantiation object is determined based on the analysis of the function calling stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
The readable storage medium is a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a positioning method of functions as provided by the embodiments of the present disclosure.
Compared with the prior art, the readable storage medium monitors an instantiation object of a pre-designated target class in a target program when the target program is operated, determines whether page content corresponding to the instantiation object meets a preset content filtering condition or not when an instantiation object calling function is monitored, and obtains function calling stack information of the instantiation object meeting the preset content filtering condition or not, so that the function called by the instantiation object is determined based on analysis of the function calling stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the program codes which are compiled reversely, and the defects in the prior art are overcome.
The computer program product comprises a computer program which, when executed by a processor, implements a positioning method of a function as provided by an embodiment of the present disclosure.
Compared with the prior art, the computer program product monitors the instantiation object of the pre-designated target class in the target program when the target program is operated, determines whether the page content corresponding to the instantiation object meets the preset content filtering condition or not when the instantiation object calling function is monitored, and obtains the function calling stack information of the instantiation object meeting the preset content filtering condition or not, so that the function called by the instantiation object is determined based on the analysis of the function calling stack information. Based on the scheme, the instantiation objects of the key contents in the page can be determined by setting the content filtering conditions, the key functions are determined based on the function call stack information, a foundation is provided for positioning the key functions in the decompiled program codes, and the defects in the prior art are overcome.
FIG. 5 illustrates a schematic block diagram of an example electronic device 2000, which can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the device 2000 includes a computing unit 2010, which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)2020, or a computer program loaded from a storage unit 2080 into a Random Access Memory (RAM) 2030. In the RAM 2030, various programs and data required for the operation of the device 2000 can also be stored. The computing unit 2010, ROM 2020, and RAM 2030 are coupled to each other via bus 2040. An input/output (I/O) interface 2050 is also connected to bus 2040.
Various components in device 2000 are connected to I/O interface 2050, including: an input unit 2060 such as a keyboard, a mouse, or the like; an output unit 2070 such as various types of displays, speakers, and the like; a storage unit 2080 such as a magnetic disk, an optical disk, and the like; and a communication unit 2090, such as a network card, modem, wireless communication transceiver, etc. The communication unit 2090 allows the device 2000 to exchange information/data with other devices over a computer network, such as an internet and/or various telecommunication networks.
Computing unit 2010 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing units 2010 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, computing units running various machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 2010 performs the positioning method of the functions provided in the embodiments of the present disclosure. For example, in some embodiments, the location method for the functions provided in embodiments of the present disclosure may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 2080. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 2000 via the ROM 2020 and/or the communication unit 2090. When the computer program is loaded into RAM 2030 and executed by computing unit 2010, one or more steps of the localization method of the functions provided in the embodiments of the present disclosure may be performed. Alternatively, in other embodiments, the computing unit 2010 may be configured in any other suitable manner (e.g., by firmware) to perform the positioning methods of the functions provided in the embodiments of the disclosure.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combining a block chain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (13)

1. A method for positioning a function, applied to a first device, comprises:
monitoring an instantiation object of a pre-specified target class in a target program when the target program is operated;
when the instantiated object calling function is monitored, determining whether the page content corresponding to the instantiated object meets a preset content filtering condition;
and if so, acquiring function call stack information of the instantiated object, wherein the function call stack information is used for determining the function called by the instantiated object.
2. The method of claim 2, wherein the content filtering condition comprises at least one of:
the page content corresponding to the instantiation object belongs to a preset content type;
the data length of the page content corresponding to the instantiation object is not less than a specified value;
the page content corresponding to the instantiation object comprises preset content.
3. The method of claim 1 or 2, wherein obtaining function call stack information for the instantiated object comprises:
writing the function call stack information of the instantiation object into a system log;
and extracting the function call stack information from the system log.
4. The method of claim 3, wherein prior to writing the function call stack information of the instantiated object to a system log, the method further comprises:
acquiring a page image of a current display page of the target program;
matching the page content corresponding to the instantiation object with the page image to obtain a matching result;
adding a key degree identifier to function call stack information of the instantiated object based on the matching result;
writing the function call stack information of the instantiated object into a system log, including:
and writing the function call stack information added with the key degree identification into a system log.
5. The method of any one of claims 1-4, further comprising any one of:
determining a function called by the instantiation object based on the function call stack information;
and providing the function call stack information to a second device so that the second device determines the function called by the instantiation object based on the function call stack information.
6. A method for positioning a function is applied to a second device and comprises the following steps:
acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by first equipment, wherein the function call stack information is provided for second equipment when the first equipment monitors the instantiation object call function in the process of running the target program and page content corresponding to the instantiation object meets a preset content filtering condition;
and determining the function called by the instantiation object based on the function call stack information.
7. The method of claim 6, wherein the obtaining function call stack information of an instantiation object of a pre-specified target class in a target program provided by a first device comprises:
acquiring a system log provided by first equipment;
and extracting function call stack information of an instantiation object of a pre-specified target class in the target program from the system log.
8. The method of claim 7, wherein the function call stack information in the system log is added with a criticality identifier of the instantiated object, and the extracting function call stack information of the instantiated object of the pre-specified target class in the target program from the system log comprises:
and extracting function call stack information of an instantiation object of a pre-specified target class in the target program from the system log based on the criticality identification.
9. A device for locating a function, comprising:
the monitoring module is used for monitoring an instantiation object of a pre-specified target class in a target program when the target program is operated;
the filtering module is used for determining whether the page content corresponding to the instantiation object meets a preset content filtering condition or not when the instantiation object calling function is monitored;
and the function call stack information module is used for acquiring the function call stack information of the instantiated object when the page content corresponding to the instantiated object meets a preset content filtering condition, and the function call stack information is used for determining the function called by the instantiated object.
10. A device for locating a function, comprising:
a function call stack information obtaining module, configured to obtain function call stack information of an instantiated object of a pre-specified target class in a target program provided by a first device, where the function call stack information is provided to a second device when the first device monitors the instantiated object call function in a process of running the target program and a page content corresponding to the instantiated object meets a preset content filtering condition;
and the function determining module is used for determining the function called by the instantiation object based on the function call stack information.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202110753195.7A 2021-07-02 2021-07-02 Function positioning method and device, electronic equipment and readable storage medium Active CN113360407B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110753195.7A CN113360407B (en) 2021-07-02 2021-07-02 Function positioning method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110753195.7A CN113360407B (en) 2021-07-02 2021-07-02 Function positioning method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113360407A true CN113360407A (en) 2021-09-07
CN113360407B CN113360407B (en) 2023-10-13

Family

ID=77538054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110753195.7A Active CN113360407B (en) 2021-07-02 2021-07-02 Function positioning method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113360407B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468407A (en) * 2015-11-19 2016-04-06 国云科技股份有限公司 Method for automatic discovery and sequential running of startup classes
US20160283357A1 (en) * 2014-03-07 2016-09-29 Tencent Technology (Shenzhen) Company Limited Call stack relationship acquiring method and apparatus
CN110908865A (en) * 2019-11-15 2020-03-24 珠海豹趣科技有限公司 Memory leakage monitoring method and device and electronic equipment
CN111506500A (en) * 2020-04-09 2020-08-07 北京奇艺世纪科技有限公司 Memory leak detection method and device, electronic equipment and readable storage medium
CN111813666A (en) * 2020-06-30 2020-10-23 北京字节跳动网络技术有限公司 Memory leak positioning method, device, medium and electronic equipment
CN112148392A (en) * 2019-06-27 2020-12-29 腾讯科技(深圳)有限公司 Function call chain acquisition method and device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160283357A1 (en) * 2014-03-07 2016-09-29 Tencent Technology (Shenzhen) Company Limited Call stack relationship acquiring method and apparatus
CN105468407A (en) * 2015-11-19 2016-04-06 国云科技股份有限公司 Method for automatic discovery and sequential running of startup classes
CN112148392A (en) * 2019-06-27 2020-12-29 腾讯科技(深圳)有限公司 Function call chain acquisition method and device and storage medium
CN110908865A (en) * 2019-11-15 2020-03-24 珠海豹趣科技有限公司 Memory leakage monitoring method and device and electronic equipment
CN111506500A (en) * 2020-04-09 2020-08-07 北京奇艺世纪科技有限公司 Memory leak detection method and device, electronic equipment and readable storage medium
CN111813666A (en) * 2020-06-30 2020-10-23 北京字节跳动网络技术有限公司 Memory leak positioning method, device, medium and electronic equipment

Also Published As

Publication number Publication date
CN113360407B (en) 2023-10-13

Similar Documents

Publication Publication Date Title
EP3916584A1 (en) Information processing method and apparatus, electronic device and storage medium
CN114021156A (en) Method, device and equipment for organizing vulnerability automatic aggregation and storage medium
CN112506581A (en) Method and device for rendering small program, electronic equipment and readable storage medium
CN113378855A (en) Method for processing multitask, related device and computer program product
CN113360918A (en) Vulnerability rapid scanning method, device, equipment and storage medium
CN114861059A (en) Resource recommendation method and device, electronic equipment and storage medium
CN116644223A (en) Data query method, device, equipment and readable medium
CN113836462A (en) Page description file generation method, device, equipment and storage medium
CN113904943A (en) Account detection method and device, electronic equipment and storage medium
CN113627526A (en) Vehicle identification recognition method and device, electronic equipment and medium
CN113495825A (en) Line alarm processing method and device, electronic equipment and readable storage medium
CN112947916A (en) Method, device, equipment and storage medium for realizing online canvas
CN114329164B (en) Method, apparatus, device, medium, and article for processing data
CN113407745B (en) Data labeling method, device, electronic equipment and computer readable storage medium
CN113590447B (en) Buried point processing method and device
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN113360407B (en) Function positioning method and device, electronic equipment and readable storage medium
CN113360672B (en) Method, apparatus, device, medium and product for generating knowledge graph
CN114581711A (en) Target object detection method, apparatus, device, storage medium, and program product
CN112597377A (en) Information extraction module generation method, information extraction method and device
CN114791996B (en) Information processing method, device, system, electronic equipment and storage medium
CN113360258B (en) Data processing method, device, electronic equipment and storage medium
CN117668833A (en) Abnormal operation identification method, device, electronic equipment and storage medium
CN114428646A (en) Data processing method and device, electronic equipment and storage medium
CN113626051A (en) Byte code updating method and device and electronic equipment

Legal Events

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