forums.PPSSPP.org
PPSSPP iOS Port - Printable Version

+- forums.PPSSPP.org (https://forums.ppsspp.org)
+-- Forum: PPSSPP - Playstation Portable Simulator Suitable for Playing Portably (/forumdisplay.php?fid=1)
+--- Forum: Builds, releases and ports (/forumdisplay.php?fid=4)
+---- Forum: iOS port (/forumdisplay.php?fid=26)
+---- Thread: PPSSPP iOS Port (/showthread.php?tid=200)



RE: PPSSPP iOS Port - brujo55 - 03-04-2013 06:28 AM

Amen!.


RE: PPSSPP iOS Port - xsacha - 03-04-2013 12:56 PM

(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.


RE: PPSSPP iOS Port - rock88 - 03-04-2013 02:03 PM

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..


RE: PPSSPP iOS Port - the avenger - 03-04-2013 02:15 PM

(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/2011/06/syscan11_breaking_ios_code_signing.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.


RE: PPSSPP iOS Port - brujo55 - 03-05-2013 12:38 AM

sorry for offtopic

someone can fix the no text appears in Lunar: Silver Star Harmony,the fonts aren't packaged in properly.


RE: PPSSPP iOS Port - xsacha - 03-05-2013 01:29 AM

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.


RE: PPSSPP iOS Port - the avenger - 03-05-2013 10:24 AM

(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


RE: PPSSPP iOS Port - rock88 - 03-05-2013 01:06 PM

I try it, now app crashing in ARMXEmitter::Write32..

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


RE: PPSSPP iOS Port - the avenger - 03-05-2013 01:13 PM

(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


RE: PPSSPP iOS Port - rock88 - 03-05-2013 01:24 PM

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..


RE: PPSSPP iOS Port - the avenger - 03-05-2013 01:52 PM

(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
[attachment=1836]
any help?


RE: PPSSPP iOS Port - [Unknown] - 03-05-2013 02:32 PM

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: PPSSPP iOS Port - the avenger - 03-05-2013 03:01 PM

(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


RE: PPSSPP iOS Port - brujo55 - 03-06-2013 03:50 AM

no lucky,ios is to hard.


RE: PPSSPP iOS Port - V6ser - 03-06-2013 01:11 PM

(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.