HowTo add Kernel access under FW2.50/2.60 VSH (eLoader-TIFF)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
0okm0000
Posts: 116
Joined: Fri Jan 13, 2006 9:51 am
Contact:

HowTo add Kernel access under FW2.50/2.60 VSH (eLoader-TIFF)

Post by 0okm0000 »

sample
Download-Link : http://rapidshare.de/files/33680044/25_ ... A.zip.html

main.c
add line extern void kernel_ent(u32 Temp);
and write Kernel access in a function
use kernel_ent((u32) &your_function) to call it

Code: Select all

// -------------------------------------------
// Kernel access under FW2.50/2.60 VSH
// use Noobz's eLoader(TIFF) 0.9.8
// -------------------------------------------
// Game mode Kernel access by hitchhikr / Neural.
// VSH mode Kernel access by moonlight
// Mod. by 0okm
// -------------------------------------------

// -------------------------------------------
// Include
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

PSP_MODULE_INFO&#40;"25_26_VSH_KA", 0, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER&#41;;

#define printf	pspDebugScreenPrintf

extern void kernel_ent&#40;u32 Temp&#41;;

void Dump_kmem&#40;void&#41;
&#123;
	int handle;
	handle = sceIoOpen&#40;"ms0&#58;/0x88000000-kmem.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777&#41;;
	sceIoWrite&#40;handle, &#40;void*&#41; 0x88000000 , 0x400000&#41;;
	sceIoClose&#40;handle&#41;;
&#125;

void Dump_klib&#40;void&#41;
&#123;
	int handle;
	handle = sceIoOpen&#40;"ms0&#58;/0x88800000-klib.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777&#41;;
	sceIoWrite&#40;handle, &#40;void*&#41; 0x88800000 , 0x100000&#41;;
	sceIoClose&#40;handle&#41;;
&#125;

void Dump_boot&#40;void&#41;
&#123;
	int handle;
	handle = sceIoOpen&#40;"ms0&#58;/0xBFC00000-boot.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777&#41;;
	sceIoWrite&#40;handle, &#40;void*&#41; 0xBFC00000 , 0x100000&#41;;
	sceIoClose&#40;handle&#41;;
&#125;

int main&#40;int argc, char* argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;
	printf&#40;"\n"&#41;;
	printf&#40;" Kernel access under FW2.50/2.60 VSH\n"&#41;;
	printf&#40;" use Noobz's eLoader&#40;TIFF&#41; 0.9.8\n\n"&#41;;

	printf&#40;" Game mode Kernel access by hitchhikr / Neural.\n"&#41;;
	printf&#40;" VSH mode Kernel access by moonlight\n"&#41;;
	printf&#40;" Mod. by 0okm\n\n"&#41;;

	printf&#40;" FW ver is 0x%.8X\n\n", sceKernelDevkitVersion&#40;&#41;&#41;;

	SceCtrlData pad;
	sceCtrlSetSamplingCycle&#40;0&#41;;
	sceCtrlSetSamplingMode&#40;0&#41;;
	u32 oldButtons = 0;

	printf&#40;" Pass &#91;TRIANGLE&#93; to Kernel mem. Dump\n"&#41;;
	printf&#40;" Pass &#91;SQUARE&#93; to Kernel lib. Dump\n"&#41;;
	printf&#40;" Pass &#91;CIRCLE&#93; to Kernel boot Dump\n"&#41;;
	printf&#40;" Pass &#91;CROSS&#93; to EXIT\n\n"&#41;;
	while &#40;1&#41;
	&#123;
		sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		if &#40;oldButtons != pad.Buttons&#41;
		&#123;
			oldButtons = pad.Buttons;
			if &#40;pad.Buttons & PSP_CTRL_TRIANGLE&#41;
			&#123;
				kernel_ent&#40;&#40;u32&#41; &Dump_kmem&#41;;

				pspDebugScreenSetTextColor&#40;0xFFFF0000&#41;;
				printf&#40;" Kernel mem. Dump Finish\n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_SQUARE&#41;
			&#123;
				kernel_ent&#40;&#40;u32&#41; &Dump_klib&#41;;

				pspDebugScreenSetTextColor&#40;0xFF00FF00&#41;;
				printf&#40;" Kernel lib. Dump Finish\n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_CIRCLE&#41;
			&#123;
				kernel_ent&#40;&#40;u32&#41; &Dump_boot&#41;;

				pspDebugScreenSetTextColor&#40;0xFF0000FF&#41;;
				printf&#40;" Kernel boot Dump Finish\n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_CROSS&#41;
			&#123;
				sceKernelExitGame&#40;&#41;;
			&#125;
			sceDisplayWaitVblankStart&#40;&#41;;
		&#125;
	&#125;

	return&#40;0&#41;;
&#125;
Makefile
in line OBJS add kernel_ex.o
in line LIBS add -lpspvshbridge

Code: Select all

TARGET = 25_26_VSH_KA
OBJS = main.o kernel_ex.o

INCDIR =
CFLAGS = -G0 -Wall -O2
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =
LIBS= -lpspvshbridge

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = FW2.50/2.60 VSH Kernel access
PSP_EBOOT_ICON = ICON0.PNG

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
PSP hardware hack
http://0okm.blogspot.com/
Pit0711
Posts: 54
Joined: Thu Mar 24, 2005 5:45 am
Location: Old Europe -Germany-

Post by Pit0711 »

uuuh, nice
Post Reply