Random Homebrew: iFind Media Portal
Open TXT files; Chat to your Friends; Find your links; Password Protection; Play Games; Run Applicat [...]
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

[Solved] Patching module offsets...

Forum rules
Any post not directly related to programming will be moderated.
Do not request people to code something for you.
Avoid posting messages that do not bring anything to the conversation. We want the threads in this subforum to stay focused.

[Solved] Patching module offsets...

Postby frostegater » Fri Aug 12, 2011 6:49 pm

Hello,
Could you help me, please? I need to patch an offset in one module, for example SysconfPlugin offset..

IF FW = 401 offset = 0x00007708,
If FW = 620 offset = 0x0002BDB4,
if FW = 635 offset = 0x0002C724,
... etc...

Also..
patching sceIOFileManager Module...

example (from cxmb)..

Code: Select all
   tSceModule * pMod = ( tSceModule * )sceKernelFindModuleByName( "sceIOFileManager" );
   unsigned int addr = 0;
   if ( !pMod )
      return 0;
   if ( fw_version == FW_371 )
      addr = pMod->text_addr + 0x00002844;
   else if (  fw_version == FW_380
         || fw_version == FW_390 )
      addr = pMod->text_addr + 0x00002808;
   else if ( fw_version == FW_401 )
      addr = pMod->text_addr + 0x000027EC;

   return addr;


P.S. I don't ask you to do it yourself, but help me to find the way to do this.
Last edited by frostegater on Sun Aug 14, 2011 6:34 am, edited 1 time in total.
Ugly planes don`t fly. © Alexey Tupolev
frostegater
Guru
 
Posts: 422
Joined: Mon Jan 24, 2011 1:54 pm
Location: Russia, Magadan

Re: Patching module offsets...

Postby RNB_PSP » Fri Aug 12, 2011 7:15 pm

I don't have any knowledge about that but maybe [url=code.google.com/p/holdpsp]hold+'s source[/url] might help you. I saw it's source and it's patching some functions.
Image
Image
RNB_PSP
 
Posts: 140
Joined: Mon Jan 17, 2011 9:18 pm
Location: In your dreams.....

Re: Patching module offsets...

Postby frostegater » Sat Aug 13, 2011 5:52 am

RNB_PSP wrote:I don't have any knowledge about that but maybe [url=code.google.com/p/holdpsp]hold+'s source[/url] might help you. I saw it's source and it's patching some functions.

No. It does not help.
Ugly planes don`t fly. © Alexey Tupolev
frostegater
Guru
 
Posts: 422
Joined: Mon Jan 24, 2011 1:54 pm
Location: Russia, Magadan

Re: Patching module offsets...

Postby JJS » Sat Aug 13, 2011 6:11 am

What exactly is your question? I mean the code snippet you posted already gives you the memory address where you need to apply your patch. So all you need to do now is write whatever you want there.

Basically if you want to set it to 0 you would write:
Code: Select all
*(unsigned int*)addr = 0;

or
Code: Select all
_sw(0, addr);
JJS
Big Beholder
 
Posts: 1516
Joined: Mon Sep 27, 2010 2:18 pm

Re: Patching module offsets...

Postby frostegater » Sat Aug 13, 2011 7:33 am

JJS wrote:What exactly is your question? I mean the code snippet you posted already gives you the memory address where you need to apply your patch. So all you need to do now is write whatever you want there.

Basically if you want to set it to 0 you would write:
Code: Select all
*(unsigned int*)addr = 0;

or
Code: Select all
_sw(0, addr);

I know it ...but...
How can I find the right memory address?
Ugly planes don`t fly. © Alexey Tupolev
frostegater
Guru
 
Posts: 422
Joined: Mon Jan 24, 2011 1:54 pm
Location: Russia, Magadan

Re: Patching module offsets...

Postby m0skit0 » Sat Aug 13, 2011 11:12 pm

Do a memory dump and search for the values you want to subsitute.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4787
Joined: Mon Sep 27, 2010 6:01 pm

Re: Patching module offsets...

Postby some1 » Sat Aug 13, 2011 11:56 pm

Well, all you have to do is dump the files for the OFW that you already know the offset, and the target OFW(using psardumper), and then compare the one you already know, and try finding the exact same instruction/function/section in the new OFW. This will require atleast minimal knowledge of mips btw.

I checked a 401 dump and it seems

Code: Select all
addr = pMod->text_addr + 0x000027EC;


is a function, the address for 635 will probably be 0x00002A38 (I did this quickly, so double check this).
way to keep a secret malloxis...erm jeerum
Hmm, a demo user mode exploit doesn't seem as important anymore, I wonder why... xP
some1
HBL Collaborator
 
Posts: 146
Joined: Sun Dec 12, 2010 4:19 am

Re: Patching module offsets...

Postby frostegater » Sun Aug 14, 2011 6:32 am

some1 wrote:Well, all you have to do is dump the files for the OFW that you already know the offset, and the target OFW(using psardumper), and then compare the one you already know, and try finding the exact same instruction/function/section in the new OFW. This will require atleast minimal knowledge of mips btw.

I checked a 401 dump and it seems

Code: Select all
addr = pMod->text_addr + 0x000027EC;


is a function, the address for 635 will probably be 0x00002A38 (I did this quickly, so double check this).


0x00002A44. Thanks! I understand how it is.

6.60 offset: 0x00002A4C

Attach: cxmb 3.71 - 6.60(I checked. It works. Source code included.)...
Attachments
cxmb_371_660_u2.rar
(28.77 KiB) Downloaded 17744 times
Ugly planes don`t fly. © Alexey Tupolev
frostegater
Guru
 
Posts: 422
Joined: Mon Jan 24, 2011 1:54 pm
Location: Russia, Magadan

Re: [Solved] Patching module offsets...

Postby m0skit0 » Sun Aug 14, 2011 11:03 am

Meh some1, let him do it himself ;)
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4787
Joined: Mon Sep 27, 2010 6:01 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests