CN108460276A - A kind for the treatment of method and apparatus of the dynamic link library SO files of Android installation kit - Google Patents

A kind for the treatment of method and apparatus of the dynamic link library SO files of Android installation kit Download PDF

Info

Publication number
CN108460276A
CN108460276A CN201611129917.7A CN201611129917A CN108460276A CN 108460276 A CN108460276 A CN 108460276A CN 201611129917 A CN201611129917 A CN 201611129917A CN 108460276 A CN108460276 A CN 108460276A
Authority
CN
China
Prior art keywords
files
specified section
original
data information
reinforcing
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
CN201611129917.7A
Other languages
Chinese (zh)
Other versions
CN108460276B (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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201611129917.7A priority Critical patent/CN108460276B/en
Publication of CN108460276A publication Critical patent/CN108460276A/en
Application granted granted Critical
Publication of CN108460276B publication Critical patent/CN108460276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind for the treatment of method and apparatus of the dynamic link library SO files of Android installation kit.Wherein, pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, and this method includes:Obtain the data information stored in the specified section of original SO files;With the data information got, replace the data information that the specified section stores in the SO files of reinforcing in corresponding specified section, so that Android system stored in the specified section for obtaining the SO files of the reinforcing data information when, be directly obtained the data information stored in corresponding specified section in former SO files.The technical solution avoids the mistake generated because the data information stored in the specified section in the SO files of reinforcing is not the data information of Android system actual needs on the basis of the safety for the SO files for ensureing to reinforce, efficient and stable.

Description

A kind for the treatment of method and apparatus of the dynamic link library SO files of Android installation kit
Technical field
The present invention relates to field of computer technology, and in particular to a kind of place of the dynamic link library SO files of Android installation kit Manage method and apparatus.
Background technology
In order to avoid Android installation kit is cracked, need it is whole to Android installation kit, or in which some files at Reason.It is a kind of more typical processing mode to the dynamic link library SO files of Android installation kit reinforce, but this also brings Some problems, for example, the structure of SO files includes multiple code segments (section), after being reinforced to SO files, Android system is not It can be directly obtained the data information stored in these sections, easy to produce mistake.
Invention content
In view of the above problems, it is proposed that the present invention overcoming the above problem in order to provide one kind or solves at least partly State the treating method and apparatus of the dynamic link library SO files of the Android installation kit of problem.
One side according to the present invention provides a kind of processing side of the dynamic link library SO files of Android installation kit Method, wherein pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, and this method includes:
Obtain the data information stored in the specified section of original SO files;
With the data information got, the number that the specified section stores in the SO files of reinforcing in corresponding specified section is replaced It is believed that breath so that Android system stored in the specified section for obtaining the SO files of the reinforcing data information when, directly acquire To the data information stored in corresponding specified section in former SO files.
Optionally, the data information that stores includes in the specified section for obtaining original SO files:
When the original SO files are loaded into the memory of Android system, stored in the specified section of acquisition original SO files Data information.
Optionally, the data information that stores includes in the specified section for obtaining original SO files:
Obtain the initial fictive address of the specified section of original SO files;
According to the initial fictive address of the specified section of the original SO files, obtains and stored in the specified section of the original SO files Data information.
Optionally, the virtual address of the specified section for obtaining original SO files includes:
Parse the dynamic sections of original SO files;
Go out from the dynamic segment searches Elf32_Dyn corresponding with the original specified section of SO files;
The value that d_ptr is read from Elf32_Dyn corresponding with the original specified section of SO files, as described The initial fictive address of the specified section of former SO files.
Optionally, the type phase of the specified section and its corresponding specified section in the SO files of reinforcing of the original SO files Together.
Optionally, corresponding specified section in the SO files of reinforcing is the specified section of the original SO files with it .dynstr it saves;
And/or
Corresponding specified section in the SO files of reinforcing is .dynsym sections to the specified section of the original SO files with it;
And/or
Corresponding specified section in the SO files of reinforcing is .hash sections to the specified section of the original SO files with it.
Another aspect according to the present invention provides the processing side of the dynamic link library SO files of another Android installation kit Method, including:
Shell, the SO files reinforced are increased to the former SO files of Android installation kit;
The processing logic of the SO files progress to the reinforcing is written in the housing, the processing logic is for executing Method as described in any one of the above embodiments.
Optionally, the former SO files increase shell to Android installation kit includes:
The original SO files are converted into binary form, the former SO files of obtained binary form are added to described In shell.
Optionally, this method further includes:
The memory load logic of the original SO files is written in the initial code of the SO files of the reinforcing, so that peace The original SO files, according to the memory load logic, are loaded into memory by tall and erect system when loading the SO files of the reinforcing In.
Optionally, this method further includes:
In the initial code of the SO files of the reinforcing, at least one of SO files of the reinforcing are specified into letter Number is directed toward the function corresponding specified function in the original SO files, so that Android system is in the SO files for calling the reinforcing In specified function when, call original SO files in corresponding specified function.
Optionally, this method all steps take a step forward including:
Android installation kit is unpacked, at least one original SO files of Android installation kit are obtained;
The SO files of the reinforcing are bundled in corresponding Android installation kit, so that the Android installation kit is mounted Afterwards, start every time corresponding in application, loading the SO files after the reinforcing by Android system.
Another aspect according to the present invention provides a kind of processing dress of the dynamic link library SO files of Android installation kit It sets, wherein pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, which includes:
Data information acquiring unit, the data information that stores in the specified section suitable for obtaining original SO files;
Data information replacement unit replaces the specified section in the SO files of reinforcing suitable for the data information to get The data information stored in corresponding specified section, so that Android system stores in obtaining the specified section of SO files of the reinforcing Data information when, be directly obtained the data information stored in corresponding specified section in former SO files.
Optionally, the data information acquiring unit, suitable for being loaded into the memory of Android system in the original SO files When middle, the data information stored in the specified section of original SO files is obtained.
Optionally, the data information acquiring unit is suitable for obtaining the initial fictive address of the specified section of original SO files;Root According to the initial fictive address of the specified section of the original SO files, the data letter stored in the specified section of the original SO files is obtained Breath.
Optionally, the data information acquiring unit is suitable for parsing the dynamic sections of original SO files;From the dynamic Segment search goes out Elf32_Dyn corresponding with the original specified section of SO files;From corresponding with the original specified section of SO files Elf32_Dyn items in read d_ptr value, as the initial fictive address of the specified section of the original SO files.
Optionally, the type phase of the specified section and its corresponding specified section in the SO files of reinforcing of the original SO files Together.
Optionally, corresponding specified section in the SO files of reinforcing is the specified section of the original SO files with it .dynstr it saves;
And/or
Corresponding specified section in the SO files of reinforcing is .dynsym sections to the specified section of the original SO files with it;
And/or
Corresponding specified section in the SO files of reinforcing is .hash sections to the specified section of the original SO files with it.
According to the present invention in another aspect, provide the dynamic link library SO files of another Android installation kit processing dress It sets, including:
Shell adding unit is suitable for increasing shell, the SO files reinforced to the former SO files of Android installation kit;By above-mentioned Device described in one is added in the shell.
Optionally, the shell adding unit, suitable for the original SO files are converted to binary form, the binary system that will be obtained The former SO files of form are added in the shell.
Optionally, the shell adding unit is further adapted for that the original is written in the initial code of the SO files of the reinforcing The memory load logic of SO files, so that Android system when loading the SO files of the reinforcing, is patrolled according to memory load Volume, the original SO files are loaded into memory.
Optionally, which further includes:
The shell adding unit is further adapted in the initial code of the SO files of the reinforcing, by the SO texts of the reinforcing At least one of part specified function is directed toward the function corresponding specified function in the original SO files, so that Android system exists When calling the specified function in the SO files of the reinforcing, corresponding specified function in original SO files is called.
Optionally, which further includes:
Unwrapper unit obtains at least one original SO files of Android installation kit suitable for being unpacked to Android installation kit;
Packaged unit, suitable for the SO files of the reinforcing to be bundled in corresponding Android installation kit, so that the Android After installation kit is mounted, start every time corresponding in application, loading the SO files after the reinforcing by Android system.
It can be seen from the above, technical scheme of the present invention, the data that are stored in the specified section using the former SO files got Information replaces the data information that the specified section stores in the SO files of reinforcing in corresponding specified section, so that Android system exists When obtaining the data information stored in the specified section of the SO files of the reinforcing, what is actually got is corresponding in former SO files The data information stored in specified section.The technical solution avoids on the basis of the safety for the SO files for ensureing to reinforce because adding Solid SO files in specified section in the data information that stores be not the data information of Android system actual needs and the mistake that generates Accidentally, efficient and stable.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention, And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of processing of the dynamic link library SO files of Android installation kit according to an embodiment of the invention The flow diagram of method;
Fig. 2 shows the places of the dynamic link library SO files of another Android installation kit according to an embodiment of the invention The flow diagram of reason method;
Fig. 3 shows a kind of processing of the dynamic link library SO files of Android installation kit according to an embodiment of the invention The structural schematic diagram of device;
Fig. 4 shows the place of the dynamic link library SO files of another Android installation kit according to an embodiment of the invention Manage the structural schematic diagram of device.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Fig. 1 shows a kind of processing of the dynamic link library SO files of Android installation kit according to an embodiment of the invention The flow diagram of method, wherein pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, such as Shown in Fig. 1, this method includes:
Step S110 obtains the data information stored in the specified section of original SO files.
Step S120 replaces specified section corresponding specified section in the SO files of reinforcing with the data information got The data information of middle storage so that Android system obtain reinforce SO files specified section in store data information when, directly Obtain the data information got and stored in corresponding specified section in former SO files.
As it can be seen that method shown in FIG. 1, the data information stored in the specified section using the former SO files got is replaced The data information that the specified section stores in the SO files of reinforcing in corresponding specified section, so that Android system is obtaining reinforcing When the data information stored in the specified section of SO files, stored in corresponding specified section in the former SO files actually got Data information.The technical solution avoids on the basis of the safety for the SO files for ensureing to reinforce in the SO files because of reinforcing The data information stored in specified section is not the data information that Android system is actually needed and the mistake generated, efficient and steady It is fixed.
In one embodiment of the invention, in method shown in FIG. 1, the number stored in the specified section of original SO files is obtained It is believed that breath includes:When former SO files are loaded into the memory of Android system, stored in the specified section of acquisition original SO files Data information.
After former SO files are loaded, the data information stored in the specified section of former SO files can be acquired , accordingly even when directly being cracked to the SO files of reinforcing, it is also difficult to get the number stored in the specified section of former SO files It is believed that breath, ensure that the safety of data information.
In one embodiment of the invention, in the above method, the data letter stored in the specified section of original SO files is obtained Breath includes:Obtain the initial fictive address of the specified section of original SO files;According to the initial fictive address of the specified section of former SO files, Obtain the data information stored in the specified section of original SO files.
Get the initial fictive address of the specified section of former SO files, so that it may to navigate to where the data information of storage Region therefrom obtains corresponding data, specifically, in one embodiment of the invention, in the above method, obtains original SO files The virtual address of specified section include:Parse the dynamic sections of original SO files;Go out and original SO files from dynamic segment searches Specified section is Elf32_Dyn corresponding;The value of d_ptr is read from Elf32_Dyn corresponding with the former specified section of SO files, As the initial fictive address of the specified section of former SO files.
It first introduces herein, SO files are ELF file formats, and structure can be divided into multiple code segments (section), below Give the example of the common section of some in ELF:
.text it saves, is used for the instruction sequence of save routine;
.data&.rodata it saves, for preserving the global static variable being initialized and local static variable;
.bss it saves, the global variable for storing no initializtion and local static variable
.rodata it saves, for storing read-only data, such as character string constant, overall situation const variables;
.debug it saves, for storing Debugging message;
.dynamic it saves, for storing dynamic link information;
.hash it saves, symbol Hash table;
.line it saves, line number table, i.e., the corresponding table instructed after source code line number and compiling;
.note it saves, for storing additional compiler information.Such as company name, the released version number etc. of program;
.strtab it saves, string table, for storing the various character strings used in ELF files
.symtab it saves, symbol table;
.shstrtab it saves, section famous-brand clock;
.plt it saves, the jump list of dynamic link
.got it saves, the global entrance of dynamic link;
.init it saves, program initialization section;
.fini it saves, program termination code segment.
Dynamic sections of topology example is shown below:
It can be seen that dynamic sections are the arrays for including above structure.Wherein, d_tag controls the explanation meaning of d_un, tool Body meaning can be interpreted d_val or d_ptr;Wherein, d_val is meant:This Elf32_Word object indicates an integer value, Specifically can there are many explain.D_ptr is meant:This Elf32_Addr object represents the virtual address of program.
As it was noted above, having multiple sections in SO files, wherein mostly several sections of have corresponding Elf32_ in dynamic sections Dyn.That is, the value for reading d_ptr from Elf32_Dyn corresponding with specified section is exactly the initial fictive of specified section Address.
In one embodiment of the invention, in the above method, the specified section of former SO files with its reinforcing SO files In corresponding specified section type it is identical, specifically:The specified section of former SO files corresponding finger in the SO files of reinforcing with it Fixed section is .dynstr sections;And/or corresponding specified section in the SO files of reinforcing is the specified section of former SO files with it .dynsym it saves;And/or corresponding specified section in the SO files of reinforcing is .hash sections to the specified section of former SO files with it.
The example that specified section is .dynstr sections .dynsym sections and .hash sections is given in the present embodiment.If other SO files need to call the export function in original SO files, it is necessary to learn the ground of export function in memory in former SO files Location.And Android system exports the address of function in memory often by the above-mentioned section searched in original SO files to calculate. Therefore, if Android system it is practical get be reinforce after SO files in .dynstr section .dynsym section and .hash section In data information, last calculated address is necessarily wrong, other SO files can not just correctly call the SO in this way Export function in file.
Fig. 2 shows the places of the dynamic link library SO files of another Android installation kit according to an embodiment of the invention The flow diagram of reason method, as shown in Fig. 2, this method includes:
Step S210 increases shell, the SO files reinforced to the former SO files of Android installation kit.
The processing logic of the SO files progress to reinforcing is written in step S220 in the shell, and processing logic is for executing such as Method in any of the above-described embodiment.
The former SO files of Android installation kit are handled in the present embodiment, are either to reinforce rank in the development phase Section, that is, to operation that file itself carries out.And in previous embodiment, it is to be pacified in the corresponding application program of Android installation kit After dress, when starting application program, the operation to the data progress in memory.
In one embodiment of the invention, in method shown in Fig. 2, shell is increased to the former SO files of Android installation kit Including:Former SO files are converted into binary form, the former SO files of obtained binary form are added in shell.
During being reinforced to SO files, it can also be related to the encryption to function, addition decryption logic etc. in other Hold, due to not being the emphasis of the present invention, does not do excessive introduction herein.In the present embodiment, SO files are converted into binary system shape Formula is added in shell (such as write-in .data sections), forms the SO files of reinforcing.
In one embodiment of the invention, method shown in Fig. 2 further includes:In the initial code of the SO files of reinforcing The memory load logic of middle write-in original SO files, so that Android system in the SO files that load is reinforced, is patrolled according to memory load Volume, former SO files are loaded into memory.
When due to not reinforced to SO files, SO files can be loaded by Android system, but be added to SO files Gu after, Android system just can not directly operate original SO files.Initial code is utilized in SO in the present embodiment The characteristics of file can be with automatic running in load so that Android system can directly run original in the SO files that load is reinforced The memory load logic of SO files does not need system and is directly grasped to former SO files to realize the load of former SO files Make, it is simple and convenient.
In one embodiment of the invention, method shown in Fig. 2 further includes:In the initial code of the SO files of reinforcing In, at least one of the SO files of reinforcing specified function is directed toward the function corresponding specified function in former SO files, with Make Android system in the specified function in calling the SO files reinforced, calls corresponding specified function in original SO files.
SO files are not to need Android system to utilize the cross-platform mechanism of JAVA by JAVA written in code, i.e., logical JNI (Java Native Interface, JAVA local interface) is crossed to use SO files, that is, realizes JAVA layers and local layer The communication of (Native layers).Specifically, in the case where not reinforced to SO files, JAVA layers can directly invoke SO files In JNI functions realize the use to SO files, but in the case where increasing shell to SO files, JAVA layers navigate to It is the function address of JNI functions in the SO files after reinforcing, and the not function address of original SO files, to generate collapse.
In one embodiment of the invention, in the above method, the specified function in the SO files of reinforcing and original SO files In corresponding specified function be same type function.In one embodiment, the specified function in the SO files of reinforcing and original Corresponding specified function is JNI_Onload functions in SO files.
Try lower example:Former SO files liba.so is by increasing shell, the SO files libshell.so reinforced.But It is named as liba.so since libshell.so is remained as, Android system passes through System.loadLibrary (" liba.so ") That be loaded into is actually libshell.so.When loading libshell.so, the initial code of libshell.so is run, It is just completed in this process by the load of liba.so.Android system is in the JNI_ for calling its liba.so thought When Onload functions, if do not modified to the JNI_Onload functions in libshell.so, system is actually called Be JNI_Onload functions in libshell.so.And in the present embodiment, the JNI_Onload letters in libshell.so Number has been pointed to the JNI_Onload functions in liba.so, then Android system is in the JNI_ for calling its liba.so thought When Onload functions, the JNI_Onload functions of liba.so also can be just correctly called just, will not be malfunctioned again.For Android system wishes other functions in the liba.so called, can also carry out similar processing.
In one embodiment of the invention, method shown in Fig. 2 all steps take a step forward including:Android is installed Packet is unpacked, and at least one original SO files of Android installation kit are obtained;The SO files of reinforcing are bundled to corresponding Android peace In dress packet, so that after Android installation kit is mounted, start every time corresponding in application, by the SO texts after Android system load reinforcing Part.
In the above-described embodiments due to having carried out consolidation process to former SO files, also need itself and Android installation kit further Alternative document, such as Android resource file, Android configuration file etc. be packaged as complete Android installation kit together.Wherein, SO File, Android resource file etc. can be that developer provides respectively, such as inside a development teams, by different projects Group provides different classes of file, finally by secure group SO files is encrypted and the packing of all files;It can also be by special Door security service provider unpacking processing is carried out to the unguyed Android installation kit that developer provides, to SO files therein into Row re-starts packing after reinforcing.Android system load reinforce after SO files can be by Linker (Android system it is dynamic State library loader) come what is loaded.
Fig. 3 shows a kind of processing of the dynamic link library SO files of Android installation kit according to an embodiment of the invention The structural schematic diagram of device, wherein pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, such as Shown in Fig. 3, the processing unit 300 of the dynamic link library SO files of Android installation kit includes:
Data information acquiring unit 310, the data information that stores in the specified section suitable for obtaining original SO files.
Data information replacement unit 320 replaces the specified SO files saved in reinforcing suitable for the data information to get In the data information that stores in corresponding specified section so that Android system stored in the specified section for obtaining the SO files reinforced When data information, it is directly obtained the data information stored in corresponding specified section in former SO files.
As it can be seen that device shown in Fig. 3, the data information stored in the specified section using the former SO files got is replaced The data information that the specified section stores in the SO files of reinforcing in corresponding specified section, so that Android system is obtaining reinforcing When the data information stored in the specified section of SO files, stored in corresponding specified section in the former SO files actually got Data information.The technical solution avoids on the basis of the safety for the SO files for ensureing to reinforce in the SO files because of reinforcing The data information stored in specified section is not the data information that Android system is actually needed and the mistake generated, efficient and steady It is fixed.
In one embodiment of the invention, in above-mentioned apparatus, data information acquiring unit 310 is suitable in former SO files When being loaded into the memory of Android system, the data information stored in the specified section of original SO files is obtained.
In one embodiment of the invention, in above-mentioned apparatus, data information acquiring unit 310 is suitable for obtaining original SO texts The initial fictive address of the specified section of part;According to the initial fictive address of the specified section of former SO files, the finger of original SO files is obtained The data information stored in fixed section.
In one embodiment of the invention, in above-mentioned apparatus, data information acquiring unit 310 is suitable for parsing original SO texts The dynamic sections of part;Go out from dynamic segment searches Elf32_Dyn corresponding with the original specified section of SO files;From with former SO text The value that d_ptr is read during the specified section of part is Elf32_Dyn corresponding, as the initial fictive of the specified section of former SO files Address.
In one embodiment of the invention, in above-mentioned apparatus, the specified section of former SO files with its reinforcing SO files In corresponding specified section type it is identical.
In one embodiment of the invention, in above-mentioned apparatus, the specified section of former SO files with its reinforcing SO files In it is corresponding it is specified section be .dynstr section;And/or the specified section of former SO files with its in the SO files of reinforcing it is corresponding Specified section is .dynsym sections;And/or corresponding specified section in the SO files of reinforcing is equal with it for the specified section of former SO files It is saved for .hash.
Fig. 4 shows the place of the dynamic link library SO files of another Android installation kit according to an embodiment of the invention The structural schematic diagram for managing device, as shown in figure 4, the processing unit 400 of the dynamic link library SO files of Android installation kit includes:
Shell adding unit 410 is suitable for increasing shell to the former SO files of Android installation kit, the SO files reinforced, will be as The processing unit 300 of the dynamic link library SO files of Android installation kit in any of the above-described embodiment is added in shell.
The former SO files of Android installation kit are handled in the present embodiment, are either to reinforce rank in the development phase Section, that is, to operation that file itself carries out.And in aforementioned device embodiment, it is application program corresponding in Android installation kit After being mounted, when starting application program, the operation to the data progress in memory.
In one embodiment of the invention, in device shown in Fig. 4, shell adding unit 410 is suitable for converting former SO files For binary form, the former SO files of obtained binary form are added in shell.
In one embodiment of the invention, in device shown in Fig. 4, shell adding unit 410 is further adapted for the SO texts in reinforcing In the initial code of part be written original SO files memory load logic so that Android system load reinforcing SO files when, According to memory load logic, former SO files are loaded into memory
In one embodiment of the invention, in device shown in Fig. 4, shell adding unit 410 is further adapted for the SO texts in reinforcing In the initial code of part, it is corresponding in former SO files that at least one of the SO files of reinforcing specified function is directed toward the function Specified function so that Android system call reinforce SO files in specified function when, call original SO files in it is corresponding Specified function.
In one embodiment of the invention, device shown in Fig. 4 further includes:Unwrapper unit 420 is suitable for installing Android Packet is unpacked, and at least one original SO files of Android installation kit are obtained;Packaged unit 430, the SO files for being suitable for reinforce are beaten It wraps in corresponding Android installation kit, so that after Android installation kit is mounted, starts every time corresponding in application, by Android system SO files after load reinforcing
It should be noted that the specific implementation mode of above-mentioned each device embodiment and aforementioned corresponding method embodiment is specific Embodiment is identical, and details are not described herein.
In conclusion technical scheme of the present invention, the data letter that is stored in the specified section using the former SO files got Breath replaces the data information that the specified section stores in the SO files of reinforcing in corresponding specified section, so that Android system is obtaining When taking the data information stored in the specified section of the SO files of reinforcing, what is actually got is corresponding specified section in former SO files The data information of middle storage.The technical solution avoids the SO because of reinforcing on the basis of the safety for the SO files for ensureing to reinforce The data information stored in specified section in file is not the data information that Android system is actually needed and the mistake generated, efficiency It is high and stable.
It should be noted that:
Algorithm and display be not inherently related to any certain computer, virtual bench or miscellaneous equipment provided herein. Various fexible units can also be used together with teaching based on this.As described above, it constructs required by this kind of device Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) realize the dynamic link library of Android installation kit according to the ... of the embodiment of the present invention The some or all functions of some or all components in the processing unit of SO files.The present invention is also implemented as being used for Some or all equipment or program of device of method as described herein are executed (for example, computer program and calculating Machine program product).It is such to realize that the program of the present invention may be stored on the computer-readable medium, or there are one can having Or the form of multiple signals.Such signal can be downloaded from internet website and be obtained, or be provided on carrier signal, Or it provides in any other forms.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame Claim.
Embodiment of the invention discloses that a kind of processing method of the dynamic link library SO files of A1, Android installation kit, In, pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, and this method includes:
Obtain the data information stored in the specified section of original SO files;
With the data information got, the number that the specified section stores in the SO files of reinforcing in corresponding specified section is replaced It is believed that breath so that Android system stored in the specified section for obtaining the SO files of the reinforcing data information when, directly acquire To the data information stored in corresponding specified section in former SO files.
A2, the method as described in A1, wherein the data information that stores includes in the specified section for obtaining original SO files:
When the original SO files are loaded into the memory of Android system, stored in the specified section of acquisition original SO files Data information.
A3, the method as described in A2, wherein the data information that stores includes in the specified section for obtaining original SO files:
Obtain the initial fictive address of the specified section of original SO files;
According to the initial fictive address of the specified section of the original SO files, obtains and stored in the specified section of the original SO files Data information.
A4, the method as described in A3, wherein the virtual address of specified section for obtaining original SO files includes:
Parse the dynamic sections of original SO files;
Go out from the dynamic segment searches Elf32_Dyn corresponding with the original specified section of SO files;
The value that d_ptr is read from Elf32_Dyn corresponding with the original specified section of SO files, as described The initial fictive address of the specified section of former SO files.
A5, the method as described in A1, wherein the specified section of the original SO files with its in the SO files of reinforcing it is corresponding The type of specified section is identical.
A6, the method as described in A5, wherein the specified section of the original SO files with its in the SO files of reinforcing it is corresponding Specified section is .dynstr sections;
And/or
Corresponding specified section in the SO files of reinforcing is .dynsym sections to the specified section of the original SO files with it;
And/or
Corresponding specified section in the SO files of reinforcing is .hash sections to the specified section of the original SO files with it.
The embodiment of the present invention also disclose B7, a kind of Android installation kit dynamic link library SO files processing method, Wherein, this method includes:
Shell, the SO files reinforced are increased to the former SO files of Android installation kit;
The processing logic of the SO files progress to the reinforcing is written in the housing, the processing logic is for executing Method as described in any one of A1-A6.
B8, the method as described in B7, wherein the former SO files to Android installation kit increase shell and include:
The original SO files are converted into binary form, the former SO files of obtained binary form are added to described In shell.
B9, the method as described in B7, wherein this method further includes:
The memory load logic of the original SO files is written in the initial code of the SO files of the reinforcing, so that peace The original SO files, according to the memory load logic, are loaded into memory by tall and erect system when loading the SO files of the reinforcing In.
B10, the method as described in B7, wherein this method further includes:
In the initial code of the SO files of the reinforcing, at least one of SO files of the reinforcing are specified into letter Number is directed toward the function corresponding specified function in the original SO files, so that Android system is in the SO files for calling the reinforcing In specified function when, call original SO files in corresponding specified function.
B11, the method as described in B7, wherein this method all steps take a step forward including:
Android installation kit is unpacked, at least one original SO files of Android installation kit are obtained;
The SO files of the reinforcing are bundled in corresponding Android installation kit, so that the Android installation kit is mounted Afterwards, start every time corresponding in application, loading the SO files after the reinforcing by Android system.
The embodiment of the present invention also disclose C12, a kind of Android installation kit dynamic link library SO files processing unit, Wherein, pending SO files are the SO files for increasing former SO files the reinforcing that shell generates, which includes:
Data information acquiring unit, the data information that stores in the specified section suitable for obtaining original SO files;
Data information replacement unit replaces the specified section in the SO files of reinforcing suitable for the data information to get The data information stored in corresponding specified section, so that Android system stores in obtaining the specified section of SO files of the reinforcing Data information when, be directly obtained the data information stored in corresponding specified section in former SO files.
C13, the device as described in C12, wherein
The data information acquiring unit, suitable for when the original SO files are loaded into the memory of Android system, obtaining Take the data information stored in the specified section of former SO files.
C14, the device as described in C13, wherein
The data information acquiring unit is suitable for obtaining the initial fictive address of the specified section of original SO files;According to described The initial fictive address of the specified section of former SO files obtains the data information stored in the specified section of the original SO files.
C15, the device as described in C14, wherein
The data information acquiring unit is suitable for parsing the dynamic sections of original SO files;From the dynamic segment searches Go out Elf32_Dyn corresponding with the original specified section of SO files;From corresponding with the original specified section of SO files The value that d_ptr is read in Elf32_Dyn, as the initial fictive address of the specified section of the original SO files.
C16, the device as described in C13, wherein the specified section of the original SO files with its in the SO files of reinforcing it is corresponding Specified section type it is identical.
C17, the device as described in C16, wherein the specified section of the original SO files with its in the SO files of reinforcing it is corresponding Specified section be .dynstr section;
And/or
Corresponding specified section in the SO files of reinforcing is .dynsym sections to the specified section of the original SO files with it;
And/or
Corresponding specified section in the SO files of reinforcing is .hash sections to the specified section of the original SO files with it.
The embodiment of the present invention also disclose D18, a kind of Android installation kit dynamic link library SO files processing unit, Wherein, which includes:
Shell adding unit is suitable for increasing shell, the SO files reinforced to the former SO files of Android installation kit;It will be such as C12- Device described in any one of C17 is added in the shell.
D19, the device as described in D18, wherein
The shell adding unit, suitable for the original SO files are converted to binary form, by obtained binary form Former SO files are added in the shell.
D20, the device as described in D18, wherein
The shell adding unit is further adapted for that the original SO files are written in the initial code of the SO files of the reinforcing Memory load logic, so that Android system is when loading the SO files of the reinforcing, it, will be described according to the memory load logic Former SO files are loaded into memory.
D21, the device as described in D18, wherein
The shell adding unit is further adapted in the initial code of the SO files of the reinforcing, by the SO texts of the reinforcing At least one of part specified function is directed toward the function corresponding specified function in the original SO files, so that Android system exists When calling the specified function in the SO files of the reinforcing, corresponding specified function in original SO files is called.
D22, the device as described in D18, wherein the device further includes:
Unwrapper unit obtains at least one original SO files of Android installation kit suitable for being unpacked to Android installation kit;
Packaged unit, suitable for the SO files of the reinforcing to be bundled in corresponding Android installation kit, so that the Android After installation kit is mounted, start every time corresponding in application, loading the SO files after the reinforcing by Android system.

