News: 11 March 2016 - Forum Rules

Author Topic: ps2dis help  (Read 11605 times)

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
ps2dis help
« on: June 25, 2014, 08:35:40 am »
I've tried moving a line from on location to another.
I saved the file.
How do I apply the changes to the slps file or to the iso file?
Why is the pis file bigger than the slps file?
The original slps file (SLP_255.37) is 4,159 KB, the newly created .pis file is 4,703 KB.

-Nakago

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #1 on: June 26, 2014, 07:40:56 am »
1) Don't modify directly the ISO : there are lots of other data interleaved with your file, you may very well break everything.

2) You must edit the SLP_... file. It is likely an ELF file, thus it has also other data than just code so it's not always very easy. To my knowledge, PS2DIS doesn't export ELF code. So what I do (but I'm not very proud of it) is to manually edit the code I changed, paying attention not to change the file size. You can use an hex editor or (safer) write a little script in your favorite language that does it from a clean SLP_...

You can also use a better disassembler/assembler than PS2DIS (there's one project somewhere here, but I didn't try it and I doubt it handles EE's specific instructions).

KC

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: ps2dis help
« Reply #2 on: June 26, 2014, 10:12:42 am »
2) You must edit the SLP_... file. It is likely an ELF file, thus it has also other data than just code so it's not always very easy. To my knowledge, PS2DIS doesn't export ELF code. So what I do (but I'm not very proud of it) is to manually edit the code I changed, paying attention not to change the file size. You can use an hex editor or (safer) write a little script in your favorite language that does it from a clean SLP_...
You can use armips to modify (non relocatable) ELF files. All the ELF internals are handled by it. It doesn't support all EE instructions yet, but the most common ones are there.

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #3 on: June 26, 2014, 10:29:41 am »
That's exactly the soft I was referring to :) I had just forgotten its name  :-\

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: ps2dis help
« Reply #4 on: June 27, 2014, 02:53:40 am »
Armips is not working.
I'm getting this error message,
slps_255.37(1) fatal error: No architecture specified
What am I doing wrong?
The readme.txt file is not very helpful.

krat0s

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: ps2dis help
« Reply #5 on: June 27, 2014, 02:07:28 pm »
I've tried moving a line from on location to another.
I saved the file.
How do I apply the changes to the slps file or to the iso file?
Why is the pis file bigger than the slps file?
The original slps file (SLP_255.37) is 4,159 KB, the newly created .pis file is 4,703 KB.

-Nakago


You do not just move it, In fact you edit the first line with the second line instruction, and the second line with the first line instruction. Hightlight a line and then press enter, to edit attributes.
What you do is that you save the file as .PIS, PS3DIS Peoject file, and not as binary, so File->Save As Binary.

Remeber PS2Dis only opens ELF files, despite the SLPS is follwed by a number it is an ELF file, and the instrucions are in MIPS so you must know what are you doing. Use Apache 1.1 to replace the SLPS file on the iso.

Cheers.


June 27, 2014, 02:14:02 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
2) You must edit the SLP_... file. It is likely an ELF file, thus it has also other data than just code so it's not always very easy. To my knowledge, PS2DIS doesn't export ELF code. So what I do (but I'm not very proud of it) is to manually edit the code I changed, paying attention not to change the file size. You can use an hex editor or (safer) write a little script in your favorite language that does it from a clean SLP_...

You can also use a better disassembler/assembler than PS2DIS (there's one project somewhere here, but I didn't try it and I doubt it handles EE's specific instructions).
2. That is not true. Ps2Dis as old as it is , it rocks for PS2 binary file, and ELF files are executable files for the Ps2, and the SLPS file is an ELF. Guessing from the name, the game is Jap region. Ps2Dis, has syscall labels, EE emulation and many more neat features. Also used for PSP.
3. The only one c;osely tp Ps2Dis is IDA PRO. but still it does not have full supoprt. Armips  hasPSX support but not PS2 support.
Cheers.
« Last Edit: June 27, 2014, 02:14:02 pm by krat0s »

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #6 on: June 27, 2014, 06:22:02 pm »
2. That is not true. Ps2Dis as old as it is , it rocks for PS2 binary file, and ELF files are executable files for the Ps2, and the SLPS file is an ELF. Guessing from the name, the game is Jap region. Ps2Dis, has syscall labels, EE emulation and many more neat features. Also used for PSP.

Are you talking about export or import ? If it's clear that ps2dis works perfectly for opening ELF files (see * though), I didn't succeed in exporting a working ELF file (But as said, it was no big deal, I just patched the code by hand, which is nice because I can handle separately the patches if something break).

* As to PSP, ps2dis didn't manage well the only hack I tried with it (it was not strictly an ELF but the enhanced version the PSP uses - forgot its name) due to the fact it was relocatable code (so it had bad addresses). I didn't try with PS2 relocatable code.

krat0s

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: ps2dis help
« Reply #7 on: June 27, 2014, 07:12:33 pm »
Are you talking about export or import ? If it's clear that ps2dis works perfectly for opening ELF files (see * though), I didn't succeed in exporting a working ELF file (But as said, it was no big deal, I just patched the code by hand, which is nice because I can handle separately the patches if something break).

* As to PSP, ps2dis didn't manage well the only hack I tried with it (it was not strictly an ELF but the enhanced version the PSP uses - forgot its name) due to the fact it was relocatable code (so it had bad addresses). I didn't try with PS2 relocatable code.

Can you please define export in here?

As for the PSP , it eas not designed for it, despite the fact that it was used. Many hackers (mostly cheats codes founder) when passed from PS2 to PSP , were very familiar with the PS2Dis and therefore they continued using it.
Cheers,

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #8 on: June 28, 2014, 01:44:15 am »
Can you please define export in here?

export = save as an ELF.

krat0s

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: ps2dis help
« Reply #9 on: June 28, 2014, 03:56:34 pm »
export = save as an ELF.
File-> Save As Binary.
There is no need to say "export" rather than saving modified ELF.
Cheers.

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: ps2dis help
« Reply #10 on: June 28, 2014, 10:28:27 pm »
File-> Save As Binary.
There is no need to say "export" rather than saving modified ELF.
Cheers.
I've tried that and then tried opening the new binary file with the hex editor.
Something was off, especially at the beginning of the file where the
data was completely different. Maybe I'm doing it wrong.
The file is also smaller; 4,142 KB whereas the original slps file is 4,159 KB
Are there any other programs that can edit a ps2 elf file?

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #11 on: June 29, 2014, 02:36:17 am »
File-> Save As Binary.
There is no need to say "export" rather than saving modified ELF.
Cheers.

For me, a binary is just the result of assembling the file.

An ELF is much more (see here) : there are headers, tables, data, ... and among them the binary.

A same binary can be encapsulated in various formats (though I don't think any other is relevant when talking about PS2, but I haven't much experience).

That's why I use 'export' rather than 'save as binary'.

I honestly don't remember if ps2dis' binary try to mimic the original ELF structure.

KC

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: ps2dis help
« Reply #12 on: June 29, 2014, 04:22:47 am »
Armips  hasPSX support but not PS2 support.
That is incorrect. As stated in my earlier post it can load and save ELF files for PSP and PS2.

Anyway, the order of sections in an ELF file is not fixed. It is not simple to perfectly recreate the same file. As long as the data contained in it is not corrupted the file will work despite having a very different order.

krat0s

  • Jr. Member
  • **
  • Posts: 31
    • View Profile
Re: ps2dis help
« Reply #13 on: June 29, 2014, 05:25:27 am »
That is incorrect. As stated in my earlier post it can load and save ELF files for PSP and PS2.

Anyway, the order of sections in an ELF file is not fixed. It is not simple to perfectly recreate the same file. As long as the data contained in it is not corrupted the file will work despite having a very different order.
The official documentation does not state support for PS2. Maybe it does work but that does not make it 100% correct.
Cheers.

KC

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: ps2dis help
« Reply #14 on: June 29, 2014, 06:49:20 am »
ELF support: https://github.com/Kingcom/armips/commit/0c869caf02f40b92b4ff2ea93c002aae820f8265
Enable PS2 architecture: https://github.com/Kingcom/armips/commit/a96790c3f72811802ce1b30f92f4086feff0ffad
Most common opcodes: https://github.com/Kingcom/armips/commit/ee329f839bbd9b2c00f3eeb5fed6c1310d8e6b4a

I can assure you that I know what my own program does. It is not complete yet, but I did clearly state so in my first post.

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: ps2dis help
« Reply #15 on: June 29, 2014, 05:28:46 pm »
This is my progress so far, this was done with the hex editor.
http://s19.photobucket.com/user/ZGMF-X13A/media/pcsx2snapswra3menu.png.html

Here is what this looks like in the hex editor.
http://s19.photobucket.com/user/ZGMF-X13A/media/madeditsnapshot1.png.html
The letter highlighted is at 0x003fc398 (or 0x004c6b98 if opening the iso with the hex editor).

Here is what I was trying to do,
http://s19.photobucket.com/user/ZGMF-X13A/media/madeditsnapshot2.png.html
My intention was to move the string file from its current address to the highlighted one
which is 0x003fc390.

I already tried this with ps2dis as well and inserted the modified binary file using Sonix ISO Editor.
It did not work.

As for using armips, not sure what to do. The readme file did not help at all.

Dashman

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: ps2dis help
« Reply #16 on: June 29, 2014, 07:22:28 pm »
@Nakago, have you tried writing the text as ASCII? Some SRW games like GC have natual support for it.

@Kingcom, I remember reading somewhere that DOL files are pretty much fancy ELF files. Do you have any plans on giving Armips support for GC / Wii games in the future? Because that would be seriously awesome.

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: ps2dis help
« Reply #17 on: June 29, 2014, 09:41:29 pm »
@Nakago, have you tried writing the text as ASCII? Some SRW games like GC have natual support for it.
I've tried, sadly it does not show up. SRWA3 only display shift jis. Perhaps its the same for all SRW games on PS2.

tryphon

  • Hero Member
  • *****
  • Posts: 736
    • View Profile
Re: ps2dis help
« Reply #18 on: June 30, 2014, 04:52:54 pm »
Is there a precompiled binary version of armips 0.8 ?

Nakago

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: ps2dis help
« Reply #19 on: July 03, 2014, 02:03:41 am »
Just wondering, does IDA Pro support Shift JIS?
Is there a tutorial for armips?
Is there a way to locate the string pointer table in either ps2dis or ida pro?