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
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    @ZeroT21, The Russians are after you lol.
  • K3Nv2 @ K3Nv2:
    Send me your ip I'll remotely fix it
  • ZeroT21 @ ZeroT21:
    @K3Nv2 my head needs fixing if I believe you
  • ZeroT21 @ ZeroT21:
    it's kinda fun watching it happen tho
  • K3Nv2 @ K3Nv2:
    It needs fixing for other things but your pc I can fix
  • ZeroT21 @ ZeroT21:
    over 300+ virus/trojians/worms after scanning, what did I do to deserve this attention lol
  • ZeroT21 @ ZeroT21:
    tho I find it funny when i receive other people's pc/laptops in this state
  • ZeroT21 @ ZeroT21:
    i wont be upgrading unless I cant run the games i want anymore
  • K3Nv2 @ K3Nv2:
    Spill water on it good excuse
  • ZeroT21 @ ZeroT21:
    @K3Nv2 that's like a valid option if someone else is paying for ya
  • K3Nv2 @ K3Nv2:
    Daddy's wallet
  • K3Nv2 @ K3Nv2:
    Ngl hogwarts legacy has good pooping music
  • OctoAori20 @ OctoAori20:
    That's uh-
  • OctoAori20 @ OctoAori20:
    That's certainly a Dairy Queen sign lmao
  • K3Nv2 @ K3Nv2:
    You should see his help wanted signs
  • OctoAori20 @ OctoAori20:
    Ugh, so many sweat-dipwads in Sploon 3 Anarchy mode tonight
  • OctoAori20 @ OctoAori20:
    I didn't know this was "Make Octo never finish Fresh Season 2024 Catalog in Splatoon 3" month, good god
  • Veho @ Veho:
    What's the point of "confirming" games you know will get released. Like Nintendo "confirming" a Zelda sequel. "We can't be sure Nintendo is working on a new Zelda game, or if a new Zelda game will ever be released, until they officially confirm it."
  • Veho @ Veho:
    "There is literally no way to know if they will ever release a new Zelda game, it's wild speculation until they officially confirm it."
  • K3Nv2 @ K3Nv2:
    Black ops was the lesser shitter line in cock a poopoo tbf just a way to let people know it hasn't died or going a different route I guess
  • K3Nv2 @ K3Nv2:
    $70 DLC per 6 months is what it turned into
    K3Nv2 @ K3Nv2: https://youtu.be/R28ZSY2Sc2A?si=H5Lb6PNkzMhAHO_P