Skip to content

Commit

Permalink
Add V1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wally4000 committed Dec 18, 2024
0 parents commit 12189ce
Show file tree
Hide file tree
Showing 18 changed files with 2,142 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.DS_Store
Binary file added EBOOT.PBP
Binary file not shown.
Binary file added IC1003.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added idstorage.prx
Binary file not shown.
Binary file added readme.pdf
Binary file not shown.
97 changes: 97 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
KeyCleaner v1.4 by Chilly Willy
===============================

To install, just copy the KeyCleaner folder in the archive to your memstick.
If you run this with HEN or on the Slim PSP, copy to the GAME folder. If you
use a custom firmware, copy to the GAME150 folder.

To use, run like normal homebrew. The first screen tells you the motherboard
and region to which the IdStorage is set. You then have three choices: exit
by pressing the CIRCLE button, analyze the IdStorage keys by pressing the
CROSS button, or dump the IdStorage keys by pressing the SQUARE button.

The first time you dump the keys, it creates a folder called 'keys', then dumps
the keys into it. If you choose to dump the keys again, the 'keys' folder will
be renamed, and a new 'keys' folder created. You can keep dumping the keys until
you have dumped them 10,000 times, or you run out of memory on the memstick.

If you press the CROSS button, you will be taken to the Analyze Keys screen.
You can choose to analyze the keys as if the motherboard were a TA-079/81,
as if it were a TA-082/86, or as if it were a TA-085. I made this selectable
in case the IdStorage keys identify the motherboard incorrectly. It will tell
you which motherboard it thinks it is in the top line. If you aren't sure,
press the SQUARE button to view a picture that shows how to tell which you
have. It is a picture of the back of a PSP (mine) with the UMD door open. The
red rectangle is the area of concern. If you have 'IC1003' printed upside down
on the motherboard in that area, you have a TA-082/86. If not, you have a
TA-079/81. Please note that all current Slim PSPs are TA-085. Press any key to
return to the Analyze Keys screen. You can choose 'Analyze TA-079/81' on a
TA-082/86, just don't choose to fix any keys it says are bad because it will
fix them as if the PSP were a 79/81. If you DO fix them as a 79/81, you can
select to analyze the keys as a TA-082/86 to fix them. The reverse is true
if you have a TA-079/81. Please don't mess with the keys on a Slim at this
time as only a few of the keys can be fixed with this version. Specifically,
keys 4, 5, 6, 0x42, 0x46, and 0x47. If you mess up any other keys, you won't
be able to fix them in KeyCleaner at this time.

If you choose 'Analyze TA-082/86' (then main reason you probably got this),
it will print a status of the keys associated with downgrading and tell you
if it thinks there is a problem. If you see 'Congratulations! Your keys
appear to be fine.', then your keys are fine. Note that 'fine' means key
5 has been patched using my method. If key 5 is patched a different way,
it'll tell you key 5 is bad and give you the option of fixing it. It isn't
REALLY bad, I'm just encouraging people to use my method of patching.

If the IdStorage isn't okay, with key 5 patched my way, it will check for
common corruption from downgraders. It currently recognizes the original
hard-down method, the original (2.71) soft-down method, and the NOOBZ (2.80
and 3.03) soft-down method. If the IdStorage matches one of those downgrade
methods, it then goes to the Fix Keys screen. You will be asked if you
REALLY wish to attempt fixing the keys. If you tell it to do so, it then
fixes all corrupted keys. This version of KeyCleaner can fix ALL the keys
without any files, so you don't need any other files as in previous versions.
If one of the common downgrader methods is not recognized, KeyCleaner then
checks certain individual keys that are commonly bad for one reason or
another. This version of KeyCleaner can fix keys 4, 5, 6, 0x42, 0x43, 0x46,
and 0x47. If key 0x46 or 0x47 don't exist, it will create it, then fix it.
Old TA-079 PSPs often are missing 0x46 and 0x47. That is fine - it is the
way those PSPs were. Don't feel you have to fix those two keys.

If the analysis shows all the keys to be fine, and key 5 patched with my
method, it will ask if you wish to unpatch key 5. Do NOT do that unless
you have the custom IPL or are running your TA-082/86 on official Sony
firmware with HEN (homebrew enabler) or you WILL brick the PSP! Given
Pandora has made changing the firmware easy, and bricks recoverable,
KeyCleaner has changed to reflect this. It can unpatch key 5 as part of
the visible main key handling so that people with the custom IPL or people
wishing to run 3.30 or newer Sony firmware have an easy way to clean up
their keys and unpatch key 5. If you aren't sure if your PSP will run
with an unpatched key 5, DO NOT UNPATCH IT!!

