Memory snapshot storage method and apparatus, computer device, and storage medium

By acquiring and storing the memory modification process in a virtual execution environment and merging operation nodes to generate a memory snapshot, the problems of long memory snapshot storage time, large data volume, and low frame rate are solved, achieving efficient memory snapshot storage and malware analysis.

CN115906076BActive Publication Date: 2026-11-27HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211380415.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2026-11-27
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In existing technologies, saving memory snapshots of virtual execution environments is time-consuming, involves large amounts of data, and has a low frame rate, making it impossible to effectively analyze malicious content that malicious programs erase before exiting.

Method used

By responding to memory modification operations, the memory modification process is acquired and stored in the database. Operation nodes are merged using the matching rules of operation parameters and operation nodes to generate a target memory snapshot, thereby reducing the storage time and data volume at a specific moment and increasing the frame rate.

Benefits of technology

It improves the efficiency of memory snapshot saving, increases the number of frames, reduces the amount of data, and ensures the integrity of snapshots and user analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115906076B_ABST
    Figure CN115906076B_ABST
Patent Text Reader

Abstract

The application relates to a memory snapshot storage method and device, computer equipment and a storage medium, comprising the following steps: in response to a current memory modification operation, obtaining a memory modification process; storing the memory modification process into a database, wherein an initial memory snapshot is stored in the database. Through the method, the problems of long time consumption, large data volume and low frame number of the current virtual execution environment memory snapshot saving can be solved, and the technical effects of improving snapshot saving efficiency, increasing the memory snapshot frame number and reducing the snapshot data volume are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information security technology, and in particular to a memory snapshot storage method, apparatus, computer device, and storage medium. Background Technology

[0002] With the development of information security, the detection of malicious programs is receiving increasing attention. Sandboxes, as isolated system environments, have been used by security researchers to analyze untrusted files or programs.

[0003] Currently, security researchers often use memory snapshots to analyze malware through sandboxes. However, due to the large amount of data in a single memory snapshot, saving multiple snapshots at any given time for analysis is impractical. Therefore, security researchers typically save the memory snapshot taken at the last moment before the program exits and then open that specific snapshot for analysis during backtracking. However, if the malware erases its malicious content before exiting, security researchers cannot analyze it, posing a significant security risk.

[0004] This shows that the current virtual execution environment still suffers from problems such as long memory snapshot saving time, large data volume, and low frame rate. Summary of the Invention

[0005] Therefore, it is necessary to provide a memory snapshot storage method, apparatus, computer device, and computer-readable storage medium that can reduce the memory snapshot storage time and data volume, and increase the frame rate, in order to address the above-mentioned technical problems.

[0006] Firstly, this embodiment provides a memory snapshot storage method, the method comprising:

[0007] In response to the current memory modification operation, retrieve the memory modification process;

[0008] The memory modification process is stored in a database, which contains an initial memory snapshot.

[0009] In one embodiment, the memory modification process includes multiple operation nodes, each operation node including at least one memory modification operation, and the step of obtaining the memory modification process in response to the memory modification operation includes:

[0010] Retrieve the historical modification process from the previous moment;

[0011] The operation node at the previous moment is determined based on the historical modification process;

[0012] Obtain the operation parameters of the current memory modification operation;

[0013] If the operation parameters match the operation node of the previous moment, the current memory modification operation is merged into the operation node of the previous moment to obtain the memory modification process.

[0014] In one embodiment, after obtaining the operation parameters of the current memory modification operation, the method further includes:

[0015] If the operation parameters do not match the operation node at the previous moment, a new operation node is created based on the current memory modification operation, and the memory modification process is obtained based on the newly created operation node and the historical modification process.

[0016] In one embodiment, the operation parameters include an address range. If the operation parameters match the operation node at the previous time step, then merging the current memory modification operation into the operation node at the previous time step includes:

[0017] Determine whether the address range overlaps with the address range of the operation node at the previous moment;

[0018] If they do not overlap, they are considered a match, and the current memory modification operation is merged into the operation node of the previous moment.

[0019] In one embodiment, the operation parameters include operation time. If the operation parameters match the operation node of the previous time step, then merging the current memory modification operation into the operation node of the previous time step includes:

[0020] Determine whether the operation time matches the time range of the operation node at the previous moment;

[0021] If a match is found, the current memory modification operation is merged into the operation node of the previous time step.

[0022] In one embodiment, after storing the memory modification process in the database, the method further includes:

