CN105224346A - Objective function localization method and device - Google Patents

Objective function localization method and device Download PDF

Info

Publication number
CN105224346A
CN105224346A CN201410231453.5A CN201410231453A CN105224346A CN 105224346 A CN105224346 A CN 105224346A CN 201410231453 A CN201410231453 A CN 201410231453A CN 105224346 A CN105224346 A CN 105224346A
Authority
CN
China
Prior art keywords
address
function
objective function
realm
library
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
CN201410231453.5A
Other languages
Chinese (zh)
Other versions
CN105224346B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410231453.5A priority Critical patent/CN105224346B/en
Publication of CN105224346A publication Critical patent/CN105224346A/en
Application granted granted Critical
Publication of CN105224346B publication Critical patent/CN105224346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of objective function localization method and device.Objective function localization method of the present invention, comprise: after the first process is disposed, determine objective function to be tracked the first address in the first process, load the function library at list determination objective function place according to the kinematic function storehouse of the first address and the first process, determine the address offset amount of the first address relative to the end-point addresses of the first address realm according to the first address realm of function library; In the process of process second process, load the second address realm of list determination function library according to the kinematic function storehouse of the second process, according to end-point addresses and second address of address offset amount determination objective function in the second process of the second address realm.The present invention, by determining the address offset amount of the address of objective function relative to the function library address realm end-point addresses at this objective function place, achieves the location to objective function, and solving in prior art cannot the technical matters of localizing objects function.

Description

Objective function localization method and device
Technical field
The present invention relates to computer technology, particularly relate to a kind of objective function localization method and device.
Background technology
Locational space configuration random loading (Addressspacelayoutrandomization is called for short ASLR), is also called the randomization of locational space layout.Being a kind of security protection technology for buffer overflow, by the randomization to linear zone layouts such as heap, stack, shared library mappings, is data Random assignment address.
Under ASLR mechanism, in the processing procedure of different process, it is continuous dynamic change that the kinematic function storehouse of its correspondence loads list, and namely kinematic function storehouse loads the address realm in list corresponding to each function library is constantly change.Correspondingly, in function library, the address of each function is also constantly change.
Due in different process, the address of objective function constantly changes, and makes when carrying out debugging software, or, after the software run collapses, be difficult to follow the trail of objective function.How under ASLR mechanism, localizing objects function is a problem demanding prompt solution.
Summary of the invention
The invention provides a kind of objective function localization method and device, to overcome in prior art the technical matters being difficult to localizing objects function.
The invention provides a kind of objective function localization method, comprising:
After the first process is disposed, determine objective function to be tracked the first address in described first process;
Kinematic function storehouse according to described first address and described first process loads list, determines the function library at described objective function place;
According to the first address realm of described function library, determine the address offset amount of described first address relative to the end-point addresses of described first address realm;
In the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library;
According to end-point addresses and the described address offset amount of described second address realm, determine second address of described objective function in described second process.
Further, describedly determine objective function to be tracked the first address in described first process, comprising:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
Further, described end-point addresses is first address or the tail address of address realm.
The present invention also provides a kind of objective function locating device, comprising:
First determination module, after being disposed in the first process, determines objective function to be tracked the first address in described first process;
Second determination module, loads list for the kinematic function storehouse according to described first address and described first process, determines the function library at described objective function place;
3rd determination module, for the first address realm according to described function library, determines the address offset amount of described first address relative to the end-point addresses of described first address realm;
4th determination module, in the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library;
5th determination module, for according to the end-point addresses of described second address realm and described address offset amount, determines second address of described objective function in described second process.
Further, described first process processing module, specifically for:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
Further, described end-point addresses is first address or the tail address of address realm.
Technique effect of the present invention is: the function library being loaded list determination objective function place by the kinematic function storehouse of first address of objective function in the first process and the first process, address side-play amount is determined according to the first address realm of function library and the first address, the second address realm of list determination function library is loaded according to the kinematic function storehouse of the second process, the second address in the second process according to the second address realm and address offset amount determination objective function, thus the location achieved objective function, solving in prior art cannot the technical matters of localizing objects function.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of objective function localization method embodiment of the present invention;
Fig. 2 is the structural representation of objective function locating device embodiment one of the present invention;
Fig. 3 is the structural representation of objective function locating device embodiment two of the present invention.
Embodiment
Fig. 1 is the process flow diagram of objective function localization method embodiment of the present invention.As shown in Figure 1, the method for the present embodiment can comprise:
Step 101, after the first process is disposed, determine objective function to be tracked the first address in described first process.
Particularly, after the first process is disposed, operating system, or the kinematic function storehouse that the device for carrying out objective function location can obtain in this process loads list and first address of objective function in this first process.
Step 102, load list according to the kinematic function storehouse of described first address and described first process, determine the function library at described objective function place.
Particularly, load the address realm of each function library in list according to the kinematic function storehouse in the first process, can determine which function library objective function belongs to.
Step 103, the first address realm according to described function library, determine the address offset amount of described first address relative to the end-point addresses of described first address realm.
Particularly, according to the first address realm of this function library, the address offset amount of the first address relative to the end-point addresses of this first address realm can be determined.
It should be noted that, step 101, step 102 and step 103 all perform after the first process is disposed.
For example, it is as shown in table 1 that the kinematic function storehouse in the first process process loads list.
Table 1
0x6e000-0x437fff tbtui armv7
0x89d000-0x89dfff MobileSubstrate.dylib armv6
0x8e0000-0x8e2fff SubstrateLoader.dylib armv6
0x906000-0x906fff QSAllSystemHook.dylib armv7
0x909000-0x91afff QSSystemHook.dylib armv7
0x92f000-0x952fff libMQQSecureJBFoundation.dylib armv7
0x9df000-0x9e2fff libMQQTHHFoundation.dylib armv7
First address of hypothetical target function in the first process is 0x0089d012, and it is as shown in table 1 that the kinematic function storehouse in the first process process loads list.According to the address realm of each function library in table 1, first address 0x0089d012 is between address realm 0x89d000-0x89dfff, that is objective function belongs to the function library corresponding with address realm 0x89d000-0x89dfff, so, what was certain was that the first address realm is 0x89d000-0x89dfff.Because the first address realm 0x89d000-0x89dfff is corresponding with MobileSubstrate.dylib function library, therefore, can determine that objective function belongs to MobileSubstrate.dylib function library.
Address side-play amount is determined again according to the first address 0x0089d012 and the first address realm 0x89d000-0x89dfff.Such as, can determine the address offset amount of the first address 0x89d000 of the first address 0x0089d012 and the first address realm, address offset amount is 0x12.
Step 104, in the process of process second process, load list according to the kinematic function storehouse of described second process, determine the second address realm of described function library.
Particularly, the process of different process, it is continuous dynamic change that the kinematic function storehouse of its correspondence loads list, and namely kinematic function storehouse loads the address realm in list corresponding to each function library is constantly change.Therefore, the address realm of a function library in the first process processing procedure is the first address realm, and in the second process processing procedure, its address realm may just become the second address realm.But the relative position relation of objective function in function library can not change, also namely address offset amount can not change.Therefore, first second address realm of list determination function library in the second process can be loaded according to the kinematic function storehouse of the second process, then according to the address offset amount determined in step 103 and the second second address of address realm determination objective function in the second process.
For example, it is as shown in table 2 that the kinematic function storehouse in the second process process loads list.
Table 2
0xdf000-0x4a8fff tbtui armv7
0x90f000-0x90ffff MobileSubstrate.dylib armv6
0x9510000-0x953fff SubstrateLoader.dylib armv6
0x977000-0x977fff QSAllSystemHook.dylib armv7
0x97a000-0x98bfff QSSystemHook.dylib armv7
0x9a0000-0x9c3fff libMQQSecureJBFoundation.dylib armv7
0xa50000-0xa53fff libMQQTHHFoundation.dylib armv7
More specifically, in the second process process, operating system, or the kinematic function storehouse that the device for carrying out objective function location can obtain in the second process process loads list, thus determines that second address realm of MobileSubstrate.dylib function library in the second process is 0x90f000-0x90ffff.
It should be noted that, in the process of process, obtain the loading list of kinematic function storehouse is the state of the art, repeats no more herein.
Step 105, according to the end-point addresses of described second address realm and described address offset amount, determine second address of described objective function in described second process.
According to the first address 0x90f000 of the second address realm and the address offset amount 0x12 that determines in step 103, determine second address of objective function in the second process, also i.e. 0x90f012.
It should be noted that, the second process can be first process after the first process, the second process also can be N number of process after the first process (wherein, N be greater than 1 positive integer), the present embodiment is not construed as limiting this.Also it should be noted that, the corresponding relation in above address, function library and function storehouse, address is all exemplary, and the present embodiment is not construed as limiting this.
Also it should be noted that, step 104 and step 105 are all perform in the process of process second process.
The present embodiment, the function library at list determination objective function place is loaded by the kinematic function storehouse of first address of objective function in the first process and the first process, address side-play amount is determined according to the first address realm of function library and the first address, the second address realm of list determination function library is loaded according to the kinematic function storehouse of the second process, the second address in the second process according to the second address realm and address offset amount determination objective function, thus the location achieved objective function, solving in prior art cannot the technical matters of localizing objects function.
On the basis of above-described embodiment, further, describedly determine objective function to be tracked the first address in described first process, comprising:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
Particularly, after the software such as run collapses, the intelligent terminals such as computing machine, panel computer, smart mobile phone can output example as the first process operation result of function call storehouse, the function address of run-time error can be comprised in this operation result, wherein, the function address of the run-time error in operation result can be one or more.It should be noted that, when the function address of the run-time error in operation result is multiple, those skilled in the art can select one of them address as the first address based on certain selection strategy.
Obtain the first address by the operation result of the first process, the function address of run-time error can be followed the trail of one by one, the reason of examination generation software crash, thus with a definite target in view software is improved.
Further, described end-point addresses is first address or the tail address of address realm.
Particularly, in the step 103 of Fig. 1 embodiment, exemplarily according to the first address calculated address side-play amount of the first address realm, and in step 105 accordingly according to first address and second address of address offset amount calculating target function in the second process of the second address realm.
More specifically, the tail address computation address offset amount of the first address realm can also be adopted, and accordingly according to tail address and second address of address offset amount calculating target function in the second process of the second address realm.
End-point addresses both can be the first address of address realm, also can be or tail address.It will be appreciated by persons skilled in the art that so second address of objective function in the second process must be determine according to the first address of the second address realm if address offset amount determines according to the first address of the first address realm; If address offset amount determines according to the tail address of the first address realm, so second address of objective function in the second process must be determine according to the tail address of the second address realm.
This mode determining address side-play amount is more flexible, and those skilled in the art can be arranged according to actual needs.
Fig. 2 is the structural representation of objective function locating device embodiment one of the present invention.As shown in Figure 2, the present embodiment objective function locating device can comprise: the first determination module 201, second determination module 202, the 3rd determination module 203, the 4th determination module 204 and the 5th determination module 205.
Wherein, the first determination module 201, after being disposed in the first process, determines objective function to be tracked the first address in described first process.
Second determination module 202, loads list for the kinematic function storehouse according to described first address and described first process, determines the function library at described objective function place.
3rd determination module 203, for the first address realm according to described function library, determines the address offset amount of described first address relative to the end-point addresses of described first address realm.
4th determination module 204, in the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library.
5th determination module 205, for according to the end-point addresses of described second address realm and described address offset amount, determines second address of described objective function in described second process.
The objective function locating device of the present embodiment, may be used for the technical scheme performing embodiment of the method shown in Fig. 1, it realizes principle and technique effect is similar, repeats no more herein.
Further, described first determination module 201, specifically for:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
Further, described end-point addresses is first address or the tail address of address realm.
Fig. 3 is the structural representation of objective function locating device embodiment two of the present invention.As shown in Figure 3, the device that the present embodiment provides can be arranged in computing machine, also can be computing machine itself, and this device can comprise at least one processor 310, such as CPU, storer 320, at least one communication bus 330 and operating system 340.Communication bus 330 is for realizing the connection communication between element.Storer 320 may comprise high-speed RAM storer, still may comprise nonvolatile memory (non-volatilememory), such as at least one magnetic disk memory.Operating system 340, comprises various program, for realizing various basic business and processing hardware based task.
Concrete, processor 310, after being disposed in the first process, determines objective function to be tracked the first address in described first process; Kinematic function storehouse according to described first address and described first process loads list, determines the function library at described objective function place; According to the first address realm of described function library, determine the address offset amount of described first address relative to the end-point addresses of described first address realm; In the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library; According to end-point addresses and the described address offset amount of described second address realm, determine second address of described objective function in described second process.
The objective function positioning equipment of the present embodiment, may be used for the technical scheme performing embodiment of the method shown in Fig. 1, it realizes principle and technique effect is similar, repeats no more herein.
Further, processor 310, specifically for:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
Further, described end-point addresses is first address or the tail address of address realm.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (6)

