hey
ive made alot of apps that run by side a game and edit it(trainers like 3rd person)
but i want to make a app that would hex a map file
so when the user presses a button at ofset 0x00000 it would be 01
jus a example
so where would i start?
i use vb 6
Hexing map
do you want to do it during runtime? if so, i dont think that's possible
otherwise, do something like this:
correct me if I'm wrong
to get the map path do something like this:
Thats .net but should be easy to understand
once again im a noob programming so feel free to point out my mistakes
otherwise, do something like this:
Code: Select all
Dim bw As New IO.BinaryWriter(New IO.FileStream(p, IO.FileMode.Open, IO.FileAccess.Write))
bw.BaseStream.Position = 0 (for dec) or &H0 (for hex) <- the offset at which to write
bw.BaseStream.WriteByte(1) <- the value you write at that byte
bw.close()
to get the map path do something like this:
Code: Select all
Dim map_path As String
Dim ofd As New OpenFileDialog
ofd.Filter = "Halo Map Files (*.map)|*.map"
If ofd.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
map_path = ofd.FileName
End If
once again im a noob programming so feel free to point out my mistakes

conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
Code: Select all
Dim bw As New IO.BinaryWriter(New IO.FileStream(map_path, IO.FileMode.Open, IO.FileAccess.Write))
bw.BaseStream.Position = 0 (for dec) or &H0 (for hex) <- the offset at which to write
bw.BaseStream.WriteByte(1) <- the value you write at that byte
bw.close()
bw.BaseStream.Position = 0 means that you are setting the binary writer to a position at the offset 0. You can also use &H0 for hex offsets.
bw.BaseStream.WriteByte(1) This writes a value of 1 to the position you are at. writing 255 would put FF at that byte, and writing 1 would put 01.
bw.close() that's just a good idea to do when done with the binary writer
now this opens the map and recieves its location map_path
Code: Select all
Dim map_path As String
Dim ofd As New OpenFileDialog
ofd.Filter = "Halo Map Files (*.map)|*.map"
If ofd.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
map_path = ofd.FileName
End If
First you create your map_path string variable
Then You create an Open File Dialog, naming it ofd
Then you set it's filter to only view/open halo maps
Then, you show the dialog, and say that if it doesn't return cancel, then set map_path to equal the location of the file you opened. That's it. So as practice instead of writing at offset 0, try writing at bytes 4 and 5, and make a simple ce/pc header converter.
to CE:
Code: Select all
bw.BaseStream.Seek(&H4, SeekOrigin.Begin)
bw.Write(&H61)
bw.BaseStream.Seek(&H5, SeekOrigin.Begin)
bw.Write(&H2)

conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
ok thanks alot im starting to get it
i can do the opening map file
but when i try and do ur example
bw.BaseStream.Seek(&H4, SeekOrigin.Begin)
bw.Write(&H61)
bw.BaseStream.Seek(&H5, SeekOrigin.Begin)
bw.Write(&H2)
i get lots of delcarations errors
Ive always used vb mostly for mem edit
but if u could help me do this ill be very grateful
thanks patrickH
i can do the opening map file
but when i try and do ur example
bw.BaseStream.Seek(&H4, SeekOrigin.Begin)
bw.Write(&H61)
bw.BaseStream.Seek(&H5, SeekOrigin.Begin)
bw.Write(&H2)
i get lots of delcarations errors
Ive always used vb mostly for mem edit
but if u could help me do this ill be very grateful
thanks patrickH
did you declare the binary writer?spikes122 wrote:ok thanks alot im starting to get it
i can do the opening map file
but when i try and do ur example
bw.BaseStream.Seek(&H4, SeekOrigin.Begin)
bw.Write(&H61)
bw.BaseStream.Seek(&H5, SeekOrigin.Begin)
bw.Write(&H2)
i get lots of delcarations errors
Ive always used vb mostly for mem edit
but if u could help me do this ill be very grateful
thanks patrickH
Dim bw As New IO.BinaryWriter(New IO.FileStream(map_path, IO.FileMode.Open, IO.FileAccess.Write))

conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||