[0023] Obtain the memory snapshot generation instruction, and determine the target memory modification operation based on the memory snapshot generation instruction;

[0024] A target memory snapshot is generated based on the target memory modification operation and the memory modification process.

[0025] In one embodiment, the memory modification process includes multiple operation nodes, each operation node including at least one memory modification operation, and determining the target memory modification operation based on the memory snapshot generation instruction includes:

[0026] The target operation node is determined based on the memory snapshot generation instructions;

[0027] The target memory modification operation is determined based on the target operation node.

[0028] Secondly, this embodiment provides a memory snapshot storage device, the device comprising:

[0029] The acquisition module is used to acquire the memory modification process in response to the current memory modification operation;

[0030] A storage module is used to store the memory modification process in a database, wherein the database stores an initial memory snapshot.

[0031] Thirdly, this embodiment provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above-mentioned embodiments.

[0032] Fourthly, this embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0033] The aforementioned memory snapshot storage method, apparatus, computer device, and storage medium acquire the memory modification process in response to a current memory modification operation; store the memory modification process in a database containing an initial memory snapshot. Compared to traditional technologies that save complete memory snapshots at multiple moments, this method reduces the storage time and data volume of memory snapshots at specific moments by recording the memory modification operation itself. Each memory modification operation in the memory modification process can be used to generate a memory snapshot at the corresponding moment, thereby increasing the number of frames saved in the memory snapshot. This solves the problems of long storage time, large data volume, and low frame rate in current virtual execution environments, achieving the technical effects of improving snapshot storage efficiency, increasing the number of memory snapshot frames, and reducing the amount of snapshot data. Attached Figure Description

[0034] Figure 1 This is an application environment diagram of a memory snapshot storage method in one embodiment;

[0035] Figure 2 This is a flowchart illustrating a memory snapshot storage method in one embodiment;

[0036] Figure 3 This is a flowchart illustrating the memory snapshot storage method in another embodiment;

[0037] Figure 4 This is a flowchart illustrating the memory snapshot storage method in another embodiment;

[0038] Figure 5This is a flowchart illustrating the memory snapshot storage method in another embodiment;

[0039] Figure 6 This is a flowchart illustrating the memory snapshot storage method in another embodiment;

[0040] Figure 7 This is a structural block diagram of a memory snapshot storage device in one embodiment;

[0041] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0043] The memory snapshot storage method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. In response to a current memory modification operation, terminal 102 obtains the memory modification process and stores it in the data storage system, which also stores an initial memory snapshot. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0044] In one embodiment, such as Figure 2 As shown, a memory snapshot storage method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:

[0045] Step S100: In response to the current memory modification operation, obtain the memory modification process.

[0046] This method can be applied to sandboxes, as well as other virtual execution environments for monitoring memory modification operations on the program under test; this paper does not limit its application to these applications. A virtual execution environment refers to an isolated environment provided for the program under test at the operating system level, and this virtual execution environment can be generated based on data within the operating system.

[0047] Memory modification operations can be data manipulation commands sent by the program under test. These data manipulation commands are used to operate on data on the disk, and can be read commands, write commands, or other commands that operate on disk data. This article does not limit them.

[0048] The memory modification process corresponds to the memory modification operation, which refers to the historical memory modification data under the current memory modification operation. It can be a collection of all or part of the historical memory modification operations, including the current memory modification operation, or other data that can reproduce the historical memory modification operation records. This article does not limit this.

[0049] Step S200: The memory modification process is stored in a database, which contains an initial memory snapshot.

[0050] A memory snapshot is a record of the state of data in memory at a specific point in time. An initial memory snapshot is a snapshot of the memory of the program under test before any data operation commands are sent. The initial memory snapshot can be a snapshot recorded before the program under test is executed, or it can be a snapshot regenerated based on the generation conditions of the virtual execution environment.

[0051] The memory modification process is stored in a database, which will contain the initial memory snapshot and the memory modification process. Security analysts can then generate a memory snapshot at a specific moment based on the initial memory snapshot and the memory modification process.

[0052] This embodiment provides a memory snapshot storage method that acquires the memory modification process and stores it in a database. Compared to traditional technologies that save complete memory snapshots at multiple moments, this method reduces the storage time and data volume of memory snapshots at specific moments by recording the memory modification operations themselves. Each memory modification operation in the memory modification process can be used to generate a memory snapshot at the corresponding moment, thereby increasing the number of frames saved in the memory snapshot. This solves the problems of long storage time, large data volume, and low frame rate in current virtual execution environments, achieving the technical effects of improving snapshot storage efficiency, increasing the number of memory snapshot frames, and reducing the amount of snapshot data.

