Fix Checksum

Discussion in 'Programming & Scripting' started by redxx, Dec 30, 2008 with 12 replies and 1,094 views.

  1. redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well I'm making a app that could fix a checksum of a save that I have,I know the checksums offset and where it's being calculated from So does anyone know how or what code to use to get this done.I'm so close in finishing the app:smile:

     
  2. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,758
    Ratings:
    1,328
    alittle more info, such as h2 or h3. and what all you need to know, and what do you already know
     
  3. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well halo 2 I know how to fix the checksum and for the save that I have it's another game (Con) I saw some programs when you open up a save you edit it to do what you have to do then you fix the checksum that's on it.However with h2 I can't just put the code with this app can I anyway h3 would be pointless I would like to learn it should be the same has h2.
     
  4. nickcas

    nickcas Member

    Messages:
    1,688
    Ratings:
    805

    Could you explain that a little better? I don't understand what you're trying to do.

    If you mean fix the checksum on halo 3 saves then you need to read up on resigning Xbox 360 saves.
     
  5. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    I know how to do that already ok say if I want to hex a ps2 Final Fantasy 12 save now in the save there is two checksums one at offset 0 the other is all the way at the end of the file so when I want to edit anything the checksum will change so you will need to calculate the checksum now I know how to calulate it but I need to know how to make a app that could do this for me that is why I need help.
     
  6. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,758
    Ratings:
    1,328
    k, is this what you mean.

    Code:
    [SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] mapLoaction = [/SIZE][SIZE=2][COLOR=#800000]@"C:Map.map"[/COLOR][/SIZE][SIZE=2];[/SIZE]
    
    [SIZE=2][COLOR=#008080]FileStream[/COLOR][/SIZE][SIZE=2] map = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#008080]FileStream[/COLOR][/SIZE][SIZE=2](mapLoaction, [/SIZE][SIZE=2][COLOR=#008080]FileMode[/COLOR][/SIZE][SIZE=2].Open, [/SIZE][SIZE=2][COLOR=#008080]FileAccess[/COLOR][/SIZE][SIZE=2].ReadWrite, [/SIZE][SIZE=2][COLOR=#008080]FileShare[/COLOR][/SIZE][SIZE=2].ReadWrite);[/SIZE]
    
    [SIZE=2][COLOR=#008080]BinaryReader[/COLOR][/SIZE][SIZE=2] reader = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#008080]BinaryReader[/COLOR][/SIZE][SIZE=2](map);[/SIZE]
    [SIZE=2][COLOR=#008080]BinaryWriter[/COLOR][/SIZE][SIZE=2] writer = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#008080]BinaryWriter[/COLOR][/SIZE][SIZE=2](map);[/SIZE]
    
    [SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2] sig = 0;[/SIZE]
    [SIZE=2][COLOR=#0000ff]long[/COLOR][/SIZE][SIZE=2] amt = reader.BaseStream.Length - 4;[/SIZE]
    
    [SIZE=2]reader.BaseStream.Position = 2048;[/SIZE]
    
    [SIZE=2][COLOR=#0000ff]for[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff]long[/COLOR][/SIZE][SIZE=2] i = 2048; i <= amt; i += 4)[/SIZE]
    [SIZE=2]{[/SIZE]
    [SIZE=2]   sig ^= reader.ReadInt32();[/SIZE]
    [SIZE=2]}[/SIZE]
    
    [SIZE=2]reader.BaseStream.Position = 0;[/SIZE]
    [SIZE=2]writer.Write(sig);[/SIZE]
    
    [SIZE=2]reader.BaseStream.Position = (int)reader.BaseStream.Position.Length - 4;[/SIZE]
    [SIZE=2]writer.Write(sig);[/SIZE]
    [SIZE=2][/SIZE] 
    [SIZE=2]reader.Close();[/SIZE]
    [SIZE=2]writer.Close();[/SIZE]
    
     
  7. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well yes sort of but I'm not using this for halo so I could just edit this to work for a different game right for halo 2 this is what I used this is in vb but you the idea.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim BR As New BinaryReader(New FileStream(ofd.FileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
    Dim BW As New BinaryWriter(New FileStream(ofd.FileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
    Dim Signature As Int32 = 0
    Dim MapSize As Long = BR.BaseStream.Length
    BR.BaseStream.Position = 2048
    For i As Integer = 2048 To MapSize - 4 Step 4
    Signature = Signature Xor BR.ReadInt32
    Next
    BW.BaseStream.Position = 720
    BW.Write(Signature)
    BR.Close()
    BW.Close()
    MsgBox("Encryption fixed.signature is 0x" & Hex(Signature))
    End Sub

    But since this is for halo I don't think I could just edit the offsets it could a hole other formula.
     
  8. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,758
    Ratings:
    1,328
    for halo 2 = yes
    for anything else = no

    every file type has to be resigned differently
     
  9. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well is there any tut or something to research it and get the code that I need or there is no way of doing it I just need a guideline on doing it so I will atleast no someway of doing automatically
     
  10. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,758
    Ratings:
    1,328
    k im confised.

    Answer the question:

    What are you trying to resign?
     
  11. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well I'm just trying to resign the last renment save and I want to make a app to fix the checksum.
     
  12. GoldBl4d3

    GoldBl4d3 Retired Retired

    Messages:
    3,758
    Ratings:
    1,328
    o, then you will have to do your own research. Nobody can help you unless they know about it.
     
  13. OP
    redxx

    redxx Enthusiast

    Messages:
    170
    Ratings:
    5
    Well thx for the help anyway I was getting some help to get the info so hopefully It will work out.