Page 1 of 1

Map Resigning tutorial (Visual Basic)

Posted: Thu May 24, 2007 11:59 pm
by jebmodillion
Now I know everyone (for the most part) knows how to make a map resigner but some do not. In this tut you will learn how to make a halo 2 map resigner... duh

-note-
Please type this and not copy and paste because you will learn more.

Any ways lets get started:

First:
-Open up visual basic and start a new project.
-Name it what ever you want.

Second:
You need to add one button... Yep one button
Then make it look all pretty
And finaly add a open file dialog and rename it ofd.

Third:
We need to import System.IO so go to the forms code page and at the top type the following line of coding:


"This opens up the Binary reading and writing so we can use it
"It also does more but you don't need to now that for this

Imports System.IO



Next

Go back to the form design page and go to the code page of your button that you added.

Type this code:

"This filters out any file besides a halo/halo2 map

ofd.Title = "Open a Map"
ofd.Filter = "Map (*.map)|*.map"


Then this code:

"Basicaly this say if all of the above worked then procced.

If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

Next this code:
"This lets us read and write inside our selected map

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))


After that this code:

"This is how our program finds the signature of the map

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


Then this:

"This tell our program where to write the signature

BW.BaseStream.Position = 720
BW.Write(Signature)
BR.Close()
BW.Close()

After all that top it off with a measage box:

"This is a msg box that lets you know when it is done.

MsgBox("Your words here! New signature is 0x" & Hex(Signature))

Finish it off with this:

End If




Well thats the tutorial!

Very simple

Have fun with it

If you have any questions just post them

Please leave feed back if you used this tut.

Thanks alot and once again have fun

Posted: Fri May 25, 2007 8:58 am
by xbox7887
Maybe you should explain what it does and how it actually works. You leave them no option other than to copy and paste...comments are key :X

Posted: Fri May 25, 2007 9:22 am
by kibito87
xbox7887 wrote:Maybe you should explain what it does and how it actually works. You leave them no option other than to copy and paste...comments are key :X
My thoughts exactly.

Posted: Fri May 25, 2007 11:41 am
by jebmodillion
Yeah I was planing on it but I was in a rush jast knight.
Ill fix it up in a minute becuase I have some stuff to do.

Posted: Sat May 26, 2007 5:02 pm
by Patrickssj6
You copied this tutorial.It's already on this forum by xXAntmanXx