[0053] Please see Figure 3 In one embodiment, the memory modification process includes multiple operation nodes, and each operation node includes at least one memory modification operation, such as... Figure 3 As shown, the process of obtaining memory modification information in response to a memory modification operation includes:

[0054] Step S110: Obtain the historical modification process from the previous moment.

[0055] In this context, an operation node refers to a key operation point in the memory modification process. Each operation node includes at least one memory modification operation. An operation node can be a collection of one or more memory modification operations, a combination of multiple memory modification operations into a single operation, or other nodes containing memory modification operations. Furthermore, an operation node may also include one or more information such as the type, content, time, and address of the memory modification operation. Security analysts can preview the memory modification operations under an operation node using this information.

[0056] Historical modification process refers to the historical memory modification process. Obtaining the historical modification process at a previous moment can mean obtaining the memory modification process obtained at a previous moment.

[0057] Step S120: Determine the operation node of the previous moment based on the historical modification process.

[0058] The operation node at the previous moment is determined based on the historical modification process. This can be done by determining the operation node to be processed based on the memory modification process at the previous moment, or by determining the last operation node of the historical modification process as the operation node at the previous moment.

[0059] Step S130: Obtain the operation parameters of the current memory modification operation.

[0060] The parameters for memory modification operations can be determined based on the memory modification operation itself, or based on data generated by the virtual execution environment during the acquisition of the memory modification operation. Parameters determined based on the memory modification operation itself can include, but are not limited to, operation type, address range, and modified content. Parameters determined based on data generated by the virtual execution environment during the acquisition of the memory modification operation can include, but are not limited to, operation time.

[0061] Step S140: If the operation parameters match the operation node of the previous moment, then the current memory modification operation is merged into the operation node of the previous moment to obtain the memory modification process.

[0062] The operation parameters are matched with the operation node from the previous moment. This matching can be based on all or some of the operation parameters. The operation parameters can be preset and matched according to the preset operation parameters, or they can be determined based on the memory modification operations under this operation node.

[0063] The matching rules between operation parameters and operation nodes can also be preset. If the operation parameters and operation nodes meet the matching rules, the matching is considered successful. In one specific embodiment, if the operation parameter is an operation type, and the matching rule is that if the operation parameters are the same, it is considered a match. Therefore, when the operation type of the operation parameter is consistent with the operation type of the operation node at the previous moment, the matching result is successful. In another specific embodiment, if the operation parameter is the content to be modified, and the matching rule is that if the modified content is inconsistent, it is considered a match. Therefore, when the modified content of the operation parameter is inconsistent with the modified content of the operation node at the previous moment, the matching result is successful.

[0064] Merging the current memory modification operation into the previous operation node means merging the current memory modification operation into the previous operation node in the history of modification operations. The merging method can be either to incorporate the current memory modification operation into the memory modification operation set of the operation node, or to obtain memory modification operations within the operation node that have the same operation type as the current memory modification operation and merge these memory modification operations into a single memory modification operation.

[0065] Furthermore, the operation parameters of the current operation node can be updated based on the current memory modification operation. In one specific embodiment, if the current memory modification operation is to write data to metadata information at a specified path, then: the specified path of the current memory modification operation can be merged with the address range of other memory modification operations under the operation node to determine a new address range as the address range of the operation node; alternatively, the operation parameters of the current operation node can be updated based on the operation parameters of other memory modification operations, which is not limited in this document.

[0066] Furthermore, when the operation parameters do not match the operation node of the previous moment, it can be that the next operation node of the operation node in the historical modification process is determined and used as the operation node of the current moment and re-matched, or the memory modification operation corresponding to the operation parameters is processed separately according to preset rules, or no processing is performed.

[0067] The memory modification process can be obtained by processing the historical modification process through the above steps, and then identifying the processed historical modification process as the memory modification process.

[0068] This embodiment provides a memory snapshot storage method that obtains the memory modification process by matching operation parameters with the operation nodes of the previous moment and merging the operation nodes based on the matching results. This method can determine key operation nodes and preview operation parameters. Users can determine the required moment based on the information of the operation nodes and generate a memory snapshot at the corresponding moment, thereby improving the technical effect of improving user operation efficiency. At the same time, merging multiple memory modification operations into one memory modification operation can also reduce redundant fields in the historical modification process, thereby reducing the amount of data stored in the memory snapshot.