This version of KeyCleaner will load the background and text colors from
the file "textcolors.bin". If the file is missing, it will default to the
old color scheme - white text on a black background. The new colors in the
textcolors.bin supplied are white text on a warm blue background. The way
to change the colors is to load textcolors.bin into a hex editor and change
it as follows:

Byte 0: 00
Byte 1: red intensity for background (00 to FF)
Byte 2: green intensity for background (00 to FF)
Byte 3: blue intensity for background (00 to FF)
Byte 4: 00
Byte 5: red intensity for text (00 to FF)
Byte 6: green intensity for text (00 to FF)
Byte 7: blue intensity for text (00 to FF)

For example, the contents of the default textcolors.bin is:
00 20 60 A0 00 FF FF FF

Acknowledgements
================
This program was made possible by the efforts of many people. I'd like to
thank idstoragefix, codes02, Stapol, Mathieulh, harleyg, Jas0nuk, and Dark_AleX. If anyone
else thinks they deserve some credit, let me know. :)

Chilly Willy's email: [email protected]
Chilly Willy's Ice Flow: http://groups.google.com/group/chilly-willys-ice-flow/?hl=en
10 changes: 10 additions & 0 deletions src/IdStorage.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.set noreorder

#include "pspstub.s"

STUB_START "IdStorage",0x40090000,0x00040005
STUB_FUNC 0xBE861F44,ReadKey
STUB_FUNC 0x5E4510CC,WriteKey
STUB_FUNC 0x971C5683,CreateKey
STUB_FUNC 0x3E808F59,DeleteKey
STUB_END
Binary file added src/icon0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/idstorageprx/IdStorage.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.set noreorder

#include "pspstub.s"

STUB_START "IdStorage",0x40090000,0x00040005
STUB_FUNC 0xBE861F44,ReadKey
STUB_FUNC 0x5E4510CC,WriteKey
STUB_FUNC 0x971C5683,CreateKey
STUB_FUNC 0x3E808F59,DeleteKey
STUB_END
21 changes: 21 additions & 0 deletions src/idstorageprx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TARGET = idstorage
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

BUILD_PRX = 1
PRX_EXPORTS = idstorage.exp

USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1

LIBDIR =
LDFLAGS = -mno-crt0 -nostartfiles
LIBS = -lpspkernel


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
18 changes: 18 additions & 0 deletions src/idstorageprx/idstorage.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Define the exports for the prx
PSP_BEGIN_EXPORTS

# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END

PSP_EXPORT_START(IdStorage, 0, 0x4001)
PSP_EXPORT_FUNC(ReadKey)
PSP_EXPORT_FUNC(WriteKey)
PSP_EXPORT_FUNC(CreateKey)
PSP_EXPORT_FUNC(DeleteKey)
PSP_EXPORT_END

PSP_END_EXPORTS
82 changes: 82 additions & 0 deletions src/idstorageprx/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspidstorage.h>
#include <string.h>

PSP_MODULE_INFO("IdStorage", 0x1006, 1, 2);
PSP_MAIN_THREAD_ATTR(0);

int ReadKey(int key, char *buffer)
{
int err;
u32 k1;

k1 = pspSdkSetK1(0);

memset(buffer, 0, 512);
err = sceIdStorageReadLeaf(key, buffer);

pspSdkSetK1(k1);

return err;
}

int WriteKey(int key, char *buffer)
{
int err;
u32 k1;
char buffer2[512];

k1 = pspSdkSetK1(0);

err = sceIdStorageReadLeaf(key, buffer2);
if (err < 0)
sceIdStorageCreateLeaf(key); /* key probably missing, make it */

err = sceIdStorageWriteLeaf(key, buffer);
sceIdStorageFlush();

pspSdkSetK1(k1);

return err;
}

int CreateKey(int key)
{
int err;
u32 k1;

k1 = pspSdkSetK1(0);

err = sceIdStorageCreateLeaf(key);
sceIdStorageFlush();

pspSdkSetK1(k1);

return err;
}

int DeleteKey(int key)
{
int err;
u32 k1;

k1 = pspSdkSetK1(0);

err = sceIdStorageDeleteLeaf(key);
sceIdStorageFlush();

pspSdkSetK1(k1);

return err;
}

int module_start(SceSize args, void *argp)
{
return 0;
}

int module_stop()
{
return 0;
}
Loading

0 comments on commit 12189ce

Please sign in to comment.