Making editors for cricket games

Hey Colin have you made any editors for BLIC? If so could you make a basic tutorial on how to make something.
 
Yup. I made a Lineup Correcter as there was a slight problem with the lineup editor released by Woosah. It's not totally complete or particularly useful but I can certainly explain how it works!
 
Sure, that would be great :). I was thinking of a Game Profile editor, so you can edit names without deleting the gameprofile.
 
Drewska said:
Sure, that would be great :). I was thinking of a Game Profile editor, so you can edit names without deleting the gameprofile.

There are checksum problems with doing that. Changing info without changing the checksum corrupts the file and neither me nor Tom have figured out how to do it.
 
barmyarmy said:
There are checksum problems with doing that. Changing info without changing the checksum corrupts the file and neither me nor Tom have figured out how to do it.

What have you worked out so far?

I currently am having a go at the checksum. Probably would help if I had a couple of working profiles (mine is screwed thanks to some fiddling around with a bug I got).
Actually, I could generate a new one, but it would still help if I had some others to compare.
 
Ok, I will be creating a program that will try to generate checksums for the game profile. Sorry I won't be able to make it a proper tutorial but I will post code so you can try it out as well. Looks fairly simple if you know what you're doing.
 
Oof! Just doesnt want to be cracked. Have checked for a simple checksum, doesnt seem to be any correlation between the simple checksum and the one on the file.
 
embi said:
Oof! Just doesnt want to be cracked. Have checked for a simple checksum, doesnt seem to be any correlation between the simple checksum and the one on the file.

Like I said Tom has tried without success and he is a very experienced vb programmer.
 
barmyarmy said:
Like I said Tom has tried without success and he is a very experienced vb programmer.

Hmm... it was worth a try. Not so much any more, it would be pointless the time spent trying to find the correct algorithm. They would have designed it with security in mind, so maybe not.

Have an idea i could try. backup old profile, generate new one with exactly same things as old one bar one character wrong. See what difference the checksum is.
 
What I did was to backup then change the stats slightly and see if I could simulate the change on the other profile by hex editing without doing it ingame.
 
im gonna have a go soon but i dont think im very good :(
 
K. Here's a tutorial for a BLIC editor. I'm just going to explain the display part. This is actually a pretty easy tutorial.

First make the form as follows with 4 list boxes, a button and a combobox: (obviously you can use comboboxes for each player but this is quicker for displaying)

blic1.jpg


Label as follows:

blic2.jpg


Again import system.io, inherit system.windows.forms.forms and declare our global variables:

blic3.jpg


The open sub is very simular to the c2k5 one. Just change the filter and extension. Feel free to just copy and paste this part (I do the whole time!):

blic4.jpg


Code:
System.Windows.Forms.Application.EnableVisualStyles()
        Dim strFileName As String
        With OpenFileDialog1
            .Filter = "BLIC 2005 roster file|*.bag"
            .ShowDialog()
            strFileName = .FileName
        End With
        If strFileName = vbNullString Then Exit Sub
        If Not IsNothing(FS) Then
            BR.Close()
            BW.Close()
            FS.Close()
            FS = Nothing
        End If
        FS = New FileStream(strFileName, FileMode.Open, FileAccess.ReadWrite)
        BR = New BinaryReader(FS)
        BW = New BinaryWriter(FS)
cboteams.Items.Clear()

Then we need to load up our teams combobox: (first clear it as you see above)

blic5.jpg


The longest team name is 20 charactors so we'll declare chrteam(20), also x as integer. I like using x for my loops; no idea why...

For x = 0 To 79
There are 80 teams to load so we set out loop as follows

FS.Seek((6144 + x * 3328), SeekOrigin.Begin)
6144 is the offset the first team is found at
3328 is how many bytes per team
Therefore we're adding 6144 to the team number times 3328. So first the loop will load team 0 at 6144 + 0*3328 then team 1 at 6144 + 1*3328 etc

FS.Seek(0, SeekOrigin.Current)
The team name is the first thing we find. We use seek origin current to show that it is relative to where we are at the moment and not absolute to the file.

chrTeam = BR.ReadChars(20)
Reads the next 20 bytes as ASCII charactors

cboteams.Items.Add(Convert.ToString(chrTeam))
Adds the 20 bytes converted to a string to the list box

next
Goes back to For until x = 79

cboteams.SelectedIndex = 0
Sets our teams combobox to index 0. You'll see why this is important in a minute.


Now the combobox selected index changed sub. In other words whatever will happen when we change the team.

blic6.jpg


Declare some variables and clear all 4 list boxes. This is important as, if you don't clear the list boxes, they will keep adding onto the end when you load a new team.
We're also going to define i as follows:
Code:
i = 6144 + cboteams.SelectedIndex * 3328

i therefore will equal the start byte of the selected team.

Next we'll code the test lineup listbox:

blic7.jpg


Lineups in the roster are listed by player position so if M.Vaughan is the first player in the England roster he will show as 0. There will be 11 bytes consecutively where the numbers will be anything from 0 to 15.

For x = 3238 To 3248
The test lineup is found between bytes 3238 and 3248 of the team info.

FS.Seek(i + x, SeekOrigin.Begin)
The start of the team added to the first player, then second player, then third player.

a = BR.ReadByte
Will be between 0 and 15 (16 players in a team)

FS.Seek(i + 40 + a * 168 + 2, SeekOrigin.Begin)
This calculates the player name. Byte 40 is where the first player name is in the team bytes. A player has 168 bytes so we multiply that by the player number. We then add 2 as the first two bytes of a player are the ID.

playername = BR.ReadChars(20)
This gives us the player name

lsttest.Items.Add(Convert.ToString(playername))
Add it to lsttest exactly the same way as we added items to the combobox.

blic8.jpg


Exactly the same for the ODI listbox. Just add to that rather than test and use different bytes.

blic9.jpg


The bowler bytes are relative not to the position in the roster but to the position in the lineup. So they will range from 0 to 9. For blank it will show 255 instead.

Code:
For x = 3260 To 3269
            FS.Seek(i + x, SeekOrigin.Begin)
            a = BR.ReadByte

Pretty obvious by now hopefully...

Code:
If a <> 255 Then
                lsttest.SelectedIndex = a
                playername = lsttest.Text
            Else
                playername = ""
            End If

Then we put an if statement in. If the byte we've read isn't 255 then we set the index of the test list box to it. We then read off what the text selected is and that is saved to variable 'playername'.
If it does equal 255 then 'playername' will show as blank: ""

lsttestbowl.Items.Add(Convert.ToString(playername))
Add the player name to the listbox and then go back and do it all again.

blic10.jpg


Exactly the same for ODI lineup.

Finally deselect the current item in the test list by putting:

Code:
lsttest.ClearSelected()

Good luck.
 
madmick96 said:
i am so o o o o o lost....

Dont try to learn them all at a time.Starting from the first tutorial,try implemting it yourself and only proceed to the next one when you are confident that you understand everything in the previous tutorial.If you didnt understand any part,then post it here and Im sure someone will be able to explain it.
 

Users who are viewing this thread

Top