[0069] In one embodiment, after obtaining the operation parameters of the current memory modification operation, the method further includes:

[0070] If the operation parameters do not match the operation node at the previous moment, a new operation node is created based on the current memory modification operation, and the memory modification process is obtained based on the newly created operation node and the historical modification process.

[0071] The newly created operation nodes are stored in the historical modification process. The memory modification process is determined based on the newly created operation nodes and the historical modification process. This can be achieved by using the newly created operation nodes from the historical modification process as the current operation node, merging the current memory modification operations into the current operation node, and obtaining the memory modification process based on the processed historical modification process.

[0072] Furthermore, the operation parameters of the newly created operation node can be determined based on the memory modification operation at the current moment. In one specific embodiment, if the memory modification operation at the current moment is writing data to metadata information at a specified path, then a preset time range can be determined based on the current moment, and this time range can be used as the operation time of the newly created operation node. Alternatively, the specified path can be used as the address range of the newly created operation node, or the operation parameters of the newly created operation node can be determined based on the operation parameters of other memory modification operations. This document does not limit the scope of these methods.

[0073] This embodiment provides a memory snapshot storage method that automatically creates operation nodes and obtains the memory modification process when operation parameters do not match the operation node, thereby improving the technical effect of snapshot storage efficiency.

[0074] It is understandable that, as a critical point of operation for memory modification, the operation node should maintain data integrity for user analysis. If a later memory modification operation within an operation node overwrites the data modified by a previous memory modification operation, the overwritten data will be lost when a memory snapshot is generated at the operation node, reducing data integrity and user analysis efficiency. Therefore, this application also provides an embodiment to address the potential data overwriting problem when memory modification operations are merged into an operation node.

[0075] In one embodiment, the operation parameters include an address range. If the operation parameters match the operation node at the previous time step, then merging the current memory modification operation into the operation node at the previous time step includes:

[0076] Determine whether the address range overlaps with the address range of the operation node at the previous moment;

[0077] If they do not overlap, they are considered a match, and the current memory modification operation is merged into the operation node of the previous moment.

[0078] Here, the address range refers to the range of memory addresses corresponding to the data in the memory modification operation. Determining whether the address range overlaps with the address range of the operation node at the previous moment involves comparing the address range of the memory operation with the address range of the operation node at the previous moment. If the address ranges of the memory modification operation and the operation node at the previous moment overlap, it means that at least one identical memory address exists within the address range.

[0079] If the address range of the memory modification operation does not overlap with that of the operation node at the previous moment, it can be considered that there is no data overwriting, and it is considered a match. The current memory modification operation is then merged into the operation node at the previous moment.

[0080] Furthermore, if there is overlap, it can be to determine the next operation node in the historical modification process, use it as the operation node at the current moment and rematch it, or it can be to process the memory modification operation corresponding to the operation parameters separately according to preset rules, or it can be to do nothing.

[0081] This embodiment provides a memory snapshot storage method that determines the merging of operation nodes based on the overlap of address ranges. This avoids the current memory modification operation from overwriting the data of the historical modification process, improves the data integrity of snapshot backtracking, and achieves the technical effect of improving the user's analysis efficiency of malicious samples.

[0082] In one embodiment, the operation parameters include operation time. If the operation parameters match the operation node of the previous time step, then merging the current memory modification operation into the operation node of the previous time step includes:

[0083] Determine whether the operation time matches the time range of the operation node at the previous moment;

[0084] If a match is found, the current memory modification operation is merged into the operation node of the previous time step.

[0085] Understandably, merging memory modification operations into operation nodes based on operation time allows users to more quickly find the operation node for the required operation time and generate the memory snapshot when they need to generate a memory snapshot at a specific moment based on the operation time.

[0086] The time range of the previous operation node can be preset. If the operation time of the memory modification operation matches the time range, the current memory modification operation will be merged into the previous operation node.

[0087] If they do not match, the next operation node in the historical modification process can be determined as the operation node at the current moment, and the operation time of the memory modification operation can be matched with the time range of the operation node at the current moment. This process is repeated until the operation time of the memory modification operation matches the time range of an operation node in the historical modification process.

