format code

This commit is contained in:
Maschell 2020-07-22 15:12:25 +02:00
parent da8dfaafed
commit 75d940884d
10 changed files with 526 additions and 509 deletions

View File

@ -12,7 +12,6 @@
#include "elf_abi.h" #include "elf_abi.h"
int32_t LoadFileToMem(const char *relativefilepath, char **fileOut, uint32_t *sizeOut) { int32_t LoadFileToMem(const char *relativefilepath, char **fileOut, uint32_t *sizeOut) {
char path[256]; char path[256];
int result = 0; int result = 0;
@ -39,6 +38,7 @@ exit:
WHBUnmountSdCard(); WHBUnmountSdCard();
return result; return result;
} }
static void InstallMain(void *data_elf); static void InstallMain(void *data_elf);
uint32_t load_loader_elf_from_sd(unsigned char *baseAddress, const char *relativePath) { uint32_t load_loader_elf_from_sd(unsigned char *baseAddress, const char *relativePath) {

View File

@ -23,7 +23,6 @@
#define KERN_HEAP_PHYS 0x1B800000 #define KERN_HEAP_PHYS 0x1B800000
#define KERN_CODE_READ 0xFFF023D4 #define KERN_CODE_READ 0xFFF023D4
#define KERN_CODE_WRITE 0xFFF023F4 #define KERN_CODE_WRITE 0xFFF023F4
#define KERN_DRVPTR 0xFFEAB530 #define KERN_DRVPTR 0xFFEAB530
@ -178,7 +177,9 @@ int exploitThread(int argc, char **argv) {
free(gx2CommandBuffer); free(gx2CommandBuffer);
return 0; return 0;
} }
void KernelWriteU32(uint32_t addr, uint32_t value); void KernelWriteU32(uint32_t addr, uint32_t value);
extern "C" void SC_KernelCopyData(uint32_t dst, uint32_t src, uint32_t len); extern "C" void SC_KernelCopyData(uint32_t dst, uint32_t src, uint32_t len);
void KernelWrite(uint32_t addr, const void *data, uint32_t length) { void KernelWrite(uint32_t addr, const void *data, uint32_t length) {

View File

@ -20,6 +20,7 @@ extern const uint8_t launch_image_tga[];
extern const uint32_t launch_image_tga_size; extern const uint32_t launch_image_tga_size;
static void uhs_exploit_init(int uhs_handle); static void uhs_exploit_init(int uhs_handle);
static int uhs_write32(int uhs_handle, int arm_addr, int val); static int uhs_write32(int uhs_handle, int arm_addr, int val);
//!------Variables used in exploit------ //!------Variables used in exploit------

View File

@ -27,6 +27,7 @@
#include "ios_exploit.h" #include "ios_exploit.h"
#include "gx2sploit.h" #include "gx2sploit.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -33,18 +33,31 @@
class StringTools { class StringTools {
public: public:
static BOOL EndsWith(const std::string &a, const std::string &b); static BOOL EndsWith(const std::string &a, const std::string &b);
static const char *byte_to_binary(int32_t x); static const char *byte_to_binary(int32_t x);
static std::string removeCharFromString(std::string &input, char toBeRemoved); static std::string removeCharFromString(std::string &input, char toBeRemoved);
static const char *fmt(const char *format, ...); static const char *fmt(const char *format, ...);
static const wchar_t *wfmt(const char *format, ...); static const wchar_t *wfmt(const char *format, ...);
static int32_t strprintf(std::string &str, const char *format, ...); static int32_t strprintf(std::string &str, const char *format, ...);
static std::string strfmt(const char *format, ...); static std::string strfmt(const char *format, ...);
static BOOL char2wchar_t(const char *src, wchar_t *dest); static BOOL char2wchar_t(const char *src, wchar_t *dest);
static int32_t strtokcmp(const char *string, const char *compare, const char *separator); static int32_t strtokcmp(const char *string, const char *compare, const char *separator);
static int32_t strextcmp(const char *string, const char *extension, char seperator); static int32_t strextcmp(const char *string, const char *extension, char seperator);
static char *str_replace(char *orig, char *rep, char *with); static char *str_replace(char *orig, char *rep, char *with);
static const char *FullpathToFilename(const char *path); static const char *FullpathToFilename(const char *path);
static void RemoveDoubleSlashs(std::string &str); static void RemoveDoubleSlashs(std::string &str);
static std::vector<std::string> stringSplit(const std::string &value, const std::string &splitter); static std::vector<std::string> stringSplit(const std::string &value, const std::string &splitter);
}; };

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include <whb/log.h> #include <whb/log.h>
#include <string.h> #include <string.h>