The present application relates to a kind of extracting code
loop counter method, device, storage medium and
electronic equipment, belong to safety detection technical field.The method of the present application, steps are as follows: analyzing code is analyzed;Generation
control flow graph and obtain loop code structure;Obtain the constant
data set in loop code structure;Based on constant
data set, obtain scalar constant
data set;Obtain potential monotonic scalar constant data set;Obtain monotonic scalar constant data set;Obtain loop definition exit;Obtain loop jump statement exit;Based on loop exit set and monotonic scalar constant data set, obtain
loop counter.Through the above steps, the extraction of
loop counter can be completed.The present application can accurately and completely obtain loop counter set, provide support for carrying out loop code structure itself related defect check, also make complete path traversal with the code with loop structure possible, improve the efficiency and accuracy of detection.