[0088] Furthermore, if there is a mismatch, a new operation node can be created, and a preset time range can be determined based on the current memory modification operation time, and this time range can be used as the time range for creating the new operation node.

[0089] Furthermore, considering the continuity of memory modification operations, the current memory modification operation can be merged into the operation node of the previous moment. The time range of the operation node can also be updated based on the current memory modification operation. For example, the time range can be extended by a preset length based on the operation time of the current memory modification operation, and this extended time range can be used as the time range of the operation node. In a specific embodiment, the time range of the operation node at the previous moment is 14:20:00 to 14:20:10, with a preset time length of 10 milliseconds. Therefore, within 10 milliseconds after the memory modification operation at the previous moment is sent, the memory modification operations can be considered continuous. If the previous moment was 14:20:00 and the current moment is 14:20:10, then the operation time of the current moment matches the time range of the operation node at the previous moment, and the time range of that operation node is extended by 10 milliseconds accordingly, updating its time range to 14:20:00 to 14:20:20. This maintains the continuity of memory modification operations while merging operation nodes according to their operation times, improving the readability of memory snapshots.

[0090] This embodiment provides a memory snapshot storage method that merges memory modification operations by determining the operation node based on the operation time. Analysts can generate memory snapshots retrospectively based on the operation time, thereby improving the efficiency of memory snapshot generation.

[0091] In one embodiment, after storing the memory modification process in the database, the method further includes:

[0092] Obtain the memory snapshot generation instruction, and determine the target memory modification operation based on the memory snapshot generation instruction;

[0093] A target memory snapshot is generated based on the target memory modification operation and the memory modification process.

[0094] The memory snapshot generation instruction can be a user-sent instruction to generate a memory snapshot at a specific moment, and may include memory modification operation information. Determining the target memory modification operation based on the memory snapshot generation instruction can be based on the memory modification operation information.

[0095] The target memory snapshot is generated based on the target memory modification operation and the memory modification process. This can be achieved by determining the corresponding memory modification operation in the memory modification process based on the target memory modification operation, and executing the memory modification operation and the memory modification operations before it in the initial memory snapshot to obtain the memory snapshot at the target time.

[0096] This embodiment provides a memory snapshot storage method that determines the target memory modification operation based on the memory snapshot generation instruction and generates the target memory snapshot, thereby realizing the generation of memory snapshots at any time and achieving the technical effect of increasing the number of memory snapshot frames.

[0097] In one embodiment, the memory modification process includes multiple operation nodes, each operation node including at least one memory modification operation, and determining the target memory modification operation based on the memory snapshot generation instruction includes:

[0098] The target operation node is determined based on the memory snapshot generation instructions;

[0099] The target memory modification operation is determined based on the target operation node.

[0100] The memory snapshot generation instruction may also include operation node information. Determining the target operation node based on the memory snapshot generation instruction can be done by determining the target operation node based on the operation node information. Determining the target memory modification operation based on the target operation node can be done by identifying either the first memory modification operation in that operation node or the last memory modification operation in that operation node as the target memory modification operation.

[0101] This embodiment provides a memory snapshot storage method that generates a memory snapshot of the corresponding node based on the target operation node. This can improve the readability and integrity of the memory snapshot while reducing the amount of data, thereby achieving the technical effect of improving the efficiency of malicious sample analysis.

[0102] To more clearly illustrate the technical solution of this application, a detailed embodiment is also provided for further explanation.

[0103] like Figure 4 As shown, this embodiment provides a memory snapshot storage method applied in a sandbox. The sandbox serves as a virtual execution environment where users can test untrusted files or programs and record their behavior. The recorded behavior can be used by the user to determine whether the program is malicious. The method includes:

[0104] The program to be tested is placed in the sandbox for execution;

[0105] The data required to run the program under test is loaded into memory, and a memory snapshot is saved as the initial memory snapshot before execution begins.

[0106] The program to be tested is executed, and the memory modification operations sent during its execution are obtained, including: modifying memory via API and modifying memory via instructions; wherein, the memory modification operation includes operation parameters, such as operation type, address range, modification content, operation time, etc.

[0107] Save the memory modification operations in chronological order as a memory modification process file.

[0108] In one embodiment, the method further includes: acquiring memory modification operations, merging operation nodes based on memory modification operations, and generating a memory operation node file, including: sequentially reading memory modification operations; if the address range corresponding to the current memory modification operation does not overlap with the address range of the current operation node, then merging the memory modification operation into the current operation node; if they overlap, then determining the memory modification operation as the new current operation node, and continuing to determine whether the address range of the next operation overlaps with the current operation node; and generating a memory operation node file based on multiple operation nodes.

