Hi,
I'm new with this site and totally understanding hexadecimal. I'm modding a pc baseball game for personal use only. I'm trying to replace the team name Athletics with A's. I did the new wav file in a audio editor and tried placing it into the game. It played at home games but not in road games. I was wondering how I can find out if the hex file has something for data file length or what could be causing the problem. I have the file if somebody could tell me how I could attach the file for somebody to take a look at. Also, could somebody tell me how to read what each pairs of digits are for???
Thanks for everybody's patience!!!
BRobby05
Converting length of time to hex.
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Converting length of time to hex.
Hello, it's nearly impossible to say anything for the reason that every program can use any approach to handle its data. If you are successful anyway with the "home games" , you seem to have found the good approach.brobby05 wrote:It played at home games but not in road games. I was wondering how I can find out if the hex file has something for data file length or what could be causing the problem.
Maybe the "road games" just use another file that you haven't discovered, or for some reason the data is reinitialized from the inside.
-
- Posts: 3906
- Joined: Jan 01, 2009 7:03
- Location: Australia
Re: Converting length of time to hex.
Not sure exactly what the question is.
Last edited by BasicCoder2 on Jan 02, 2017 19:31, edited 1 time in total.
Re: Converting length of time to hex.
Hexidecimal has very little to do with the problem at hand. Hex is simply a notation for writing numbers using 16 digits instead of 10. A hex editor is probably what you're referring to, which gives you representations of the bytes of a file using hex numbers.
As to your actual question, it's not possible to say without access to the original source code. Bytes are bytes and they only have meaning as are arbitrarily given them by the actual running computer code. There are many schemes for storing strings in memory and files. Some involve storing a length ahead of the string data itself. Others store length in a completely other place. Other simply store strings with a terminating null character (00 in hex). 90% of the time it's the latter method. I've had great luck editing binaries with a hex editor and replacing strings with other strings (same or less number of characters) and, when necessary, putting in a new null terminator. For example this is a null-terminated string:
I could edit it to be like this:
Now the program would read from this string and it would be simply "A's". Note that I don't need to delete the remaining characters (I can't really). EDIT: sorry about misspelling Athletics!
Anyway, just so you know, this forum is primarily for the discussion of programming in FreeBASIC. Your project appears to not be FreeBASIC-related, so you may want to post future questions like this is in our "Community Discussion" area, which is often where community members discuss general things, not necessarily specific to actual FreeBASIC coding.
If you're working with a section of FreeBASIC code, feel free to post it here. I don't believe it's possible to attach files (source or binary) to messages on this forum, so you won't be able to post any binaries for others to look at (and that wouldn't be legal anyway for copyrighted game binaries).
As to your actual question, it's not possible to say without access to the original source code. Bytes are bytes and they only have meaning as are arbitrarily given them by the actual running computer code. There are many schemes for storing strings in memory and files. Some involve storing a length ahead of the string data itself. Others store length in a completely other place. Other simply store strings with a terminating null character (00 in hex). 90% of the time it's the latter method. I've had great luck editing binaries with a hex editor and replacing strings with other strings (same or less number of characters) and, when necessary, putting in a new null terminator. For example this is a null-terminated string:
Code: Select all
00000000 41 74 68 65 6c 65 74 69 63 73 00 |Atheletics.|
Code: Select all
00000000 41 27 73 00 6c 65 74 69 63 73 00 |A's.letics.|
Anyway, just so you know, this forum is primarily for the discussion of programming in FreeBASIC. Your project appears to not be FreeBASIC-related, so you may want to post future questions like this is in our "Community Discussion" area, which is often where community members discuss general things, not necessarily specific to actual FreeBASIC coding.
If you're working with a section of FreeBASIC code, feel free to post it here. I don't believe it's possible to attach files (source or binary) to messages on this forum, so you won't be able to post any binaries for others to look at (and that wouldn't be legal anyway for copyrighted game binaries).