1. an objective function localization method, is characterized in that, comprising:
After the first process is disposed, determine objective function to be tracked the first address in described first process;
Kinematic function storehouse according to described first address and described first process loads list, determines the function library at described objective function place;
According to the first address realm of described function library, determine the address offset amount of described first address relative to the end-point addresses of described first address realm;
In the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library;
According to end-point addresses and the described address offset amount of described second address realm, determine second address of described objective function in described second process.
2. method according to claim 1, is characterized in that, describedly determines objective function to be tracked the first address in described first process, comprising:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
3. method according to claim 1 and 2, is characterized in that, described end-point addresses is first address or the tail address of address realm.
4. an objective function locating device, is characterized in that, comprising:
First determination module, after being disposed in the first process, determines objective function to be tracked the first address in described first process;
Second determination module, loads list for the kinematic function storehouse according to described first address and described first process, determines the function library at described objective function place;
3rd determination module, for the first address realm according to described function library, determines the address offset amount of described first address relative to the end-point addresses of described first address realm;
4th determination module, in the process of process second process, the kinematic function storehouse according to described second process loads list, determines the second address realm of described function library;
5th determination module, for according to the end-point addresses of described second address realm and described address offset amount, determines second address of described objective function in described second process.
5. device according to claim 4, is characterized in that, described first determination module, specifically for:
Obtain the operation result of the first process, comprise the function address of run-time error in described operation result, described function address is first address of objective function in described first process to be tracked.
6. the device according to claim 4 or 5, is characterized in that, described end-point addresses is first address or the tail address of address realm.
CN201410231453.5A 2014-05-28 2014-05-28 Objective function localization method and device Active CN105224346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410231453.5A CN105224346B (en) 2014-05-28 2014-05-28 Objective function localization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410231453.5A CN105224346B (en) 2014-05-28 2014-05-28 Objective function localization method and device

Publications (2)

Publication Number Publication Date
CN105224346A true CN105224346A (en) 2016-01-06
CN105224346B CN105224346B (en) 2019-11-29

Family

ID=54993342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410231453.5A Active CN105224346B (en) 2014-05-28 2014-05-28 Objective function localization method and device

Country Status (1)

Country Link
CN (1) CN105224346B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018086313A1 (en) * 2016-11-10 2018-05-17 华为技术有限公司 Method for acquiring address of function, and electronic device
CN108073489A (en) * 2016-11-15 2018-05-25 丰田自动车株式会社 Ensure the method for the operation of calculator

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126397A1 (en) * 2001-06-28 2003-07-03 Stephan Junge Configurable addressing apparatus
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN101261603A (en) * 2008-04-09 2008-09-10 中兴通讯股份有限公司 Fault locating method and device
CN102598621A (en) * 2009-10-27 2012-07-18 摩托罗拉解决方案公司 Method for providing security associations for encrypted packet data
WO2013050892A1 (en) * 2011-10-03 2013-04-11 International Business Machines Corporation Compiling code for enhanced application binary interface (abi) with decode time instruction optimization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126397A1 (en) * 2001-06-28 2003-07-03 Stephan Junge Configurable addressing apparatus
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN101261603A (en) * 2008-04-09 2008-09-10 中兴通讯股份有限公司 Fault locating method and device
CN102598621A (en) * 2009-10-27 2012-07-18 摩托罗拉解决方案公司 Method for providing security associations for encrypted packet data
WO2013050892A1 (en) * 2011-10-03 2013-04-11 International Business Machines Corporation Compiling code for enhanced application binary interface (abi) with decode time instruction optimization

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018086313A1 (en) * 2016-11-10 2018-05-17 华为技术有限公司 Method for acquiring address of function, and electronic device
CN108073489A (en) * 2016-11-15 2018-05-25 丰田自动车株式会社 Ensure the method for the operation of calculator

Also Published As

Publication number Publication date
CN105224346B (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US20170220393A1 (en) Autonomous dynamic optimization of platform resources
CN103064795B (en) A kind of control method of memory device and relevant apparatus
US20150234700A1 (en) System Level Memory Leak Detection
US10120731B2 (en) Techniques for controlling use of locks
US20170168886A1 (en) Resource Leak Detection Method, Apparatus, and System
US20150268993A1 (en) Method for Exploiting Parallelism in Nested Parallel Patterns in Task-based Systems
US20130054860A1 (en) Optimistic interrupt affinity for devices
CN103064796A (en) Virtual machine memory sharing method and computer system
CN105335309A (en) Data transmission method and computer
US20140218377A1 (en) Graphics processing unit expansion card and method for expanding and registering graphics processing units
CN105224346A (en) Objective function localization method and device
CN111694508A (en) Method and system for managing LBA overlap checks in NVMe based SSDs
CN110704325A (en) Data processing method and device, computer storage medium and electronic equipment
CN104133763A (en) Program debugging system and program debugging method
KR20160113143A (en) Hardware acceleration for inline caches in dynamic languages
US20120124429A1 (en) Apparatus and method for tracing memory access information
CN103019944A (en) Device and method for testing based on code injection mode
EP3097478A1 (en) Hardware acceleration for inline caches in dynamic languages
US9256398B2 (en) Device and method of increasing dynamically-typed software efficiency
CN103593606A (en) Contextual information managing method and system
CN103235745A (en) Address conflict detection method and device
US9396044B2 (en) Memory efficient thread-level speculation
CN116324717A (en) Register compaction with early release
CN105117167A (en) Information processing method and apparatus and electronic device
CN105138406A (en) Task processing method, task processing device and task processing system

Legal Events

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