Claims (10)

1. a kind of processing method of the dynamic link library SO files of Android installation kit, wherein pending SO files are to former SO File increases the SO files for the reinforcing that shell generates, and this method includes:
Obtain the data information stored in the specified section of original SO files;
With the data information got, the data letter that the specified section stores in the SO files of reinforcing in corresponding specified section is replaced Breath so that Android system stored in the specified section for obtaining the SO files of the reinforcing data information when, be directly obtained original The data information stored in corresponding specified section in SO files.
2. the data packets the method for claim 1, wherein stored in the specified section for obtaining original SO files It includes:
When the original SO files are loaded into the memory of Android system, the data stored in the specified section of original SO files are obtained Information.
3. method as claimed in claim 2, wherein the data packets stored in the specified section for obtaining original SO files It includes:
Obtain the initial fictive address of the specified section of original SO files;
According to the initial fictive address of the specified section of the original SO files, the number stored in the specified section of the original SO files is obtained It is believed that breath.
4. a kind of processing method of the dynamic link library SO files of Android installation kit, wherein this method includes:
Shell, the SO files reinforced are increased to the former SO files of Android installation kit;
The processing logic of the SO files progress to the reinforcing is written in the housing, the processing logic is for executing as weighed Profit requires the method described in any one of 1-3.
5. method as claimed in claim 4, wherein the former SO files to Android installation kit increase shell and include:
The original SO files are converted into binary form, the former SO files of obtained binary form are added to the shell In.
6. a kind of processing unit of the dynamic link library SO files of Android installation kit, wherein pending SO files are to former SO File increases the SO files for the reinforcing that shell generates, which includes:
Data information acquiring unit, the data information that stores in the specified section suitable for obtaining original SO files;
It is corresponding in the SO files of reinforcing to replace the specified section suitable for the data information to get for data information replacement unit Specified section in the data information that stores so that the number that Android system stores in the specified section for obtaining the SO files of the reinforcing It is believed that when breath, it is directly obtained the data information stored in corresponding specified section in former SO files.
7. device as claimed in claim 6, wherein
The data information acquiring unit, it is former suitable for when the original SO files are loaded into the memory of Android system, obtaining The data information stored in the specified section of SO files.
8. device as claimed in claim 7, wherein
The data information acquiring unit is suitable for obtaining the initial fictive address of the specified section of original SO files;According to the original SO The initial fictive address of the specified section of file obtains the data information stored in the specified section of the original SO files.
9. a kind of processing unit of the dynamic link library SO files of Android installation kit, wherein the device includes:
Shell adding unit is suitable for increasing shell, the SO files reinforced to the former SO files of Android installation kit;It will be such as claim Device described in any one of 6-8 is added in the shell.
10. device as claimed in claim 9, wherein
The shell adding unit, suitable for the original SO files are converted to binary form, by the former SO of obtained binary form File is added in the shell.
CN201611129917.7A 2016-12-09 2016-12-09 Processing method and device for SO file of dynamic link library of android installation package Active CN108460276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611129917.7A CN108460276B (en) 2016-12-09 2016-12-09 Processing method and device for SO file of dynamic link library of android installation package

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611129917.7A CN108460276B (en) 2016-12-09 2016-12-09 Processing method and device for SO file of dynamic link library of android installation package

