CN113360407B - 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
CN113360407B
CN113360407B CN202110753195.7A CN202110753195A CN113360407B CN 113360407 B CN113360407 B CN 113360407B CN 202110753195 A CN202110753195 A CN 202110753195A CN 113360407 B CN113360407 B CN 113360407B
Authority
CN
China
Prior art keywords
call stack
instantiation object
function
stack information
function call
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110753195.7A
Other languages
Chinese (zh)
Other versions
CN113360407A (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

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, a function positioning 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 target class pre-designated in a target program when the target program is operated; when monitoring that the instantiation object calls a function, determining whether page content corresponding to the instantiation object meets preset content filtering conditions; if yes, acquiring function call stack information of the instantiation object, wherein the function call stack information is used for determining a function called by the instantiation object. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.

Description

Function positioning method and device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to the field of computer technology, in particular to the field of reverse technology, and specifically relates to a function positioning method, a function positioning device, an electronic device and a readable storage medium.
Background
Currently, in the reverse operation of an Android application program (APP), after decompiled program code is obtained in the reverse direction, a key function in the decompiled program code needs to be located.
Difficulties in locating key functions can result when the amount of code of the reverse-out object program is large and confusion exists.
Disclosure of Invention
In order to solve at least one of the defects, the disclosure provides a function positioning method, a function positioning device, 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 target class pre-designated in a target program when the target program is operated;
when monitoring that the instantiation object calls a function, determining whether page content corresponding to the instantiation object meets preset content filtering conditions;
if yes, acquiring function call stack information of the instantiation object, wherein the function call stack information is used for determining a function called by the instantiation object.
According to a second aspect of the present disclosure, there is provided a method of locating another 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 a first device, wherein the function call stack information is provided for a second device when the first device monitors that the instantiation object calls a function in the process of running the target program and page content corresponding to the instantiation object meets preset content filtering conditions;
a function called by the instantiation object is determined based on the function call stack information.
According to a third aspect of the present disclosure, there is provided a positioning device of a function, the device comprising:
the monitoring module is used for monitoring an instantiation object of a pre-designated target class in the target program when the target program is operated;
the filtering module is used for determining whether page content corresponding to the instantiation object meets preset content filtering conditions or not when the instantiation object calls the function;
the function call stack information module is used for acquiring the function call stack information of the instantiation object when the page content corresponding to the instantiation object meets the preset content filtering condition, and the function call stack information is used for determining the function called by the instantiation object.
According to a fourth aspect of the present disclosure, there is provided a positioning device of another function, the device comprising:
the function call stack information acquisition module is used for acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by the first device, wherein the function call stack information is provided for the second device when the first device monitors that the instantiation object calls a 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 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 locating the function.
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 a positioning method of the above-described functions.
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 a positioning method of the above-described functions.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a method for locating a function provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a positioning method of another function provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a positioning device according to one function provided in 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 positioning method of functions of embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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 flow chart of a method for positioning a function according to an embodiment of the disclosure, as shown in fig. 1, the method may mainly include:
step S110: monitoring an instantiation object of a target class pre-designated in a target program when the target program is operated;
step S120: when monitoring that the instantiation object calls a function, determining whether page content corresponding to the instantiation object meets preset content filtering conditions;
step S130: if yes, acquiring function call stack information of the instantiation object, wherein the function call stack information is used for determining a function called by the instantiation object.
In the embodiment of the disclosure, the target program may be an APP for which reverse work is aimed, the target class may be a class required when implementing some key contents (such as text, pictures, and videos) in a page of the target program, the class required for implementing the key contents is generally json, array, map and string, and json, array, map and string classes may be used as target classes.
Instantiating the object, namely, instantiating the target class to obtain the object. When the target program runs, the behavior of the instantiation object calling function can be monitored. Since the number of the instantiation objects may be numerous and the corresponding page content may not belong to the key content in the page, the instantiation objects may be filtered according to the preset content filtering condition, so that the page content corresponding to the filtered instantiation objects is the key content, and the function called by the filtered instantiation objects may be considered as the key function.
In the embodiment of the disclosure, the function call stack information includes related 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 decompiled program code, huge code quantity of the target program and confusion in the code are avoided, and positioning of the target function is affected.
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 function called by the instantiation object is monitored, whether page content corresponding to the instantiation object meets the preset content filtering condition is determined, and function call stack information of the instantiation object meeting the preset content filtering condition is acquired, so that the function called by the instantiation object is determined based on analysis of the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.
In an alternative embodiment of the present disclosure, the content filtering condition includes 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 the appointed 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 text, pictures, videos, and the like, and these types of content may be considered as key content in the page, so that the instantiation object may be filtered through the preset content types.
In the implementation of the present disclosure, for the text type page content, the filtering may also be performed by setting a specified value of the data length, and specifically, when the data length of the page content corresponding to the instance object is longer, the page content may be considered as the key content. The specified value can be configured according to actual needs.
In the implementation of the present disclosure, the filtering may also 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 to be the keyword.
In an alternative embodiment of the present disclosure, obtaining function call stack information of an instantiation object includes:
writing function call stack information of the instantiation object into a system log;
function call stack information is extracted from the system log.
In the embodiment of the disclosure, the first device may be deployed in a pre-built operating system, where the operating system is built according to requirements in the embodiment of the disclosure, and compared with a standard Android system, the Android system built in the embodiment of the disclosure modifies system codes, so that when a function is called by a target object in a target program, call related information of the function is written into a system log, and then function call stack information can be extracted from the system log.
In embodiments of the present disclosure, listeners may be registered when creating instances for a target class. And monitoring the behavior of the instantiation object calling function through the monitor. A listener may also be registered for filtering the instantiation object based on content filtering conditions when the instantiation object invokes a function.
In an optional implementation manner of the embodiment of the disclosure, before writing the function call stack information of the instantiation object to 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;
based on the matching result, a criticality identification is added to the function call stack information of the instantiation object.
Writing function call stack information of the instantiated objects into a system log, comprising:
and writing the function call stack information added with the key degree identification into a system log.
In the embodiment of the disclosure, a page image of a current display page of a target program can be acquired, page contents contained in the page image are identified, the identified page contents are matched with the corresponding page contents of an instantiation object, and a key degree identifier is added for function call stack information of the instantiation object according to a matching result.
The key degree identification can identify the key degree of the page content corresponding to the instantiation object in the page, and in actual use, the key degree identification can respectively correspond to a plurality of key degree levels.
Specifically, the instantiation objects which can be matched to the key content in the pages such as the main title of the page, the main diagram of the page and the large text in the page can be determined to be higher in key degree level, and the key degree identification with higher key degree level is added to the function call stack information of the instantiation objects.
And adding a key degree identifier for the function call stack information, writing the function call stack information added with the key degree identifier into a system log, and conveniently searching the function call stack information in the system log through the key degree identifier.
Specifically, the key degree identifier with higher key degree level can be preferentially searched from the system log, and the function call stack information corresponding to the key degree identifier with higher key degree level can be extracted.
In an alternative implementation of the disclosed embodiments, the method further includes 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 instantiation object based on the function call stack information.
In the embodiment of the disclosure, the first device may acquire the function call stack information, and determine the function called by the instantiation object according to the number call stack information. Function call stack information may also be provided to the second device, which determines the function called by the instantiation object based on the function call stack information.
Fig. 2 is a flow chart illustrating a positioning method of another function provided by an embodiment of the disclosure, and as shown in fig. 2, the method may mainly include:
step S210: acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by a first device, wherein the function call stack information is provided for a second device when the first device monitors that the instantiation object calls a function in the process of running the target program and page content corresponding to the instantiation object meets preset content filtering conditions;
step S220: a function called by the instantiation object is determined based on the function call stack information.
Wherein the object program may be run in the first device. The target program may be APP for which reverse work is aimed, the target class may be a class required when implementing some key contents (such as text, pictures, and videos) in a page of the target program, the classes required for implementing the key contents are generally json, array, map, and string, and json, array, map, and string classes may be used as target classes.
Instantiating the object, namely, instantiating the target class to obtain the object. When the target program runs, the behavior of the instantiation object calling function can be monitored. Since the number of the instantiation objects may be numerous and the corresponding page content may not belong to the key content in the page, the instantiation objects may be filtered according to the preset content filtering condition, so that the page content corresponding to the filtered instantiation objects is the key content, and the function called by the filtered instantiation objects may be considered as the key function.
In the embodiment of the disclosure, the function call stack information includes related 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 decompiled program code, huge code quantity of the target program and confusion in the code are avoided, and positioning of the target function is affected.
According to the method provided by the embodiment of the disclosure, when the first device monitors that the object is instantiated to call a function in the process of running the target program and the page content corresponding to the object is instantiated to meet the preset content filtering condition, function call stack information is provided for the second device, and the second device determines the function called by the object is instantiated based on the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.
In an optional embodiment of the disclosure, obtaining function call stack information of an instantiation object of a target class pre-specified in a target program provided by a first device includes:
acquiring a system log provided by first equipment;
function call stack information of an instantiation object of a pre-specified target class in a target program is extracted from a system log.
In the embodiment of the 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-built operating system, where the operating system is built according to requirements in an embodiment of the disclosure, and compared with a standard Android system, the Android system built in the embodiment of the disclosure modifies a system code, so that when a function is called by a target object in a target program, call related information of the function is written into a system log, and then function call stack information can be extracted from the system log.
In embodiments of the present disclosure, listeners may be registered when creating instances for a target class. And monitoring the behavior of the instantiation object calling function through the monitor. A listener may also be registered for filtering the instantiation object based on content filtering conditions when the instantiation object invokes a function.
In an optional embodiment of the disclosure, the function call stack information in the system log is added with a key degree identifier of an instantiation object, and the function call stack information of the instantiation object of a pre-specified target class in the target program is extracted from the system log, including:
and extracting function call stack information of the instantiation object of the pre-specified target class in the target program from the system log based on the key degree identification.
In the embodiment of the disclosure, in a first device, a page image of a current display page of a target program may be obtained, page content included in the page image is identified, the identified page content is matched with corresponding page content of an instantiation object, and a key degree identifier is added for function call stack information of the instantiation object according to a matching result.
The key degree identification can identify the key degree of the page content corresponding to the instantiation object in the page, and in actual use, the key degree identification can respectively correspond to a plurality of key degree levels.
Specifically, the instantiation objects which can be matched to the key content in the pages such as the main title of the page, the main diagram of the page and the large text in the page can be determined to be higher in key degree level, and the key degree identification with higher key degree level is added to the function call stack information of the instantiation objects.
And adding a key degree identifier for the function call stack information, writing the function call stack information added with the key degree identifier into a system log, and conveniently searching the function call stack information in the system log through the key degree identifier.
Specifically, the key degree identifier with higher key degree level can be preferentially searched from the system log, and the function call stack information corresponding to the key degree identifier with higher key degree level can be extracted.
Based on the same principle as the method shown in fig. 1, fig. 3 shows a schematic structural diagram of a functional positioning device provided by an embodiment of the present disclosure, and as shown in fig. 3, the functional positioning device 30 may include:
a monitoring module 310, configured to monitor an instantiation object of a target class pre-specified in a target program when the target program is running;
the filtering module 320 is configured to determine, when the instantiation object call function is monitored, whether the page content corresponding to the instantiation object meets a preset content filtering condition;
the function call stack information module 330 is configured to obtain function call stack information of the instantiated object when page content corresponding to the instantiated object meets a preset content filtering condition, where the function call stack information is used to determine a function called by the instantiated object.
According to the device 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 function called by the instantiation object is monitored, whether page content corresponding to the instantiation object meets the preset content filtering condition is determined, and function call stack information of the instantiation object meeting the preset content filtering condition is acquired, so that the function called by the instantiation object is determined based on analysis of the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.
Optionally, the content filtering condition includes 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 the appointed value;
the page content corresponding to the instantiation object comprises preset content.
Optionally, the function call stack information module is specifically configured to, when acquiring the function call stack information of the instantiation object:
writing function call stack information of the instantiation object into a system log;
function call stack information is extracted from the system log.
Optionally, the apparatus further includes:
the key degree identification module is used for acquiring a page image of a current display page of the target program before the function call stack information of the instantiation object is written into the system log;
matching the corresponding page content of the instantiation object with the page image to obtain a matching result;
based on the matching result, a criticality identification is added to the function call stack information of the instantiation object.
The function call stack information module is specifically used for writing the function call stack information of the instantiation object into the system log:
and writing the function call stack information added with the key degree identification into a system log.
Optionally, the above device further comprises any one of the following:
the function positioning module is used for determining a function called by the instantiation object based on the function call stack information;
and the function call stack information providing module is used for providing the function call stack information to the second device so that the second device determines the function called by the instantiation object based on the function call stack information.
It will be appreciated that the above-described modules of the positioning device of the function in the embodiment of the present disclosure have the function 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 executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules may be software and/or hardware, and each module may be implemented separately or may be implemented by integrating multiple modules. For the functional description of each module of the above functional positioning device, reference may be specifically made to the corresponding description of the functional positioning method in the embodiment shown in fig. 1, which is not repeated herein.
Based on the same principle as the method shown in fig. 2, fig. 4 shows a schematic structural diagram of a functional positioning device provided by an embodiment of the present disclosure, and as shown in fig. 4, the functional positioning device 40 may include:
the function call stack information obtaining module 410 is configured to obtain function call stack information of an instantiation object of a target class pre-specified 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 that the instantiation object calls a function in a process of running the target program, and page content corresponding to the instantiation object meets a preset content filtering condition;
the function determining module 420 is configured to determine a function called by the instantiation object based on the function call stack information.
According to the device provided by the embodiment of the disclosure, when the first device monitors that the object is instantiated to call a function in the process of running the target program and the page content corresponding to the object is instantiated to meet the preset content filtering condition, function call stack information is provided for the second device, and the second device determines the function called by the object is instantiated based on the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.
Optionally, the function call stack information obtaining module is specifically configured to, when obtaining function call stack information of an instantiation object of a target class pre-specified in a target program provided by the first device:
acquiring a system log provided by first equipment;
function call stack information of an instantiation object of a pre-specified target class in a target program is extracted from a system log.
Optionally, the key degree identifier of the instantiated object is added to the function call stack information in the system log, and the function call stack information acquisition module is specifically used for, when extracting the function call stack information of the instantiated object of the target class pre-specified in the target program from the system log:
and extracting function call stack information of the instantiation object of the pre-specified target class in the target program from the system log based on the key degree identification.
It will be appreciated that the above-described modules of the positioning device of the function in the embodiment of the present disclosure have the function 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 executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules may be software and/or hardware, and each module may be implemented separately or may be implemented by integrating multiple modules. For the functional description of each module of the above functional positioning device, reference may be specifically made to the corresponding description of the functional positioning method in the embodiment shown in fig. 2, which is not repeated herein.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
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 the 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 when the function called by the instantiation object is monitored, and acquires the function call stack information of the instantiation object meeting the preset content filtering condition or not according to the page content corresponding to the instantiation object, so that the function called by the instantiation object is determined based on the analysis of the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, 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 as provided by 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 preset content filtering conditions when the instantiation object call function is monitored, and acquires function call stack information of the instantiation object meeting the preset content filtering conditions or not according to the page content corresponding to the instantiation object, so that the function called by the instantiation object is determined based on analysis of the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, 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 for a function as provided by embodiments 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 when the instantiation object call function is monitored, and acquires the function call stack information of the instantiation object meeting the preset content filtering condition or not according to the page content corresponding to the instantiation object, so that the function called by the instantiation object is determined based on the analysis of the function call stack information. Based on the scheme, the instantiation object of the key content in the page can be determined by setting the content filtering condition, and the key function is determined based on the function call stack information, so that a basis is provided for positioning the key function in the decompiled program code, and the defects in the prior art are overcome.
Fig. 5 shows a schematic block diagram of an example electronic device 2000 that may 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 2000 includes a computing unit 2010 that may perform various appropriate actions and processes according to 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 may also be stored. The computing unit 2010, ROM 2020, and RAM 2030 are connected to each other by a bus 2040. An input/output (I/O) interface 2050 is also connected to bus 2040.
Various components in the device 2000 are connected to the 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, or 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 through a computer network such as the internet and/or various telecommunication networks.
The 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 unit 2010 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. 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 positioning method of the functions provided in the 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, some 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 a positioning method of functions provided in embodiments of the disclosure may be performed. Alternatively, in other embodiments, the computing unit 2010 may be configured in any other suitable manner (e.g., by means of firmware) to perform the positioning method of the functions provided in the embodiments of the present disclosure.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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 may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (9)

1. A method of locating a function, for use with a first device, the method comprising:
monitoring an instantiation object of a target class pre-designated in a target program when the target program is operated;
when monitoring that the instantiation object calls a function, determining whether page content corresponding to the instantiation object meets a preset content filtering condition;
if yes, acquiring function call stack information of the instantiation object, wherein the function call stack information is used for determining a function called by the instantiation object;
the method further comprises the steps of:
acquiring a page image of a current display page of the 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.
2. The method of claim 1, 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 smaller than a specified value;
the page content corresponding to the instantiation object comprises preset content.
3. The method of claim 1, wherein obtaining function call stack information for the instantiation 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. A method according to any one of claims 1-3, 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 a function called by the instantiation object based on the function call stack information.
5. A method for locating a function, applied to a second device, comprising:
acquiring function call stack information of an instantiation object of a pre-designated target class in a target program provided by a first device, wherein the function call stack information is provided for a second device when the first device monitors that the instantiation object calls a function in the process of running the target program and page content corresponding to the instantiation object meets preset content filtering conditions;
determining a function called by the instantiation object based on the function call stack information;
the obtaining the function call stack information of the instantiation object of the target class pre-specified in the target program provided by the first device includes:
acquiring a system log provided by first equipment;
extracting function call stack information of an instantiation object of a target class pre-designated in a target program from the system log;
the key degree identification of the instantiation object is added to the function call stack information in the system log, and the function call stack information of the instantiation object of the pre-specified target class in the target program is extracted from the system log, which comprises the following steps:
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.
6. A function positioning device, comprising:
the monitoring module is used for monitoring an instantiation object of a target class pre-designated 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 calls a function;
the function call stack information module is used for acquiring the function call stack information of the instantiation object when the page content corresponding to the instantiation object meets the preset content filtering condition, and the function call stack information is used for determining the function called by the instantiation object;
the key degree identification module is used for acquiring a page image of a current display page of the 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.
7. A function positioning device, 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 a first device, wherein the function call stack information is provided for a second device when the first device monitors that the instantiation object calls a function in the process of running the target program and page content corresponding to the instantiation object meets preset content filtering conditions;
a function determining module, configured to determine a function called by the instantiation object based on the function call stack information;
the function call stack information acquisition module is specifically configured to, when acquiring function call stack information of an instantiation object of a target class pre-specified in a target program provided by a first device:
acquiring a system log provided by first equipment;
extracting function call stack information of an instantiation object of a target class pre-designated in a target program from the system log;
the function call stack information in the system log is added with the key degree identification of the instantiation object, and the function call stack information acquisition module is specifically used for when extracting the function call stack information of the instantiation object of the target class pre-specified in the target program from the system log:
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.
8. 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-5.
9. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
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 CN113360407A (en) 2021-09-07
CN113360407B true 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 (5)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899016B (en) * 2014-03-07 2018-10-09 腾讯科技(深圳)有限公司 Allocating stack Relation acquisition method and device

Patent Citations (5)

* 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
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
CN113360407A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN112559086B (en) Applet page rendering method and device, electronic equipment and readable storage medium
CN113392346B (en) Path processing method and device for resource file, electronic equipment and storage medium
CN113378855A (en) Method for processing multitask, related device and computer program product
CN112528641A (en) Method and device for establishing information extraction model, electronic equipment and readable storage medium
CN113778644B (en) Task processing method, device, equipment and storage medium
CN113904943B (en) Account detection method and device, electronic equipment and storage medium
CN113780297B (en) Image processing method, device, equipment and storage medium
CN113641544B (en) Method, apparatus, device, medium and product for detecting application state
CN112817660B (en) Method, device, equipment and storage medium for expanding applet capability
CN114861059A (en) Resource recommendation method and device, electronic equipment and storage medium
CN113836462A (en) Page description file generation method, device, equipment and storage medium
CN113963186A (en) Training method of target detection model, target detection method and related device
CN113360266A (en) Task processing method and device
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
CN116302218B (en) Function information adding method, device, equipment and storage medium
CN113360407B (en) Function positioning method and device, electronic equipment and readable storage medium
CN115481594B (en) Scoreboard implementation method, scoreboard, electronic equipment and storage medium
CN114374703B (en) Cloud mobile phone information acquisition method, device, equipment and storage medium
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN113360672B (en) Method, apparatus, device, medium and product for generating knowledge graph
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN113343064B (en) Data processing method, apparatus, device, storage medium, and computer program product
CN116341663A (en) Extension method, device, equipment and medium of deep learning reasoning framework
CN117931195A (en) Data dictionary processing method and device, electronic equipment and storage medium

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