[go: up one dir, main page]

CN103513995A - Control method and electronic equipment - Google Patents

Control method and electronic equipment Download PDF

Info

Publication number
CN103513995A
CN103513995A CN201210206420.6A CN201210206420A CN103513995A CN 103513995 A CN103513995 A CN 103513995A CN 201210206420 A CN201210206420 A CN 201210206420A CN 103513995 A CN103513995 A CN 103513995A
Authority
CN
China
Prior art keywords
functions
reorientation
function
address
wanting
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
CN201210206420.6A
Other languages
Chinese (zh)
Other versions
CN103513995B (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201210206420.6A priority Critical patent/CN103513995B/en
Publication of CN103513995A publication Critical patent/CN103513995A/en
Application granted granted Critical
Publication of CN103513995B publication Critical patent/CN103513995B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a control method and electronic equipment. The control method is used for controlling a loader to load a program, wherein the program includes a plurality of functions. The control method includes that before the loader loads the program, a function relocation table is created, and the function relocation table comprises one or more functions needing to be relocated in the functions and the user-defined addresses of the functions needing to be relocated; the loader loads the program according to the function relocation table so that one or more functions needing to be relocated are loaded to the user-defined addresses. According to the control method and electronic equipment, the relocation addresses of the functions are accurately controlled when the loader loads the program, and accordingly performance of the system is improved.

Description

Control method and electronic equipment
Technical field
The present invention relates to control method and electronic equipment.
Background technology
In current electronic equipment, operating system can load program or dynamic base with loader, and when loader loading procedure or dynamic base, loader can carry out reorientation to program or dynamic base.
Conventionally, the execution of program or dynamic base can relate to one or more dependences storehouse, and when program or dynamic base are performed, loader can load all dependence storehouses, and these are relied on to storehouses carries out reorientation.
In the prior art, each function generally includes a plurality of functions, from broadly, and dynamic base and rely on storehouse and also can be looked at as program, and comprise a plurality of functions in these storehouses.
Like this, when in operating system, during loader loading procedure, for the reorientation of function included in program, be uncontrollable to a great extent, this has just caused the problem that is difficult for the function in finder.
Summary of the invention
Therefore, for above-mentioned problems of the prior art and demand, make the present invention.
The embodiment of the present invention provides a kind of control method and electronic equipment, and it is the address to the reorientation of function in controlled loading device loading procedure process accurately, thus the performance of improved system.
According to the Yi Ge aspect of the embodiment of the present invention, a kind of control method is provided, be applied to the loading of controlled loading device to program, wherein, described program comprises a plurality of functions, and described control method comprises: before described loader loads described program, create a function relocation table, wherein, described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function; And described loader loads described program according to described function relocation table, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
In above-mentioned control method, described program is dynamic base, and comprises one or more dependences storehouse.
In above-mentioned control method, described to want the self-defined address of one or more functions of reorientation be new function address; And, the described one or more functions of reorientation of wanting are loaded into new function address corresponding to carrying out the new function corresponding with described new function address.
In above-mentioned control method, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And, by described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
In above-mentioned control method, described abnormal memory address is the memory address of lack of competence.
In above-mentioned control method, described loader loads described program in virtualization system; And described control method further comprises: after capturing one or more functions abnormal of wanting reorientation, the execution of described one or more functions is changed to host side from the virtual end-grain cutting of virtualization system.
According to the embodiment of the present invention on the other hand, provide a kind of electronic equipment, having comprised: loader, be configured under the operating system of described electronic equipment, program be loaded, described program comprises a plurality of functions; And table creating unit, was configured to before described loader loads described program, created a function relocation table, described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function; Wherein, described loader loads described program according to the function relocation table being created by described table creating unit, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
In above-mentioned electronic equipment, described program is dynamic base, and comprises one or more dependences storehouse.
In above-mentioned electronic equipment, described to want the self-defined address of one or more functions of reorientation be new function address; And described loader is loaded into new function address corresponding to carrying out the new function corresponding with described new function address by the described one or more functions of reorientation of wanting.
In above-mentioned electronic equipment, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And, described loader by described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
In above-mentioned electronic equipment, described abnormal memory address is the memory address of lack of competence.
In above-mentioned electronic equipment, described loader loads described program under the virtualization system of described operating system; And, described electronic equipment further comprises: switch unit, be configured to, after described loader captures one or more functions abnormal of wanting reorientation, the execution of described one or more functions be changed to host side from the virtual end-grain cutting of described virtualization system.
By according to the control method of the embodiment of the present invention and electronic equipment, realized the accurate control to the relocatable address of function in the process of loader loading procedure, thereby improved the performance of system.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the indicative flowchart illustrating according to the control method of the embodiment of the present invention;
Fig. 2 is the schematic block diagram illustrating according to the electronic equipment of the embodiment of the present invention.
Embodiment
Below, in connection with accompanying drawing, describe in detail according to the control method of the embodiment of the present invention and electronic equipment.
According to the Yi Ge aspect of the embodiment of the present invention, a kind of control method is provided, be applied to the loading of controlled loading device to program, wherein, described program comprises a plurality of functions, and described control method comprises: before described loader loads described program, create a function relocation table, wherein, described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function; And described loader loads described program according to described function relocation table, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
By according to the control method of the embodiment of the present invention, can be when loader loading procedure each function in finder, thereby realize the accurate location of the function in program, this function in can settlement procedure is difficult for some problems that location produces, and specifically will be described hereinafter.
Fig. 1 is the indicative flowchart illustrating according to the control method of the embodiment of the present invention.As shown in Figure 1, according to the control method of the embodiment of the present invention, be applied to the loading of controlled loading device to program, wherein, program comprises a plurality of functions, this control method comprises: S1, before loader loading procedure, creates a function relocation table, wherein, this function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in a plurality of functions; And, S2, loader carrys out loading procedure according to function relocation table, with one or more functions that will reorientation, is loaded into its self-defined address.
In the control method of the embodiment of the present invention, described program is dynamic base, and comprises one or more dependences storehouse.
Dynamic base is called again dynamic link library (DLL:Dynamic Link Library), and it is one and comprises the code that can simultaneously be used by a plurality of programs and the storehouse of data, rather than executable file.Dynamic link provides a kind of method, make process can call the function that does not belong to its executable code, wherein, the executable code of function is arranged in a dynamic base, and this dynamic base comprises and is one or morely compiled, links and separate with the process of using them function of storing.Dynamic base also contributes to share data and resource, and a plurality of application programs are the content of single dynamic base copy in access memory simultaneously.
As mentioned above, dynamic base and dependence storehouse can be regarded program as, and comprise therein a plurality of functions, when loader loads dynamic base and relies on storehouse, equally also can carry out reorientation for function wherein.Because this reorientation cannot be controlled by operating system to a great extent, the therefore address of control function after reorientation accurately, and under some applied environment, may need again to locate the function in storehouse, this has just caused some inconvenience.
In the control method of the embodiment of the present invention, described to want the self-defined address of one or more functions of reorientation be new function address; And, the described one or more functions of reorientation of wanting are loaded into new function address corresponding to carrying out the new function corresponding with described new function address.
As mentioned above, if the function locating comprising in storehouse is arrived to new function address, loader is for the loading of the function in storehouse just corresponding to carrying out function corresponding to function address new with this so, and in fact this can define the execution to the function in storehouse, thereby realize the function of user's expectation.Because in physical memory, the function address corresponding with new function is known, by the function being loaded by loader being reoriented to this new function address according to the control method of the embodiment of the present invention, just can carry out the function that this new function has, this has improved the functional of operating system to a great extent, thereby has strengthened the performance of system.
In the control method of the embodiment of the present invention, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And, by described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
In the control method of the embodiment of the present invention, described abnormal memory address is the memory address of lack of competence.
In the control method of the embodiment of the present invention, described loader loads described program in virtualization system; And described control method further comprises: after capturing one or more functions abnormal of wanting reorientation, the execution of described one or more functions is changed to host side from the virtual end-grain cutting of virtualization system.
In operating system, sometimes need deliberately to catch function abnormal of reorientation, so that carrying out some users specifically operates, for example, by catching the abnormal of function, when loader is in virtualization system during loading procedure, can be so that the execution of this function be changed to host side from the virtual end-grain cutting of virtualization system.In current operation system, host side has the handling property stronger than virtual end conventionally.For example, with image, be treated to example, host side can be carried out hardware-accelerated with graph processing chips, come virtual end only can carry out software acceleration with PaintShop, like this, for image, process, obviously in host side, can realize more superior handling property.Therefore, for some function, possible its carry out to need stronger handling property, this just need to be by the execution of this function the virtual end-grain cutting from virtualization system change to host side and carry out.But, in the ordinary course of things, owing to cannot capturing this function that needs hand-off process, cannot carry out above-mentioned switching, and pass through according to the control method of the embodiment of the present invention, by the function that loader is loaded, be reoriented to abnormal memory address, can capture the abnormal of reorientation function afterwards, make the execution of switching function become possibility.
In these cases, abnormal memory address can be user's preassigned one section of memory address in actual physical address, and this section of memory address can be identified by operating system.For example, this section of memory address that memory address can be lack of competence here, for example, without read right or without write permission, or without access limit, like this, when function is relocated to this section of physical address, operating system just will detect extremely.Such as, if this section of physical address without write permission, the function that loader loads so cannot be written to this section of physical memory, thus operating system identifies extremely.Or this section of physical memory addresses can have corresponding sign, to be identified by operating system or user.Here, it will be appreciated by those skilled in the art that, according in the control method of the embodiment of the present invention, abnormal memory address might not mean that this section of memory address has mistake, but for catching the function that is reoriented to this section of memory address, therefore, only need by some, to identify to identify the function that is reoriented to these addresses by operating system or user.
As mentioned above, in the process of loader loading procedure, may need some function in program to be reoriented to the function that some enhancement mode of system are realized in accurate self-defined address.Here, it will be understood by those skilled in the art that it is to set according to the real needs of system which function is reoriented to self-defining address, do not need locating accurately without the function of special purposes.Therefore, according in the control method of the embodiment of the present invention, in the function relocation table creating, only comprise and in all functions that comprise in program, need to carry out the function of reorientation and the self-defined address that these function locatings need to be arrived, for example, the above-mentioned function that need to carry out as new function or need to capture its abnormal function.Here, the function relocation table of this establishment is to create with the readable form of loader, thereby when loader loading procedure, can the function of needs be loaded into the concrete place, self-defined address limiting in table according to this function relocation table.
According to the embodiment of the present invention on the other hand, provide a kind of electronic equipment, having comprised: loader, be configured under the operating system of described electronic equipment, program be loaded, described program comprises a plurality of functions; And table creating unit, was configured to before described loader loads described program, created a function relocation table, described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function; Wherein, described loader loads described program according to the function relocation table being created by described table creating unit, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
Fig. 2 is the schematic block diagram illustrating according to the electronic equipment of the embodiment of the present invention.As shown in Figure 2, electronic equipment 100 comprises: loader 101, be configured under the operating system of electronic equipment 100, program be loaded, and this program comprises a plurality of functions; And table creating unit 102, is configured to, before loader 101 loading procedures, create a function relocation table, this function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in the plurality of function; Wherein, loader 101 is according to the function relocation table loading procedure being created by table creating unit 102, with one or more functions that will reorientation, is loaded into its self-defined address.
In above-mentioned electronic equipment, described program is dynamic base, and comprises one or more dependences storehouse.
In above-mentioned electronic equipment, described to want the self-defined address of one or more functions of reorientation be new function address; And described loader is loaded into new function address corresponding to carrying out the new function corresponding with described new function address by the described one or more functions of reorientation of wanting.
In above-mentioned electronic equipment, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And, described loader by described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
In above-mentioned electronic equipment, described abnormal memory address is the memory address of lack of competence.
In above-mentioned electronic equipment, described loader loads described program under the virtualization system of described operating system; And, described electronic equipment further comprises: switch unit, be configured to, after described loader captures one or more functions abnormal of wanting reorientation, the execution of described one or more functions be changed to host side from the virtual end-grain cutting of described virtualization system.
Therefore here, according to other details of the electronic equipment of the embodiment of the present invention, with identical about the details in the description of doing according to the control method of the embodiment of the present invention before, will repeat no more for fear of repeating.It will be understood by those skilled in the art that above-mentioned electronic equipment can be to have any electronic equipment that carrys out the operating system of loading procedure with loader, and be not limited to computer system.
And, although in the above description, the built-in function of mainly take is described as example, but it will be appreciated by those skilled in the art that, according to the control method of the embodiment of the present invention and electronic equipment, can be applied to the loading of loader to random procedure, to strengthen system performance, the embodiment of the present invention is not intended to this to limit arbitrarily.
By according to the control method of the embodiment of the present invention and electronic equipment, realized the accurate control to the relocatable address of function in the process of loader loading procedure, thereby improved the performance of system.
The present invention has been described in detail with reference to specific embodiment.Yet clearly, in the situation that not deviating from spirit of the present invention, those skilled in the art can carry out change and replace embodiment.In other words, the present invention is open by the form of explanation, rather than is limited to explain.Judge main idea of the present invention, should consider appended claim.

Claims (12)

1. a control method, is applied to the loading of controlled loading device to program, and wherein, described program comprises a plurality of functions, and described control method comprises:
Before described loader loads described program, create a function relocation table, wherein, described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function; And
Described loader loads described program according to described function relocation table, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
2. control method as claimed in claim 1, wherein, described program is dynamic base, and comprises one or more dependences storehouse.
3. control method as claimed in claim 1, wherein, described to want the self-defined address of one or more functions of reorientation be new function address; And
The described one or more functions of reorientation of wanting are loaded into new function address corresponding to carrying out the new function corresponding with described new function address.
4. control method as claimed in claim 1, wherein, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And
By described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
5. control method as claimed in claim 4, wherein, described abnormal memory address is the memory address of lack of competence.
6. control method as claimed in claim 4, wherein, described loader loads described program in virtualization system; And
Described control method further comprises:
After capturing one or more functions abnormal of wanting reorientation, the execution of described one or more functions is changed to host side from the virtual end-grain cutting of virtualization system.
7. an electronic equipment, comprising:
Loader, is configured under the operating system of described electronic equipment, program be loaded, and described program comprises a plurality of functions; And
Table creating unit, was configured to before described loader loads described program, created a function relocation table, and described function relocation table comprises one or more functions of wanting reorientation and the self-defined address thereof in described a plurality of function;
Wherein, described loader loads described program according to the function relocation table being created by described table creating unit, so that the described one or more functions of reorientation of wanting are loaded into its self-defined address.
8. electronic equipment as claimed in claim 7, wherein, described program is dynamic base, and comprises one or more dependences storehouse.
9. electronic equipment as claimed in claim 7, wherein, described to want the self-defined address of one or more functions of reorientation be new function address; And
Described loader is loaded into new function address corresponding to carrying out the new function corresponding with described new function address by the described one or more functions of reorientation of wanting.
10. electronic equipment as claimed in claim 7, wherein, described to want the self-defined address of one or more functions of reorientation be abnormal memory address; And
Described loader by described one or more functions of wanting reorientation be loaded into abnormal memory address corresponding to catch described one or more functions of wanting reorientation extremely.
11. electronic equipments as claimed in claim 10, wherein, described abnormal memory address is the memory address of lack of competence.
12. electronic equipments as claimed in claim 10, wherein, described loader loads described program under the virtualization system of described operating system; And
Described electronic equipment further comprises:
Switch unit, is configured to, after described loader captures one or more functions abnormal of wanting reorientation, the execution of described one or more functions be changed to host side from the virtual end-grain cutting of described virtualization system.
CN201210206420.6A 2012-06-18 2012-06-18 Control method and electronic equipment Active CN103513995B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210206420.6A CN103513995B (en) 2012-06-18 2012-06-18 Control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210206420.6A CN103513995B (en) 2012-06-18 2012-06-18 Control method and electronic equipment

Publications (2)

Publication Number Publication Date
CN103513995A true CN103513995A (en) 2014-01-15
CN103513995B CN103513995B (en) 2016-09-28

Family

ID=49896778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210206420.6A Active CN103513995B (en) 2012-06-18 2012-06-18 Control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN103513995B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085514A (en) * 2017-03-06 2017-08-22 北京安博通科技股份有限公司 Shared library upgrade method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5542059A (en) * 1994-01-11 1996-07-30 Exponential Technology, Inc. Dual instruction set processor having a pipeline with a pipestage functional unit that is relocatable in time and sequence order
US6687899B1 (en) * 1999-09-03 2004-02-03 Stmicroelectronics Limited Relocation format for linking
CN101504656A (en) * 2009-03-26 2009-08-12 成都磐石软件有限责任公司 Combined execution method for PE document code
CN101799763A (en) * 2009-02-10 2010-08-11 华为技术有限公司 Method, device and system for patching kernel on line
CN102073529A (en) * 2011-01-30 2011-05-25 华为技术有限公司 Method and computer system for upgrading super kernel component

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5542059A (en) * 1994-01-11 1996-07-30 Exponential Technology, Inc. Dual instruction set processor having a pipeline with a pipestage functional unit that is relocatable in time and sequence order
US6687899B1 (en) * 1999-09-03 2004-02-03 Stmicroelectronics Limited Relocation format for linking
CN101799763A (en) * 2009-02-10 2010-08-11 华为技术有限公司 Method, device and system for patching kernel on line
CN101504656A (en) * 2009-03-26 2009-08-12 成都磐石软件有限责任公司 Combined execution method for PE document code
CN102073529A (en) * 2011-01-30 2011-05-25 华为技术有限公司 Method and computer system for upgrading super kernel component

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭玉东等: "《Linux原理与结构》", 31 March 2012, 西安电子科技大学出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085514A (en) * 2017-03-06 2017-08-22 北京安博通科技股份有限公司 Shared library upgrade method and device

Also Published As

Publication number Publication date
CN103513995B (en) 2016-09-28

Similar Documents

Publication Publication Date Title
CN103559446B (en) Dynamic virus detection method and device for equipment based on Android system
EP3660673A1 (en) Updating software components
US9015834B2 (en) Mitigating just-in-time spraying attacks in a network environment
CN104978261A (en) Test method, device and system of application program
CN103547997A (en) Processor mode locking
CN104333863A (en) Connection management method, device and electronic equipment
US20180060579A1 (en) Detecting Malware by Monitoring Execution of a Configured Process
EP3009935B1 (en) System and method of transfer of control between memory locations
CN110750793B (en) Vulnerability scanning method and device
CN104298602A (en) Method and device for debugging application program
CN103257881A (en) Plug-in operation method based on browser, browser device and terminal
CN107122656B (en) Method and device for preventing external debugging through self-debugging
EP3163453B1 (en) Securing an application by randomizing its memory layout at launch time
US11036852B2 (en) System and method for software diversification
CN103513995A (en) Control method and electronic equipment
CN102750493B (en) Access right control method, Apparatus and system
CN106022117A (en) Method and device for preventing system environment variable from being modified and electronic equipment
US20150381644A1 (en) Apparatus and method for preventing malicious code in electronic device
KR102028704B1 (en) Method for Protecting Memory Against Code Insertion Attacks in Electronic Device
CN105279164A (en) File processing method and device based on IOS system
CN104144076B (en) A kind of flow process error control method, device and system
US10528737B2 (en) Randomized heap allocation
CN105956462B (en) A kind of method, apparatus and electronic equipment preventing malicious loading driving
CN105204903A (en) Process module loading interception method and device
CN105824682A (en) Virtual machine monitoring method, apparatus and 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
C14 Grant of patent or utility model
GR01 Patent grant