forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
0okm0000



Joined: 13 Jan 2006
Posts: 116

PostPosted: Wed Sep 20, 2006 1:04 am    Post subject: HowTo add Kernel access under FW2.50/2.60 VSH (eLoader-TIFF) Reply with quote

sample
Download-Link : http://rapidshare.de/files/33680044/25_26_VSH_KA.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:

// -------------------------------------------
// 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("25_26_VSH_KA", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);

#define printf   pspDebugScreenPrintf

extern void kernel_ent(u32 Temp);

void Dump_kmem(void)
{
   int handle;
   handle = sceIoOpen("ms0:/0x88000000-kmem.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
   sceIoWrite(handle, (void*) 0x88000000 , 0x400000);
   sceIoClose(handle);
}

void Dump_klib(void)
{
   int handle;
   handle = sceIoOpen("ms0:/0x88800000-klib.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
   sceIoWrite(handle, (void*) 0x88800000 , 0x100000);
   sceIoClose(handle);
}

void Dump_boot(void)
{
   int handle;
   handle = sceIoOpen("ms0:/0xBFC00000-boot.BIN", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
   sceIoWrite(handle, (void*) 0xBFC00000 , 0x100000);
   sceIoClose(handle);
}

int main(int argc, char* argv[])
{
   pspDebugScreenInit();
   printf("\n");
   printf(" Kernel access under FW2.50/2.60 VSH\n");
   printf(" use Noobz's eLoader(TIFF) 0.9.8\n\n");

   printf(" Game mode Kernel access by hitchhikr / Neural.\n");
   printf(" VSH mode Kernel access by moonlight\n");
   printf(" Mod. by 0okm\n\n");

   printf(" FW ver is 0x%.8X\n\n", sceKernelDevkitVersion());

   SceCtrlData pad;
   sceCtrlSetSamplingCycle(0);
   sceCtrlSetSamplingMode(0);
   u32 oldButtons = 0;

   printf(" Pass [TRIANGLE] to Kernel mem. Dump\n");
   printf(" Pass [SQUARE] to Kernel lib. Dump\n");
   printf(" Pass [CIRCLE] to Kernel boot Dump\n");
   printf(" Pass [CROSS] to EXIT\n\n");
   while (1)
   {
      sceCtrlReadBufferPositive(&pad, 1);
      if (oldButtons != pad.Buttons)
      {
         oldButtons = pad.Buttons;
         if (pad.Buttons & PSP_CTRL_TRIANGLE)
         {
            kernel_ent((u32) &Dump_kmem);

            pspDebugScreenSetTextColor(0xFFFF0000);
            printf(" Kernel mem. Dump Finish\n");
         }
         if (pad.Buttons & PSP_CTRL_SQUARE)
         {
            kernel_ent((u32) &Dump_klib);

            pspDebugScreenSetTextColor(0xFF00FF00);
            printf(" Kernel lib. Dump Finish\n");
         }
         if (pad.Buttons & PSP_CTRL_CIRCLE)
         {
            kernel_ent((u32) &Dump_boot);

            pspDebugScreenSetTextColor(0xFF0000FF);
            printf(" Kernel boot Dump Finish\n");
         }
         if (pad.Buttons & PSP_CTRL_CROSS)
         {
            sceKernelExitGame();
         }
         sceDisplayWaitVblankStart();
      }
   }

   return(0);
}


Makefile
in line OBJS add kernel_ex.o
in line LIBS add -lpspvshbridge
Code:

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

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

LIBDIR =
LDFLAGS =
LIBS= -lpspvshbridge

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

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

_________________
PSP hardware hack
http://0okm.blogspot.com/
Back to top
View user's profile Send private message Visit poster's website
Pit0711



Joined: 24 Mar 2005
Posts: 54
Location: Old Europe -Germany-

PostPosted: Wed Sep 20, 2006 2:23 am    Post subject: Reply with quote

uuuh, nice
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group