Giter VIP home page Giter VIP logo

ps4-sdk's Issues

wrong type in SceKernelEqueue

@kr105 typedef int SceKernelEqueue; has wrong type

If you try to call sceKernelDeleteEqueue with that type you will get 0x80020009 error.

SceKernelCreateEqueue call internally to syscall 362 (aka sys_kqueue) and then to syscall 557 (aka sys_namedobj_create) and then it will return in first call parameter from sceKernelCreateEqueue output from sys_kqueue plus/OR output from sys_namedobj_create left shifted 32 bits so SceKernelEqueue should be int64_t

You can check it with following code:

    SceKernelEqueue myqueue;
    int ret=sceKernelCreateEqueue(&myqueue,name);
    if(ret!=0)
    {
        debugNetPrintf(DEBUG,"Error creating event queue 0x%08X\n", ret);
        return -1;
    }
    else
    {
        debugNetPrintf(DEBUG,"Created event queue 0x%08X\n",queue);
    }
    ret=sceKernelDeleteEqueue(myqueue);
    if(ret!=0)
    {
        debugNetPrintf(DEBUG,"error sceKernelDeleteEqueue return: 0x%08X\n", ret);
    }
    else
    {
        debugNetPrintf(DEBUG,"sceKernelDeleteEqueue return: 0x%08X\n", ret);

    }

Pad input/output implemented?

@CTurt Is it possible to use this repo to receive the controllers directional input (analogue stick) whilst playing a game?

Any help is appreciated.

Thanks

Cannot compile under cygwin

The error is cannot perform PE operations on non PE output file when compiling examples.

Apparently it's a common issue on cygwin but i wasn't able to work around it yet.

Please pick a license

Please pick a license for your repo. Choosing a license allows others to easily and confidently know what they can and can not do with the things you've released.

I suggest choosing the ISC license. Here is a copy of the ISC license: https://gist.githubusercontent.com/eriknstr/84c5c986607f3e4245991480a40e2c45/raw/d998764c0e914964a380b74b28332ea0c7ca28e7/LICENSE, replace YYYY with the current year (2017), "John Doe" with your own name and [email protected] with your own e-mail address (keep the angle-brackets). Alternatively if you do not wish to include your e-mail you can just remove the placeholder e-mail and angle-brackets.

New syscall (raw) Macro does not generate proper PIC

If I compile any code with the newest SDK version (vanilla state), the following relocation error is issued:

clang -c -o build/main.o source/main.c -I/tmp/git/t/PS4-SDK/libPS4/include -I. -Iinclude -O2 -fPIC -ffreestanding -fno-builtin -Wall -masm=intel -target x86_64-scei-ps4-elf -m64 -mcmodel=large
ld.gold build/*.o -o hello.elf -L/tmp/git/t/PS4-SDK/libPS4 -L. -Llib -shared -fPIE -lPS4
ld.gold: error: /tmp/git/t/PS4-SDK/libPS4/libPS4.a(kernel.o): requires dynamic R_X86_64_PC32 reloc against 'rawSyscall' which may overflow at runtime; recompile with -fPIC
ld.gold: error: /tmp/git/t/PS4-SDK/libPS4/libPS4.a(module.o): requires dynamic R_X86_64_PC32 reloc against 'rawSyscall' which may overflow at runtime; recompile with -fPIC
Makefile:26: recipe for target 'hello.elf' failed
make: *** [hello.elf] Error 1

For an indication on the error: https://tecnocode.co.uk/2014/10/01/dynamic-relocs-runtime-overflows-and-fpic/ (though not exactly the same issue I suppose).
Basically, the way you inject the syscall isn't playing nice with generating PIC :) I think there are multiple ways to "fix" this one way or another.

I will look at it tomorrow if you don't want to invest time. I am getting frustrated with the loader, so its a more pressing issue to me right now >:(

file.h

You have a ton of errors inside file.h

For example:

define O_CREAT 0x0100

This value is most certainly NOT correct. The correct value is 0x0200, I was pulling my hair out trying to figure out why I couldn't create a file, then checked the FreeBSD code and seen the value was 0x0200.

Error: conflicting types for '__dev_t'

I attempted to run make in the libPS4 directory on Ubuntu 19.04, and got the following output:

gcc -c -o build/syscall.o source/syscall.c -Iinclude -O2 -std=c11 -fno-builtin  -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64-mabi=sysv -mcmodel=large
gcc -c -o build/semaphore.o source/semaphore.c -Iinclude -O2 -std=c11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
gcc -c -o build/jit.o source/jit.c -Iinclude -O2 -std=c11 -fno-builtin -nostartfiles -nostdlib -Wall -masm=intel -march=btver2 -mtune=btver2 -m64 -mabi=sysv -mcmodel=large
In file included from include/kernel.h:3,
                 from source/jit.c:1:
include/types.h:71:18: error: conflicting types for ‘__dev_t’
 typedef uint32_t __dev_t;
                  ^~~~~~~
In file included from /usr/include/stdint.h:27,
                 from /usr/lib/gcc/x86_64-linux-gnu/8/include/stdint.h:9,
                 from include/types.h:3,
                 from include/kernel.h:3,
                 from source/jit.c:1:
/usr/include/x86_64-linux-gnu/bits/types.h:145:25: note: previous declaration of ‘__dev_t’ was here
 __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers.  */
                         ^~~~~~~
make: *** [Makefile:21: build/jit.o] Error 1

[not an issue] Amazing work!

Hi,

Sorry to create this bogus issue but I couldn't find another way to get in touch with you after reading your 3-part article series on getting root privileges on the PS4. I was part of the WebKit developer team on the PS4 until last year, so I was really impressed at your achievements, to be honest I didn't think it would ever be done, especially the root escalation part. I hope they have read your articles too and that lessons have been learned. Oh and I'm sure my former colleague who spent months writing and maintaining the out-of-process JIT compiler must hate you 😄 (I'll ask him next time I see him)
That said it was fun to read through it and follow you slowly digging through the various layers of what I've been working on everyday for a couple of years, it still all looks very familiar.

I'd love to share stories with you, but I prefer not doing this in the open so if you're interested feel free to send me an email at [email protected].
Thanks again for that extremely interesting read!

Regards,
kromain

Cannot use in c++ (clang++)

I'm getting following error when i try to compile using your sdk:

In file included from /home/seb5594/git/PS4-SDK//libPS4/include/ps4.h:11:
/home/seb5594/git/PS4-SDK//libPS4/include/network.h:56:78: error: expected ')'
extern int (*sceNetGetsockopt)(int s, int level, int optname, void *restrict optval, soc...
^
/home/seb5594/git/PS4-SDK//libPS4/include/network.h:56:31: note: to match this '('
extern int (*sceNetGetsockopt)(int s, int level, int optname, void *restrict optval, soc...
^
1 error generated.
Makefile:33: recipe for target 'build/main.o' failed
make: *** [build/main.o] Error 1

examples wont work with elfldr

getting "not enough memory available" error when using ps4-sdk examples with elfldr - while elfldr libps4 examples seem to work fine.

Bugs in inline assembly for syscall

The inline assembly codes not in functions for syscall causes some problems.

The solution is quite a simple: Use __PIC__ macro or define syscall codes as functions.
Defining functions is the easiest way to solve the problem, but it may be a bit slower than using inline assembly code if the calling convention is different from the ordinary one.

Libc implementation warnings

Declaring standard C functions like memset as function pointers will give a warning:

../../include/libc.h:3:16: warning: built-in function 'memset' declared as non-function
extern void *(*memset)(void *destination, int value, size_t num);

Need to be able to suppress this warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.