code help

xdino Aug 3, 2011

  1. xd

    xdino Newbie
    0/47

    Joined:
    Aug 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Console:
    Xbox
    cant fix this error, it keeps saying that "crc.GetCrc32" isn't a member of PackageIO.Algorithms.CRC32

    Code:
    Public Sub ButtonItem2_Click(ByVal writer As DJsIO)
            Dim crc As New CRC32
            Dim stream As Stream = Me.settingsIO.GrabStream
            stream.Seek(&H1C, SeekOrigin.Begin)
            Dim stream2 As FileStream = DirectCast(stream, FileStream)
            stream = stream2
            Dim num As Integer = crc.GetCrc32(stream2)
            Me.settingsIO.Position = &H10
            Dim bytes As Byte() = BitConverter.GetBytes(num)
            Array.Reverse(bytes)
            Me.settingsIO.Write(bytes)
            Me.settingsEntry.Replace(Me.settingsIO)
            Me.package.FlushPackage(New RSAParams((Application.StartupPath & "/KV.bin")))
            If Not Me.settingsEntry.Replace(Me.settingsIO) Then
                MessageBox.Show("Error: File Not Saved")
            ElseIf Not Me.package.FlushPackage(New RSAParams((Application.StartupPath & "/KV.bin"))) Then
                MessageBox.Show("Error: Could Not Sign The Save")
            Else
                writer.Close()
            End If
    
        End Sub
    Code:
    Imports X360.IO
    Imports PackageIO.Algorithms
    Imports System.IO
    Imports X360.STFS
     
  2. c0

    c0madr0ne Newbie
    0/47

    Joined:
    Jul 19, 2009
    Messages:
    896
    Likes Received:
    109
    Trophy Points:
    0
    Console:
    Playstation 3
    its most likey crc.compute or crc.calculate
     
  3. xd

    xdino Newbie
    0/47

    Joined:
    Aug 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Console:
    Xbox
    i fixed it but im trying to change a single value for fifa but the save keeps coming up as corrupt here is all my code.

    Code:
    Imports X360.IO
    Imports X360.STFS
    Imports System.IO
    
    Public Class Form1
        Private FilePath As String = Nothing
        Dim package As Object
        Dim settingsEntry As Object
        Dim settingsIO As Object
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim Open As New OpenFileDialog
            Open.Filter = "Gamesave (*.*)|*.*"
            Open.Title = "Open Gamesave"
            Open.ShowDialog()
            FilePath = Open.FileName
            ReadFile(FilePath)
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Try
                ReadFile(FilePath)
                WriteFile(FilePath)
                MsgBox("File Saved!")
            Catch ex As Exception
                MsgBox("Error", MsgBoxStyle.Critical, "")
            End Try
        End Sub
    
        Public Sub ReadFile(ByVal FilePath As String)
            Dim Reader As New PackageIO.Reader(FilePath, PackageIO.Endian.Big)
            Reader.Position = &H557E4
            TextBox1.Text = Reader.ReadInt16
        End Sub
    
        Public Sub WriteFile(ByVal FilePath As String)
            Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)
            Writer.Position = &H557E4
            Writer.WriteInt16(CInt(TextBox2.Text))
        End Sub
        Public Sub Button2_Click(ByVal writer As DJsIO)
            Dim crc As New CRC32
            Dim stream As Stream = Me.settingsIO.GrabStream
            stream.Seek(&H1C, SeekOrigin.Begin)
            Dim stream2 As FileStream = DirectCast(stream, FileStream)
            stream = stream2
            Dim num As Integer = crc.GetCrc32(stream2)
            Me.settingsIO.Position = &H10
            Dim bytes As Byte() = BitConverter.GetBytes(num)
            Array.Reverse(bytes)
            Me.settingsIO.Write(bytes)
            Me.settingsEntry.Replace(Me.settingsIO)
            Me.package.FlushPackage(New RSAParams((Application.StartupPath & "/KV.bin")))
            If Not Me.settingsEntry.Replace(Me.settingsIO) Then
                MessageBox.Show("Error: File Not Saved")
            ElseIf Not Me.package.FlushPackage(New RSAParams((Application.StartupPath & "/KV.bin"))) Then
                MessageBox.Show("Error: Could Not Sign The Save")
            Else
                writer.Close()
            End If
        End Sub
    End Class
    Code:
    Imports System.IO
    
    Friend Class CRC32
        ' Methods
        Friend Sub New()
            Dim num5 As Integer
            Dim num2 As Integer = -306674912
            Me.crc32Table = New Integer(&H101 - 1) {}
            Dim index As Integer = 0
            Do
                Dim num As Integer = index
                Dim num4 As Integer = 8
                Do
                    If ((num And 1) > 0) Then
                        num = (((num And -2) / 2) And &H7FFFFFFF)
                        num = (num Xor num2)
                    Else
                        num = (((num And -2) / 2) And &H7FFFFFFF)
                    End If
                    num4 = (num4 + -1)
                    num5 = 1
                Loop While (num4 >= num5)
                Me.crc32Table(index) = num
                index += 1
                num5 = &HFF
            Loop While (index <= num5)
        End Sub
    
        Friend Function GetCrc32(ByRef stream As FileStream) As Integer
            Dim num2 As Integer = -1
            Dim array As Byte() = New Byte(&H401 - 1) {}
            Dim count As Integer = &H400
            Dim i As Integer = stream.Read(array, 0, count)
            Do While (i > 0)
                Dim num7 As Integer = (i - 1)
                Dim j As Integer = 0
                Do While (j <= num7)
                    Dim index As Integer = ((num2 And &HFF) Xor array(j))
                    num2 = (((num2 And -256) / &H100) And &HFFFFFF)
                    num2 = (num2 Xor Me.crc32Table(index))
                    j += 1
                Loop
                i = stream.Read(array, 0, count)
            Loop
            Return Not num2
        End Function
    
        Friend Function GetCrc32String(ByRef stream As FileStream) As String
            Return String.Format("{0:X8}", Me.GetCrc32(stream))
        End Function
    
    
        ' Fields
        Private Const BUFFER_SIZE As Integer = &H400
        Private crc32Table As Integer()
    End Class
     
  4. KillerVidz

    KillerVidz Rocky BANNED
    0/47

    Joined:
    Feb 20, 2012
    Messages:
    3,312
    Likes Received:
    1,252
    Trophy Points:
    0
    Gender:
    Male
    Location:
    XPG-UK
    Console:
    Xbox One
    Try To Rehash Resign ... There Maybe Checksum
     

Share This Page

Close