08-13-2008, 03:19 PM
I know, in this area I still feel like a noob
Sometimes, people ask, how you change the colors that are not stored in a bitmap (which themselves are integrated in the exe as socalled "Resources"). If you've never heard about hex yet, it's time to get into the matter now. Let's get started
LF2 was programmed in C, a language that looks like this:
Well, this would be the raw code, but for a computer, a code file is not more than a useless bunch of letters. To give the computer the information that it needs to work with, you need to compile the code. Compiling = making the code unreadable for humans but very readable for the computer.
Now, our program has become something totally different. You can't really edit it anymore (except you have knowledge of hex-editing) and it's a pretty secure way of hiding algorithms.
To get back to our topic, get the exe ready (probably it's a good idea to make a backup in case you get something wrong). Then, open the hex-editor of your choice (if you don't have any, go >here<). Paste the exe in there, and you'll see a bunch of random numbers, between 00 and FF.
00-FF? Yes, this is the hexadecimal system, our common decimal system has (as you hopefully know) 10 different digits, the hexadecimal system (latin ftw!) has 16 different digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. So, FF is the same like 255 in decimal system.
Now we need another tool to work with: FarbHexe. It sounds funny, works simple but thus is easy to use. You can download it from the link a few lines ago. Start FarbHexe and then LF2 (actually, the order doesn't really matter). You have this typical blue background that doesn't really fit if you have, for example an orange skin in progress. So, we need a nice, orange color. Now, hover over the background and read what FarbHexe says:
10 20 6c
Well, that sounds promising. Go back to the hex editor, and search for the value. But if you'll look for 10206c (I'd recommend no space if you search for hex), you'll be disappointed. The problem is that not every color is in RGB (Red,Green,Blue). There are also some things in BGR (the devil knows why...). What you're ought to do is just switch the value from 10206c to 6c2010. And, surprise, you'll get a 6c2010! If you have 1.9c as a basis, the value should be in line 26ec, on the e-th place. Convenient-wise you'd write it as an offset: 26ece (For the lf2-patcher, you should add the zeros in front, so 00026ece). Let's change it to orange. I'll take this color. Since it's BGR, you have to write it as 0088FF. Be sure to have the exe already closed, so that you can save your result!
Save the change, and you should have an orange background at the start screen.
You can do the same with any color that you can't find in the bitmaps. However, you should first search for RGB, if the supposed change doesn't work at any offset, try to search for BGR.
I know, this was a lot matter for such a simple thing, I just tried to write it in a way that people with absolutely no knowledge of hex can understand it
Hope this helps
Sometimes, people ask, how you change the colors that are not stored in a bitmap (which themselves are integrated in the exe as socalled "Resources"). If you've never heard about hex yet, it's time to get into the matter now. Let's get started
LF2 was programmed in C, a language that looks like this:
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Hello World!\n");
return EXIT_SUCCESS;
}
Well, this would be the raw code, but for a computer, a code file is not more than a useless bunch of letters. To give the computer the information that it needs to work with, you need to compile the code. Compiling = making the code unreadable for humans but very readable for the computer.
Now, our program has become something totally different. You can't really edit it anymore (except you have knowledge of hex-editing) and it's a pretty secure way of hiding algorithms.
To get back to our topic, get the exe ready (probably it's a good idea to make a backup in case you get something wrong). Then, open the hex-editor of your choice (if you don't have any, go >here<). Paste the exe in there, and you'll see a bunch of random numbers, between 00 and FF.
00-FF? Yes, this is the hexadecimal system, our common decimal system has (as you hopefully know) 10 different digits, the hexadecimal system (latin ftw!) has 16 different digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. So, FF is the same like 255 in decimal system.
Now we need another tool to work with: FarbHexe. It sounds funny, works simple but thus is easy to use. You can download it from the link a few lines ago. Start FarbHexe and then LF2 (actually, the order doesn't really matter). You have this typical blue background that doesn't really fit if you have, for example an orange skin in progress. So, we need a nice, orange color. Now, hover over the background and read what FarbHexe says:
10 20 6c
Well, that sounds promising. Go back to the hex editor, and search for the value. But if you'll look for 10206c (I'd recommend no space if you search for hex), you'll be disappointed. The problem is that not every color is in RGB (Red,Green,Blue). There are also some things in BGR (the devil knows why...). What you're ought to do is just switch the value from 10206c to 6c2010. And, surprise, you'll get a 6c2010! If you have 1.9c as a basis, the value should be in line 26ec, on the e-th place. Convenient-wise you'd write it as an offset: 26ece (For the lf2-patcher, you should add the zeros in front, so 00026ece). Let's change it to orange. I'll take this color. Since it's BGR, you have to write it as 0088FF. Be sure to have the exe already closed, so that you can save your result!
Save the change, and you should have an orange background at the start screen.
You can do the same with any color that you can't find in the bitmaps. However, you should first search for RGB, if the supposed change doesn't work at any offset, try to search for BGR.
I know, this was a lot matter for such a simple thing, I just tried to write it in a way that people with absolutely no knowledge of hex can understand it
Hope this helps
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~
"Freeze, you're under vrest!" - Mark, probably.
» Gallery | » Sprites | » DeviantArt
~ Breaking LFE since 2008 ~
"Freeze, you're under vrest!" - Mark, probably.
» Gallery | » Sprites | » DeviantArt