decompile donut/Main.cpp

This commit is contained in:
Charlotte Delenk 2021-10-19 15:50:06 +02:00
parent 4c777a43f4
commit c0cc0a1bfa
Signed by: darkkirb
GPG key ID: 015E3768A70AFBC5
8 changed files with 45 additions and 2 deletions

View file

@ -4,6 +4,7 @@
"array": "c",
"string_view": "c",
"initializer_list": "c",
"utility": "c"
"utility": "c",
"types.h": "c"
},
}

View file

@ -15,3 +15,5 @@ build/obj/sdk/rvl/os/__start.o
build/obj/sdk/rvl/os/__ppc_eabi_init.o
build/obj/10.o
build/obj/11.o
build/obj/donut/Main.o
build/obj/12.o

View file

@ -9,5 +9,6 @@
800062c0,80006620,,,,,,,,,,,,,,,,,,,8055c878,8055c879,,,,,sdk/rvl/os/__start.o
80006620,80006684,,,,,,,,,,,,,,,,,,,,,,,,,sdk/rvl/os/__ppc_eabi_init.o
,,,,,,,,80406540,80406544,,,,,,,,,,,,,,,,,Linker generated symbol file
,,,,,,80174ad8,80174af8,,,,,,,,,,,,,80556b70,80556b71,,,,,donut/Main.cpp
80006684,80006728,,,,,,,8040652c,80406530,80406548,8040654c,,,,,,,,,,,,,,,Linker generated symbol file
80006728,80006728,800068cc,800068cc,800069e4,800069e4,80406244,80406244,80406530,80406530,8040654c,8040654c,80421030,80421030,804966fc,804966fc,8055640c,8055640c,8055c6d0,8055c6d0,8055df74,8055df74,805643b0,805643b0,805643fc,805643fc,End of File
1 .init start .init end extab start extab end extabindex start extabindex end .text start .text end .ctors start .ctors end .dtors start .dtors end .rodata start .rodata end .data start .data end .bss start .bss end .sdata start .sdata end .sbss start .sbss end .sdata2 start .sdata2 end .sbss2 start .sbss2 end File
9 800062c0 80006620 8055c878 8055c879 sdk/rvl/os/__start.o
10 80006620 80006684 sdk/rvl/os/__ppc_eabi_init.o
11 80406540 80406544 Linker generated symbol file
12 80174ad8 80174af8 80556b70 80556b71 donut/Main.cpp
13 80006684 80006728 8040652c 80406530 80406548 8040654c Linker generated symbol file
14 80006728 80006728 800068cc 800068cc 800069e4 800069e4 80406244 80406244 80406530 80406530 8040654c 8040654c 80421030 80421030 804966fc 804966fc 8055640c 8055640c 8055c6d0 8055c6d0 8055df74 8055df74 805643b0 805643b0 805643fc 805643fc End of File

View file

@ -18,5 +18,5 @@ Address,SymbolName
80023820,OSResetSystem
80028530,__init_user
800285a0,exit
80174ad8,main
801776bc,Run__Q23app10EntryPointFbPCc
8055c878,Debug_BBA

1 Address SymbolName
18 80023820 OSResetSystem
19 80028530 __init_user
20 800285a0 exit
21 80174ad8 801776bc main Run__Q23app10EntryPointFbPCc
22 8055c878 Debug_BBA

5
donut/Main.cpp Normal file
View file

@ -0,0 +1,5 @@
#include <app/EntryPoint.hpp>
void main(int argc, char **argv) {
app::EntryPoint::Run(false, argc == 2 ? argv[1] : "");
}

View file

@ -0,0 +1,7 @@
#pragma once
namespace app {
struct EntryPoint {
static void Run(bool debug, const char *arg);
};
} // namespace app

View file

@ -20,6 +20,7 @@ const SOURCES: &[(&str, &str)] = &[
("sdk/rvl/os/OSContext.c", "sdk"),
("sdk/rvl/os/__start.c", "sdk"),
("sdk/rvl/os/__ppc_eabi_init.c", "sdk"),
("donut/Main.cpp", "donut"),
];
const ASM_SOURCES: &[&str] = &["sdk/trk/__exception.S"];

View file

@ -60,6 +60,32 @@ static CFLAGS: Lazy<HashMap<&'static str, &'static [&'static str]>> = Lazy::new(
"4",
][..],
);
hm.insert(
"donut",
&[
"-ipa",
"file",
"-O4,p",
"-inline",
"auto",
"-gccinc",
"-i",
"./include",
"-proc",
"gekko",
"-enum",
"int",
"-fp",
"hardware",
"-Cpp_exceptions",
"off",
"-RTTI",
"off",
"-gdwarf-2",
"-func_align",
"4",
][..],
);
hm
});