-
For my project I am attempting to use the uc_mem_map_ptr() function to map an address space created on the host with malloc into the emulator. For my purposes I would like the guest addresses to line up 1-1 with host addresses for the process. To do this I hoped to do something along the lines of: *code_ptr = malloc(code_size); However this throws an error in the check done by mem_map_check() specifically it fails the check here: My question is why does Unicorn enforce this page align requirement for mapped sections and would it be possible to remove this requirement. I'm also curious if there are any other suggestions on how to accomplish this. My motivation is this: I would like to be able to pass a pointer to an object created by the host as an argument in one of the argument registers for a guest function without needing to hard code an offset from an arbitrary memory mapped region. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Unfortunately, that's the requirements from the target MMU. You could calculate the offset to the nearest aligned address I think. |
Beta Was this translation helpful? Give feedback.
Generally I would suggest you map the whole page and write your contents there. Why does that not work for you?
I think you will be mostly safe if you switch to virtual tlb mode but I have no guarantee.