Publications (2)

Publication Number Publication Date
CN108460276A true CN108460276A (en) 2018-08-28
CN108460276B CN108460276B (en) 2022-01-25

Family

ID=63221506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611129917.7A Active CN108460276B (en) 2016-12-09 2016-12-09 Processing method and device for SO file of dynamic link library of android installation package

Country Status (1)

Country Link
CN (1) CN108460276B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486496A (en) * 2020-11-25 2021-03-12 上海连尚网络科技有限公司 Method and equipment for generating and operating so file
WO2022206259A1 (en) * 2021-03-30 2022-10-06 北京字节跳动网络技术有限公司 Method and apparatus for processing dependency function, and device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282545A1 (en) * 2013-03-15 2014-09-18 Oracle International Corporation System and method for generic product wiring in a virtual assembly builder environment
CN104239757A (en) * 2014-09-30 2014-12-24 北京奇虎科技有限公司 Application program reversing-preventing method and device and operation method and terminal
CN104408337A (en) * 2014-11-18 2015-03-11 刘鹏 Reinforcement method for preventing reverse of APK (Android package) file
CN104408367A (en) * 2014-11-28 2015-03-11 北京奇虎科技有限公司 Application program configuration method and device
CN105426708A (en) * 2016-01-19 2016-03-23 北京鼎源科技有限公司 Reinforcing method of application program of Android system
CN105608346A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 ELF file protection method and system based on ARM instruction virtualization
CN105608391A (en) * 2015-12-17 2016-05-25 北京奇虎科技有限公司 Multi-ELF (Executable and Linkable Format)-file protection method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282545A1 (en) * 2013-03-15 2014-09-18 Oracle International Corporation System and method for generic product wiring in a virtual assembly builder environment
CN104239757A (en) * 2014-09-30 2014-12-24 北京奇虎科技有限公司 Application program reversing-preventing method and device and operation method and terminal
CN104408337A (en) * 2014-11-18 2015-03-11 刘鹏 Reinforcement method for preventing reverse of APK (Android package) file
CN104408367A (en) * 2014-11-28 2015-03-11 北京奇虎科技有限公司 Application program configuration method and device
CN105608391A (en) * 2015-12-17 2016-05-25 北京奇虎科技有限公司 Multi-ELF (Executable and Linkable Format)-file protection method and system
CN105608346A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 ELF file protection method and system based on ARM instruction virtualization
CN105426708A (en) * 2016-01-19 2016-03-23 北京鼎源科技有限公司 Reinforcing method of application program of Android system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ALI TAKIELDEEN等: "Implementation of a Hybrid Encryption Scheme for SMS/Multimedia Messages on Android", 《网页在线公开:HTTPS://XUESHU.BAIDU.COM/USERCENTER/PAPER/SHOW?PAPERID=DFA242D21244728F480C7A7697167895&SITE=XUESHU_SE》 *
MOH’D RASOUL AL-HADIDI等: "A Novel Data Hiding Algorithm for all types of file based on Injection process", 《网页在线公开:HTTPS://IEEEXPLORE.IEEE.ORG/STAMP/STAMP.JSP?TP=&ARNUMBER=6689657》 *
佚名: "Android Linker与SO加壳技术", 《网页在线公开:HTTPS://BLOG.CSDN.NET/BYEWEIYANG/ARTICLE/DETAILS/80125483》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486496A (en) * 2020-11-25 2021-03-12 上海连尚网络科技有限公司 Method and equipment for generating and operating so file
WO2022206259A1 (en) * 2021-03-30 2022-10-06 北京字节跳动网络技术有限公司 Method and apparatus for processing dependency function, and device and storage medium

Also Published As

Publication number Publication date
CN108460276B (en) 2022-01-25

Similar Documents

Publication Publication Date Title
CN105100191B (en) The method, apparatus and system of Java application installations are realized in a kind of cloud compiling
JP6198939B2 (en) Method for loading driver and embedded device
CN106355049A (en) Method and device for reinforcing dynamic linking library SO file of Android installation package
US10303467B2 (en) Target typing-dependent combinatorial code analysis
CN109948308A (en) Code security guard method, device, electronic equipment and computer readable storage medium
CN109766099A (en) Front end source code Compilation Method, device, storage medium and computer equipment
WO2019092565A1 (en) Using comments of a program to provide optimizations
CN108304175A (en) Packaging method and device is isolated in code file
CN105204917B (en) The method and device of loading configuration file in application program launching
CN106708571A (en) Resource file loading method and device and source file reinforcing method and device
CN110673837B (en) Code repairing method and device, electronic equipment and computer readable storage medium
CN109598107A (en) A kind of code conversion method and device based on application installation package file
CN113704706B (en) Code reinforcement method and device
CN109933350A (en) The method, apparatus and electronic equipment of embedded code in the application
Pandey et al. LLVM cookbook
Jaworski et al. Expert Python programming: become a master in Python by learning coding best practices and advanced programming concepts in Python 3.7
CN108460276A (en) A kind for the treatment of method and apparatus of the dynamic link library SO files of Android installation kit
CN108133126A (en) A kind of reinforcement means and device of Android application
Rourke Learn WebAssembly: Build web applications with native performance using Wasm and C/C++
US20110225213A1 (en) Loop control flow diversion
CN111435312A (en) Application program management method and device and electronic equipment
CN106681782A (en) Method and device for compiling dynamic linking library SO file of Android installation package
Knupp Writing Idiomatic Python 2.7. 3
Cifuentes et al. The university of queensland binary translator (uqbt) framework
Bezzubikov et al. Automatic dynamic binary translator generation from instruction set description

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