[0109] In one specific embodiment, such as Figure 5 As shown, it could be:

[0110] Read the memory modification operations sequentially, determine the first memory modification operation as the current operation node, and denote this memory modification operation as N;

[0111] Determine if there is a next memory modification operation. If there is, read the next memory modification operation and denote it as M. Determine if the memory address modification ranges of N and M overlap. If they overlap, add N to the memory operation node sequence L and determine M as the current operation node, denoteing M as N. If they do not overlap, merge the modification content of M into N. After processing, continue to determine if there is a next memory modification operation.

[0112] If it does not exist, add N to the memory operation node sequence L, and generate a memory operation node file based on the memory operation node sequence.

[0113] It is understandable that the acquisition of memory modification operations and the merging of operation nodes based on memory modification operations to generate memory modifications can be performed during the execution of the program under test, or after the program under test has been completed.

[0114] like Figure 6 As shown, in one embodiment, it further includes:

[0115] Obtain the initial memory snapshot and memory operation node file;

[0116] Read the memory operation node file; it can also analyze and display the operation node information in the memory operation node file, and the user can determine the operation node at the target time based on the displayed operation node and send a memory snapshot generation command;

[0117] Obtain the memory snapshot generation instruction, and based on the memory snapshot generation instruction and the memory operation node file, obtain the target memory modification operation. Execute the target memory modification operation in the initial memory snapshot to obtain the target memory snapshot.

[0118] This embodiment provides a memory snapshot storage method that solves the problems of long storage time, large data volume, and low frame rate in current virtual execution environments by acquiring and storing the initial memory snapshot and memory modification operations during execution. By merging operation nodes for memory modification operations, it improves user operation efficiency and reduces redundant fields in memory modification operations, thereby reducing the amount of stored data. By determining the merging of operation nodes based on the overlap of address ranges, it avoids the current memory modification operation from overwriting the data of the historical modification process, improves the data integrity of snapshot backtracking, and achieves the technical effect of improving the user's analysis efficiency of malicious samples.

[0119] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0120] Based on the same inventive concept, this application also provides a memory snapshot storage device for implementing the memory snapshot storage method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more memory snapshot storage device embodiments provided below can be found in the limitations of the memory snapshot storage method described above, and will not be repeated here.

[0121] In one embodiment, such as Figure 7 As shown, a memory snapshot storage device is provided, comprising: an acquisition module and a storage module, wherein:

[0122] The acquisition module 100 is used to acquire the memory modification process in response to the current memory modification operation.

[0123] Storage module 200 is used to store the memory modification process in a database, wherein the database stores an initial memory snapshot.

[0124] The acquisition module 100 is further configured to: acquire the historical modification process of the previous moment; determine the operation node of the previous moment based on the historical modification process; acquire the operation parameters of the current memory modification operation; if the operation parameters match the operation node of the previous moment, merge the current memory modification operation into the operation node of the previous moment to obtain the memory modification process.

[0125] The acquisition module 100 is further configured to: if the operation parameters do not match the operation node at the previous moment, then create a new operation node based on the current memory modification operation, and obtain the memory modification process based on the newly created operation node and the historical modification process.

[0126] The acquisition module 100 is further configured to: determine whether the address range overlaps with the address range of the operation node at the previous moment; if they do not overlap, they are considered to be matched, and the current memory modification operation is merged into the operation node at the previous moment.

[0127] The acquisition module 100 is also used to: determine whether the operation time matches the time range of the operation node at the previous moment; if they match, merge the current memory modification operation into the operation node at the previous moment.

[0128] The memory snapshot storage device further includes: a memory snapshot generation module, used to acquire a memory snapshot generation instruction, determine a target memory modification operation based on the memory snapshot generation instruction, and generate a target memory snapshot based on the target memory modification operation and the memory modification process.

[0129] The memory snapshot generation module is also used to: determine the target operation node based on the memory snapshot generation instruction; and determine the target memory modification operation based on the target operation node.

[0130] Each module in the aforementioned memory snapshot storage device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0131] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a memory snapshot storage method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0132] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0134] In response to the current memory modification operation, retrieve the memory modification process;

[0135] The memory modification process is stored in a database, which contains an initial memory snapshot.

[0136] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0137] In response to the current memory modification operation, retrieve the memory modification process;

