Thread Rating:
  • 14 Vote(s) - 4.07 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PPSSPP iOS Port
Amen!.
(03-03-2013, 06:03 PM)the avenger Wrote: sys_icache_invalidate()
function,maybe if you try this while the app is out of the sandbox(ie has root acess) things will work?
This is what PPSSPP is currently using though. It's a case of sys_cache_control(). That is, they are the same function. When you replace it, nothing changes.
The crash is not from cache like I said, it's from PROT_EXEC. Simply lacking privileges to execute from memory.
Maybe jit crashing happens because use mmap for allocating memory? This example working for me, also when set (PROT_READ | PROT_EXEC | PROT_WRITE) in mprotect.
Although even allocation through malloc still crash..
(03-04-2013, 02:03 PM)rock88 Wrote: Maybe jit crashing happens because use mmap for allocating memory? This example working for me, also when set (PROT_READ | PROT_EXEC | PROT_WRITE) in mprotect.
Although even allocation through malloc still crash..
this might save the day
http://reverse.put.as/wp-content/uploads...igning.pdf
jit startes from page 39 of this all the way down

edit:also this is probably why giving it the dynamic-codesign entitlement didn't work
taken from somewhere:whereby pages can either be read/write or read/execute. Unfortunately the majority of existing JIT engines expect RWX in order to patch executable pages without the need to change the state from rx » rw, patch code and then rw » rx. Critical in multi-threaded scenarios, as code could conceivably jump to a page that was being patched and fault due to the absence of the execute flag.
sorry for offtopic

someone can fix the no text appears in Lunar: Silver Star Harmony,the fonts aren't packaged in properly.
From that document it looks like we need to pass a MAP_JIT to mmap() call as well as adding dynamic_codesign to entitlements.
Can anyone quickly try?

Also looks like if you use MAP_FILE instead of MAP_ANON, you could run JIT without jailbreak? In iOS 5.0 anyway, probably fixed now.
(03-05-2013, 01:29 AM)xsacha Wrote: From that document it looks like we need to pass a MAP_JIT to mmap() call as well as adding dynamic_codesign to entitlements.
Can anyone quickly try?

Also looks like if you use MAP_FILE instead of MAP_ANON, you could run JIT without jailbreak? In iOS 5.0 anyway, probably fixed now.
just tell me what code to change and with what and in what file and i can test things
instantly
I try it, now app crashing in ARMXEmitter::Write32..

It's had to be done only in the function AllocateExecutableMemory ?
(03-05-2013, 01:06 PM)rock88 Wrote: I try it, now app crashing in ARMXEmitter::Write32..

It's had to be done only in the function AllocateExecutableMemory ?

does it have root access,and what file did u change for it to progress,also did you give it the dynamic-codesigning entitlement
I just replace "MAP_ANON | MAP_PRIVATE" in AllocateExecutableMemory from Common/MemoryUtil.cpp on a "MAP_ANON | MAP_PRIVATE | MAP_JIT", also try "MAP_FILE | MAP_PRIVATE | MAP_JIT", and add "dynamic-codesigning" flag to entitlements and set it to YES.

And i run it without root access..
(03-05-2013, 01:24 PM)rock88 Wrote: I just replace "MAP_ANON | MAP_PRIVATE" in AllocateExecutableMemory from Common/MemoryUtil.cpp on a "MAP_ANON | MAP_PRIVATE | MAP_JIT", also try "MAP_FILE | MAP_PRIVATE | MAP_JIT", and add "dynamic-codesigning" flag to entitlements and set it to YES.

And i run it without root access..
i am trying to build the latest code from the github with these changes and give it root access see what happens but i get this error
   
any help?
In addition to that change, you also need a valid fd.

Something like... at the top of the file:

#include <fcntl.h>

And then inside that func:

int fd = open("/dev/zero", O_RDWR, 0);

And then replace the param after the MAP_ flags (-1) with fd. It's probably crashing in the emitter because mmap() returned an invalid pointer and so it's crashing when writing to a bad ptr.

(03-05-2013, 01:52 PM)the avenger Wrote: i am trying to build the latest code from the github with these changes and give it root access see what happens but i get this error

any help?

Hmm, xcode should be building the git-version.cpp file in the root. What do you have in that file? You may need to re-run cmake.

-[Unknown]
(03-05-2013, 02:32 PM)[Unknown] Wrote: In addition to that change, you also need a valid fd.

Something like... at the top of the file:

#include <fcntl.h>

And then inside that func:

int fd = open("/dev/zero", O_RDWR, 0);

And then replace the param after the MAP_ flags (-1) with fd. It's probably crashing in the emitter because mmap() returned an invalid pointer and so it's crashing when writing to a bad ptr.

(03-05-2013, 01:52 PM)the avenger Wrote: i am trying to build the latest code from the github with these changes and give it root access see what happens but i get this error

any help?

Hmm, xcode should be building the git-version.cpp file in the root. What do you have in that file? You may need to re-run cmake.

-[Unknown]
re-run cmake on what?i already ran it on the ios toolchain,
anyway if you can post the lines of code already edited with what you proposed i can paste it in and see how it works
no lucky,ios is to hard.
(03-05-2013, 03:01 PM)the avenger Wrote:
(03-05-2013, 02:32 PM)[Unknown] Wrote: In addition to that change, you also need a valid fd.

Something like... at the top of the file:

#include <fcntl.h>

And then inside that func:

int fd = open("/dev/zero", O_RDWR, 0);

And then replace the param after the MAP_ flags (-1) with fd. It's probably crashing in the emitter because mmap() returned an invalid pointer and so it's crashing when writing to a bad ptr.

(03-05-2013, 01:52 PM)the avenger Wrote: i am trying to build the latest code from the github with these changes and give it root access see what happens but i get this error

any help?

Hmm, xcode should be building the git-version.cpp file in the root. What do you have in that file? You may need to re-run cmake.

-[Unknown]
re-run cmake on what?i already ran it on the ios toolchain,
anyway if you can post the lines of code already edited with what you proposed i can paste it in and see how it works
it's like "make clean" what he meant, not just try again.


Forum Jump: