0

I have a set of equations in string format as given below. Need to assign some value to the left-hand side variable (In the below example: rsp, esp). Then have to calculate and store the results on the right-hand side variable (i.e., rax, esp, rsp).

Example:

rax = rsp

esp = esp - 0x4

rsp = rsp - 0x30

Though I have used the eval function in python, it is throwing me an error message as it won't support =. Could someone please help me to find the answer?

Viktor
  • 461
  • 1
  • 3
  • 19
  • 1
    The answers to this question are not quick and easy. Time to read up on abstract syntax trees, parsers, and interpreters. I have a reading list on my website: https://www.msreverseengineering.com/program-analysis-reading-list/ You can expect to spend at least weeks studying these subjects before you feel comfortable doing what your question asks. – Rolf Rolles Oct 13 '22 at 09:34
  • @RolfRolles, thank you for your comment. I have found the solution to the question which I posted. With the help of "locals" and "globals" in python programming, this can be solved – okokok hack Oct 14 '22 at 06:20

1 Answers1

0

With the help of "locals" and "globals" in python programming, this can be solved