Quantcast

Jump to content

» «
Photo

Hex Editor help

14 replies to this topic
hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#1

Posted 20 February 2008 - 06:43 PM

I'm new to binary files and I want to know how to use hex editors. I trying to modify GTA SA(EXE version 1.0) save game. I'm trying to modify save game content like mission name some stats etc. But when I do that, savegame gets corrupted. e.g. If I overwrite mission name Outrider with some text riderout and again I overwrite it with old Outrider, file gets corrupted. File's first 26 bytes are
CODE
424C 4F43 4B75 81DA 354F 7574 7269 6465 7200 0000 0000 0000 0024

If I change and then restore it to original values, GTASA can not load that file. What I'm doing wrong?

Also I want to know how to find particular thing in file. I want alter times wasted, busted, cheated stats in the file. But I could not find where in the file they are stored. I searched for text string with keywords like busted, wasted etc. But I got 0 results. Can someone tell me to find them?

Link to Save game if you need one


K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 20 February 2008 - 11:32 PM

If you restore values to exactly the same, it should work. Perhaps, your hex editor messes with the file somewhere. Try a different one.

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#3

Posted 21 February 2008 - 05:34 PM

Thanks. I'll do it.

Can you tell me how to find wasted, busted stats in .b file?

Jevon
  • Jevon

    Advocate

  • Inactive Staff
  • Joined: 21 Nov 2001
  • None

#4

Posted 21 February 2008 - 06:05 PM

http://www.gtamoddin...le=GTA_SA_Saves

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#5

Posted 22 February 2008 - 04:53 PM

QUOTE (Jevon @ Feb 21 2008, 23:35)
http://www.gtamoddin...le=GTA_SA_Saves

It seems very helpfull .

Thanks!

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#6

Posted 26 February 2008 - 03:13 AM

I'm still having problem with this. Now restoring to original hex values load the game. But I still can't change save name.
CODE

OFFSET  TYPE      DESCRIPTION
0x0000  dword     version ID
0x0004  char[100] save name
0x0068  byte      current mission pack

64 bytes are reserved for save name, and I'm not touching anything but text string "Verdant".

Here are hex values
CODE
424C 4F43 4B75 81DA 3556 6572 6461 6E74 204D 6561 646F 7773

When BLOCKu..5Verdant Meadows

CODE
424C 4F43 4B75 81DA 3556 6172 7461 6B20 204D 6561 646F 7773

When BLOCKu..5Vartak Meadows

Save name is not repeated anywhere in file, so it should have worked.

Jevon
  • Jevon

    Advocate

  • Inactive Staff
  • Joined: 21 Nov 2001
  • None

#7

Posted 26 February 2008 - 08:33 AM

No, according to your first quote 100 bytes are for the save name - 0x0064 is a hex value (i.e. base 16, not base 10 like decimal).

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#8

Posted 26 February 2008 - 03:08 PM

OK! Thanks for pointing out that. But I'm changing values in the range. It should have been worked.

Jevon
  • Jevon

    Advocate

  • Inactive Staff
  • Joined: 21 Nov 2001
  • None

#9

Posted 26 February 2008 - 03:24 PM

Vartak and Verdant aren't the same length. Are you deleting anything rather than just replacing?

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#10

Posted 27 February 2008 - 02:01 AM Edited by hmvartak, 27 February 2008 - 02:05 AM.

No, I'm not deleting anything. And it's a Vartak<space><space>Meadows. For some reason that double space is not appearing in browser. See repeated 20 in hex code.

Jevon
  • Jevon

    Advocate

  • Inactive Staff
  • Joined: 21 Nov 2001
  • None

#11

Posted 27 February 2008 - 07:19 PM

Oh yeah, I see. Not sure then I'm afraid - maybe try asking in a relevant Editing Discussion forum? Can you open the file, save it without changing anything, and still have SA load it?

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#12

Posted 28 February 2008 - 04:37 PM

Yes, I can do that. If I change name "Outrider" to "hmvartak", gtasa says it is corrupted. Thereafter if I change "hmvartak" to again "Outrider", gta can load that file. But I must admit that such restoring wasn't working few days before. It was virus problem and I had to format my disk drives.

I'm using Hex Workshop 4.23 and Cygnus Hex Editor 1.0. Both are working properly with other file formats like bmp, txt etc.

PatrickW
  • PatrickW

    GTA Juggernaut

  • The Connection
  • Joined: 07 Jan 2004
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#13

Posted 28 February 2008 - 04:50 PM

Have a look at section 3.3 from the document, that jevon linked. Savefiles do have a checksum at the end. Any change to the file, should also have a proper change of the checksum.
If the checksum is not corect, SA wil refuse to load the file.

Jevon
  • Jevon

    Advocate

  • Inactive Staff
  • Joined: 21 Nov 2001
  • None

#14

Posted 28 February 2008 - 05:14 PM

Thought it might be something little. Not very clear sad.gif

hmvartak
  • hmvartak

    Thug

  • Members
  • Joined: 17 Nov 2006
  • India

#15

Posted 29 February 2008 - 01:37 AM Edited by hmvartak, 02 March 2008 - 01:48 AM.

That was too important! Thanks for that.

But unfortunately it still not working. In my save, sum of all bytes is FFEE 2001 when save name is Outrider. If I repalce O(hex code 4F) with P(hex code 50) i.e. Putrider, then sum should increament by 1 i.e. to FFEE 2002. Game refuses to load save file with name "Putrider" and checksum FFEE 2002.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users