mirror of
https://github.com/Thesola10/umd-livepatch.git
synced 2025-04-19 22:13:22 +00:00
boys, we eating good tonight
This commit is contained in:
parent
dca4cf09f4
commit
adb2a3276d
1
.ccls
1
.ccls
@ -4,6 +4,7 @@ gcc
|
|||||||
-I/usr/local/pspdev/psp/include
|
-I/usr/local/pspdev/psp/include
|
||||||
-I/usr/local/pspdev/psp/sdk/include
|
-I/usr/local/pspdev/psp/sdk/include
|
||||||
-I.
|
-I.
|
||||||
|
-I./librsync/src
|
||||||
-std=c99
|
-std=c99
|
||||||
-Os
|
-Os
|
||||||
-G0
|
-G0
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ PARAM.SFO
|
|||||||
*.elf
|
*.elf
|
||||||
*.prx
|
*.prx
|
||||||
*.a
|
*.a
|
||||||
|
librsync
|
||||||
|
17
Makefile
17
Makefile
@ -1,8 +1,12 @@
|
|||||||
|
|
||||||
|
LIBRSYNC := librsync
|
||||||
|
CMAKE := psp-cmake
|
||||||
|
|
||||||
TARGET = umd_livepatch
|
TARGET = umd_livepatch
|
||||||
C_OBJS = io_funcs.o main.o
|
C_OBJS = io_funcs.o main.o
|
||||||
OBJS = $(C_OBJS) imports.o
|
OBJS = $(C_OBJS) imports.o
|
||||||
all: $(TARGET).prx
|
all: $(TARGET).prx
|
||||||
INCDIR = $(ARKROOT)/common/include $(ARKROOT)/core/systemctrl/include
|
INCDIR = $(ARKROOT)/common/include $(ARKROOT)/core/systemctrl/include $(LIBRSYNC)/src
|
||||||
CFLAGS = -std=c99 -Os -G0 -Wall
|
CFLAGS = -std=c99 -Os -G0 -Wall
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
@ -10,7 +14,7 @@ CFLAGS += -DDEBUG=$(DEBUG)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS = -nostartfiles -L .
|
LDFLAGS = -nostartfiles -L .
|
||||||
LIBS = -lpspsystemctrl_kernel
|
LIBS = -lpspsystemctrl_kernel -lrsync
|
||||||
|
|
||||||
PSP_FW_VERSION = 660
|
PSP_FW_VERSION = 660
|
||||||
|
|
||||||
@ -27,6 +31,15 @@ libpspsystemctrl_kernel.a:
|
|||||||
$(MAKE) -C $(ARKROOT)/libs/SystemCtrlForKernel
|
$(MAKE) -C $(ARKROOT)/libs/SystemCtrlForKernel
|
||||||
cp $(ARKROOT)/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a .
|
cp $(ARKROOT)/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a .
|
||||||
|
|
||||||
|
librsync:
|
||||||
|
git clone https://github.com/librsync/librsync
|
||||||
|
|
||||||
|
librsync.a: $(LIBRSYNC)
|
||||||
|
mkdir rsync_build
|
||||||
|
cd rsync_build; $(CMAKE) $(shell realpath $(LIBRSYNC)); make
|
||||||
|
mv rsync_build/librsync.a .
|
||||||
|
rm -rf rsync_build
|
||||||
|
|
||||||
$(TARGET).prx:: libpspsystemctrl_kernel.a
|
$(TARGET).prx:: libpspsystemctrl_kernel.a
|
||||||
|
|
||||||
include $(PSPSDK)/lib/build.mak
|
include $(PSPSDK)/lib/build.mak
|
||||||
|
@ -28,7 +28,7 @@ _impl_lp_lbaToAddr(struct LbaParams *param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
_impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname, void *outdata)
|
_impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ _impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname, void *outdata
|
|||||||
};
|
};
|
||||||
|
|
||||||
ret = reserveUmdFuncs.IoDevctl(arg, devname, lp_UmdIoctl_READ_SECTORS,
|
ret = reserveUmdFuncs.IoDevctl(arg, devname, lp_UmdIoctl_READ_SECTORS,
|
||||||
¶m, sizeof param, outdata, ISO_SECTOR_SIZE);
|
¶m, sizeof param, &hdr, ISO_SECTOR_SIZE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ _impl_lp_devctlRead(PspIoDrvFileArg *arg, const char *devname,
|
|||||||
if (first_read) {
|
if (first_read) {
|
||||||
ret = reserveUmdFuncs.IoDevctl(arg, devname, cmd, param, inlen, outdata, outlen);
|
ret = reserveUmdFuncs.IoDevctl(arg, devname, cmd, param, inlen, outdata, outlen);
|
||||||
|
|
||||||
_impl_lp_readDiscHeader(arg, devname, &hdr);
|
_impl_lp_readDiscHeader(arg, devname);
|
||||||
strncpy(umd_id, hdr + 0x373, 10);
|
strncpy(umd_id, hdr + 0x373, 10);
|
||||||
umd_id[10] = 0;
|
umd_id[10] = 0;
|
||||||
Kprintf("Disc ID obtained: '%s'\n", umd_id);
|
Kprintf("Disc ID obtained: '%s'\n", umd_id);
|
||||||
|
16
rpatch.c
Normal file
16
rpatch.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "io_funcs.h"
|
||||||
|
#include "rpatch.h"
|
||||||
|
|
||||||
|
#include <prototab.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
lp_PatchSet_open(const char *path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
lp_PatchSet_covered(lp_PatchSet *ps, u32 offset)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
20
rpatch.h
Normal file
20
rpatch.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef __RPATCH_H
|
||||||
|
#define __RPATCH_H
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
long sector_start;
|
||||||
|
long sector_count;
|
||||||
|
|
||||||
|
/* If zero, block is unchanged */
|
||||||
|
long patch_start;
|
||||||
|
|
||||||
|
/* If smaller than sector_count, repeating data */
|
||||||
|
long patch_len;
|
||||||
|
} lp_Patch;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
} lp_PatchSet;
|
||||||
|
|
||||||
|
#endif //__RPATCH_H
|
Loading…
x
Reference in New Issue
Block a user