Skip to content

Commit

Permalink
selftest: allocate initial stack memory
Browse files Browse the repository at this point in the history
  • Loading branch information
mkannwischer committed Dec 16, 2024
1 parent e3974bd commit 13a4c30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slothy/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,8 +1314,8 @@ def run_code(code, txt=None):
# If we expect a function return, put a valid address in the LR
# that serves as the marker to terminate emulation
mu.reg_write(config.arch.RegisterType.unicorn_link_register(), CODE_END)
# Setup stack
mu.reg_write(config.arch.RegisterType.unicorn_stack_pointer(), STACK_TOP)
# Setup stack and allocate allocate initial stack memory
mu.reg_write(config.arch.RegisterType.unicorn_stack_pointer(), STACK_TOP - config.selftest_default_memory_size)
# Copy code into emulator
mu.mem_map(CODE_BASE, CODE_SZ)
mu.mem_write(CODE_BASE, objcode)
Expand Down

0 comments on commit 13a4c30

Please sign in to comment.