Is there any elegant way to calculate the maximum possible stack depth utilization of a program, using IDAPython?
currently my best approach is iterating through all functions and counting stack-increasing instructions.
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.
Sign up to join this communityIDAPython-function get_frame_size(ea)
gives size of stack in bytes.
So you can get max stack through all available functions:
"0x%04X" % max(get_frame_size(f) for f in Functions(0, BADADDR))
getrlimit(2)
for more on this.