Hacking RPC Syscall Command

BullyWiiPlaza

Nintendo Hacking <3
OP
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
I tried to make a command to execute Cafe OS syscalls on demand via the following C code:
Code:
void performSystemCall(int value) {
    asm(
    "li 0, %0\n"
            "sc\n"
            "blr\n"
    : // No output
    :"r"(value) // Input
    :"0" // Overwritten register
    );
}
Code:
case COMMAND_SYS_CALL: {
    ret = recvwait(bss, clientfd, buffer, 4);
    ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (syscall)")

    int value = ((int *) buffer)[0];
    performSystemCall(value);

    break;
}
However, when it is called using e.g. value 0x6700 (which is request fast exit) the console crashes with an Exception DSI:
Code:
public void executeSystemCall(SystemCall systemCall) throws IOException
{
    try (CloseableReentrantLock ignored = reentrantLock.acquire())
    {
        sendCommand(Command.SYSTEM_CALL);
        int value = systemCall.getValue();
        dataSender.writeInt(value);
        dataSender.flush();
    }
}
According to CosmoCortney this should open the home menu.

Any ideas? My inline assembly might be wrong. I followed the documentation from here.

Thanks!

@QuarkTheAwesome
@FIX94
@dimok
@NWPlayer123
@Maschell
@gudenaurock
 

BullyWiiPlaza

Nintendo Hacking <3
OP
Member
Joined
Aug 2, 2014
Messages
1,932
Trophies
0
XP
2,477
Country
Germany
This is no longer that important because it can be circumvented by this but I'm still curious why the inline assembly crashes here while clearly the assembly code itself is fine and doesn't crash.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    fuck ubisoft, and fuck activision
    +1
  • realtimesave @ realtimesave:
    Nintendo needs to release a new console, switch is getting such shitty little games lately lol it's pathetic
  • Purple_Heart @ Purple_Heart:
    Lmao a new flashcart... The Unlock Switch... I knew it's not fake xD
    +1
  • NinStar @ NinStar:
    A new consoles won't solve that problem
  • NinStar @ NinStar:
    It will actually make it worse
  • The Real Jdbye @ The Real Jdbye:
    well actually
    a new console won't do anything right now, because the games are still in development, that's why there are few games being released
  • The Real Jdbye @ The Real Jdbye:
    it won't make the games finish any faster
  • Veho @ Veho:
    2/3rds of launch titles for the Switch 2 will just be lazy ports of Switch games anyway.
  • The Real Jdbye @ The Real Jdbye:
    probably
  • The Real Jdbye @ The Real Jdbye:
    maybe mario kart 9 will be a launch title
  • The Real Jdbye @ The Real Jdbye:
    i really want a new mario kart
  • Veho @ Veho:
    What, you mean the endless stream of DLCs doesn't count?
  • Veho @ Veho:
    Why develop a new game when you can just sell season passes forever?
  • Veho @ Veho:
    I'm still on MKDS so I'm not bothered :tpi:
  • The Real Jdbye @ The Real Jdbye:
    i like the dlc tbh, i'd like a new game more
  • ZeroT21 @ ZeroT21:
    but the current version is still selling fine at full price
  • SylverReZ @ SylverReZ:
    Hello
  • ZeroT21 @ ZeroT21:
    sup
    +1
  • SylverReZ @ SylverReZ:
    @realtimesave, You seen the Unlock Switch flashcart yet?
  • K3Nv2 @ K3Nv2:
    I'll see the 19.0 update that blocks use ability to it
    +1
  • K3Nv2 @ K3Nv2:
    Lol newegg+
    Screenshot-20240423-053504-Gmail.jpg
  • S @ salazarcosplay:
    does update 19 really block it
  • SylverReZ @ SylverReZ:
    Update 19 never came out yet. Just the 18.1.
    SylverReZ @ SylverReZ: Update 19 never came out yet. Just the 18.1.