This invention discloses a method for generating encrypted script graphs based on stack execution, belonging to the field of encrypted script execution and
visualization analysis technology. It addresses the difficulty in accurately capturing state changes and generating traceable graphs during the execution of complex, multi-
branch encrypted scripts. Based on a virtual
stack machine, the method performs controlled execution of the target script's
instruction sequence, constructing state nodes and transition relationships to form a traceable execution graph. To solve the problems of state
aliasing and difficulty in anomaly localization in multi-
branch scenarios, branches are reordered hierarchically and rendered using channelization, and segments are marked as stable intervals when thresholds are met. The
system outputs graph nodes with embedded stack top positions, stack height changes, and element change details, supporting playback, highlighting, and event localization. This method can interface with compliant data collection agents to achieve sample
library alignment, encrypted archiving of execution logs, and graph
fingerprint verification, making it suitable for scenarios such as large-value transaction monitoring, anonymous transaction link restoration, strategy script auditing, and
risk control review.