[0138] The memory modification process is stored in a database, which contains an initial memory snapshot.

[0139] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0141] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A memory snapshot storage method, characterized in that, The method is applied to a sandbox or virtual execution environment, and the method includes: In response to a current memory modification operation, a memory modification process is obtained. This memory modification process includes multiple operation nodes, each including at least one memory modification operation. Obtaining the memory modification process in response to the memory modification operation includes: obtaining a previous historical modification process; determining the previous operation node based on the historical modification process; obtaining operation parameters for the current memory modification operation; if the operation parameters match the previous operation node, merging the current memory modification operation into the previous operation node to obtain the memory modification process. The operation parameters include an address range; if the operation parameters match the previous operation node, merging the current memory modification operation into the previous operation node results in a memory modification process. The operation node at a given moment includes: determining whether the address range overlaps with the address range of the operation node at the previous moment; if they do not overlap, it is considered a match, and the current memory modification operation is merged into the operation node at the previous moment; if they overlap, the next operation node in the historical modification process is determined, and it is used as the operation node at the current moment and re-matched; the operation parameter also includes the operation time. If the operation parameter matches the operation node at the previous moment, merging the current memory modification operation into the operation node at the previous moment further includes: determining whether the operation time matches the time range of the operation node at the previous moment; if they match, the current memory modification operation is merged into the operation node at the previous moment. The memory modification process is stored in a database, which contains an initial memory snapshot. Obtain the memory snapshot generation instruction, and determine the target memory modification operation based on the memory snapshot generation instruction; A target memory snapshot is generated based on the target memory modification operation and the memory modification process; the generation of the target memory snapshot based on the target memory modification operation and the memory modification process includes: determining the corresponding memory modification operation in the memory modification process based on the target memory modification operation, and executing the memory modification operation and the memory modification operations before it in the initial memory snapshot to obtain the memory snapshot at the target time.

2. The method according to claim 1, characterized in that, After obtaining the operation parameters of the current memory modification operation, the process further includes: If the operation parameters do not match the operation node at the previous moment, a new operation node is created based on the current memory modification operation, and the memory modification process is obtained based on the newly created operation node and the historical modification process.

3. The method according to claim 1, characterized in that, The memory modification process includes multiple operation nodes, and each operation node includes at least one memory modification operation. Determining the target memory modification operation based on the memory snapshot generation instruction includes: The target operation node is determined based on the memory snapshot generation instructions; The target memory modification operation is determined based on the target operation node.

4. A memory snapshot storage device, characterized in that, The device includes: An acquisition module is configured to acquire the memory modification process in response to a current memory modification operation; and to acquire a memory snapshot generation instruction, and determine a target memory modification operation based on the memory snapshot generation instruction; the memory modification process includes multiple operation nodes, and each operation node includes at least one memory modification operation; the acquisition of the memory modification process in response to the memory modification operation includes: acquiring the historical modification process of the previous moment; determining the operation node of the previous moment based on the historical modification process; acquiring the operation parameters of the current memory modification operation; if the operation parameters match the operation node of the previous moment, then merging the current memory modification operation into the operation node of the previous moment to obtain the memory modification process; the operation parameters include an address range, and if the operation parameters match the operation node of the previous moment... If the current memory modification operation is merged into the previous operation node, the following steps are taken: determining whether the address range overlaps with the address range of the previous operation node; if they do not overlap, it is considered a match, and the current memory modification operation is merged into the previous operation node; if they overlap, the next operation node in the historical modification process is determined, and it is used as the current operation node and re-matched; the operation parameter also includes the operation time. If the operation parameter matches the previous operation node, merging the current memory modification operation into the previous operation node further includes: determining whether the operation time matches the time range of the previous operation node; if they match, the current memory modification operation is merged into the previous operation node. A storage module is used to store the memory modification process in a database, wherein the database stores an initial memory snapshot; A memory snapshot generation module is used to generate a target memory snapshot based on the target memory modification operation and the memory modification process; the generation of the target memory snapshot based on the target memory modification operation and the memory modification process includes: determining the corresponding memory modification operation in the memory modification process based on the target memory modification operation, and executing the memory modification operation and the memory modification operations before it in the initial memory snapshot to obtain a memory snapshot at the target time.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Memory snapshot generation method and device, electronic equipment and storage medium

    CN110515774A

  • Data synchronization method and device, equipment and storage medium

    CN114036226A