Code instrumentation detection method, device, equipment and medium
A technology of code instrumentation and detection methods, which is applied in the field of program analysis and can solve problems such as errors and heavy workload
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0038] This embodiment provides a code instrumentation detection method, which aims to analyze the DEX file in the APK to obtain the length of the function instruction in the DEX file. After running the APK, obtain the length of the function instruction in the DEX file again, and compare the function instructions Length, to determine whether the code has been instrumented, so as to realize code instrumentation detection.
[0039] According to the above principles, the code instrumentation detection method is introduced, such as figure 1 As shown, the code instrumentation detection method specifically includes the following steps:
[0040] Obtaining the DEX file in the APK, parsing the DEX file, and obtaining the original function instruction length of the DEX file;
[0041] Run the APK to obtain the memory address of the DEX file;
[0042] Obtain a function offset value, and obtain the target function instruction length according to the memory address of the DEX file and the...
Embodiment 2
[0066] This embodiment discloses a code stub detection device corresponding to the code stub detection method in Embodiment 1, which is a virtual structure device, such as figure 2 shown, including:
[0067] The DEX parsing module 210 is used to obtain the DEX file in the APK, parse the DEX file, and obtain the original function instruction length of the DEX file;
[0068] A memory address obtaining module 220, configured to run the APK to obtain the memory address of the DEX file;
[0069] The function length calculation module 230 is used to obtain the function offset value, and obtain the target function instruction length according to the memory address of the DEX file and the function offset value;
[0070] The comparison and output module 240 is configured to compare the length of the original function instruction with the length of the target function instruction, and output a stubbing detection result.
[0071] The DEX parsing module 210 invokes a preset Python scri...
Embodiment 3
[0079] image 3 A schematic structural diagram of an electronic device provided by Embodiment 3 of the present invention, such as image 3 As shown, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in a computer device may be one or more, image 3 Take a processor 310 as an example; the processor 310, memory 320, input device 330 and output device 340 in the electronic device can be connected by bus or other methods, image 3 Take connection via bus as an example.
[0080] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the code instrumentation detection method in the embodiment of the present invention (for example, a code instrumentation detection device DEX analysis module 210, memory address acquisition module 220, function length calculation...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


