Was able to recreate the hexing of the .exe file, i am curious on how you know which binary held the mini map file?
Well if you read through the posts above... and maybe on the black to pink thread... you can pretty much see my thought process because I wrote the posts as I was doing it.
However... just to add that plot twist that every good detective story needs: I was cheating - I didn't just work it all out now - I copied some work from a program written by some dude called ItMustBeLove in 2009 (aka Lambchops).... yeah me lol.
But what on earth I actually did 7 years ago I don't really know... i could guess - similar stuff to what I'm doing now.
I would guess that I probably first found the source list that I'm now patching, but at the time I was producing a small demo program to demonstrate that I could actually do stuff, not just get on the forum and talk crap. The plan was for a modified exe later on with all sorts of patches applied, the demo program was just an "instant" thing. So....
Now i've rediscovered it all, I'm pretty sure back then I followed the trail forwards from the source list to where it was implimented on a per game basis, then made a "live patch" that patched the current game colors in the active process memory. Still can't really remember, but that sounds about right.
So 7 years later when I wanted some info on this stuff, I knew I had worked it out before, so the first thing I did was disassemble my old app (lost the source
but that's another story) and worked out what I did back then...
From my old anticrap app i knew I was searching the random array at 0x004A48CC for E4 and changing it to FD.. and I remember that this was hot pink not the nice pastel shade that comes with Messiah's B2P, because I remember Blid politely indicating that it was all but burning his retinas out lol...
Anyway this had me looking in the right places, so I poked around a bit and came up with this list:
RED D0 D0-D3
BLUE 01 * D4-D7
TEAL D8 D8-DB
PURP DC DC-DF
OJ E0 E0-E3
BLACK E4 E4-E7
WHITE FF * E8-EB
YELLOW 02 * 0C-0F
Considering the list and the mechanism it seemed logical that if the game was randomising the entries for each player in a game (but not for fixed order games) then there must be a list of these entries somewhere IN ORDER i.e. Player 1 = Red, Player 2 = Blue, etc. - i.e. a source list.
.... at that point I just searched the PE image for that sequence of bytes: D0,01,08,DC,E0,E4,FF,02 and found it a stone's throw away from the randomised list.... obviously the I did a quick edit and test, and it worked
Oh, and as for working out what palette indexes were being used so I had something to search for, they just came originally from
good old fashioned, common or garden variety Screen-Shots. 8-bit palette based graphics are ideal for this sort of stuff.
Actually, here: you'll love this (well I do anyway). How technical is this stuff OMG! lol not as technical as you might think sometimes, logic is always the best tool and there's HUGE bonus points for cheating and making stuff dead simple. Simple is Sexy. --> Let's find what palette indicies are used to display the colors on BLUE units.Ok so first we need to find a SS that displays a blue unit. Here's one:
Cool. If we zoom in on that little guy in the bottom right we can clearly see the 4 shades of blue that are used for him and his whole tribe.
So now we need to know what the actual numbers are in this PCX file that reference the palette entry that is used to render this little group of pixels....
... so we can work out the exact (x,y) co-ordinates of each pixel we want to test, then find it's source in the PCX file.
Ok so:
The specs for PCX format are freely available online,
* source these and work out the sizes for the various header structures
* then locate the pixel data.
* then we discover that (of course) all PCX files are RLE compressed... not a huge deal
* decomopress the pixel data
* finally we apply the love-child of our (x,y) co-ords and the (w,h) dimension of the PCX file to the decompressed data stream and....
.... hey presto! if we got our sums right we got the palette index of the RGB values for that pixel. Still that's a lot of sums, I could have messed something up ... I would want to make sure it was the right value by writing back some kind of a test...... say altering this palette entry, or altering the pixmap by copying this entry to....... um ....and by now we're half way through next week.............. hmmm
..... mmmm ......
...... OR ......We could have a nice refreshing glass of sanity and say: NAH .... there's got to be an easier way..Here's what I did:... for starters I used
Irfanview to convert the PCX SS to a .BMP so I could easily edit it. Probably PaintshopPro or whatever else would work just as well, but the main thing is to MAKE SURE THAT IT STAYS AN 8 BIT PALETTIZED IMAGE (256 COLOR), if it get's converted to 24-bit you're going nowhere. This takes about 6 or 7 seconds (throw the PCX at irfanview select "Save As" .BMP - done.
At this point we're already way ahead because .BMP files aren't (by default) RLE encoded, - although they can be, however
ALL PCX files are, it's part of the spec. So, no need to worry about that, just the header files, let's see there's a BITMAP_INFO_HEADER... and
blah blah blah... nuh-uh ... not if I dont have to
Hard work?
No Problem Every time I have to, I'll kick it's ass... but when I don't have to? ..... I'll leave that for the fools and martyrs....
so I just opened the BMP in M$ Paint and used the magnifying glass thingy to zoom in on our little guy.... and then there's a little eye-dropper thingy that lets you select a color from the image.... and of course its a paint app, so we can draw a block of color.... so let's just get the lightest blue shade and make a
Big Blue Blob... damn, that was easy... let's do it again for the other 3 colors....
Sheesh, well that took all of 45 seconds. OK, so we get rid of our little magnifying-glass zoom-thingy and our SS looks like this:
Well I'm really in the mood for some graffitti today so let's do it again!
Now we've got those nice friendly pads of color to sample....
....... eye-dropper..... color rectangle, .... eye-dropper..... color rectangle, .... eye-dropper..... color rectangle....., .... eye-dropper..... color rectangle ......
...
AND TA-DAH! the finished product... what a materpiece!
Now we calculate the.... header sizes... pixmap offset... dword alignment... RLE encoding....
BAH! Yall just
KNOW I'm not gonna... hehe
--> just toss it into a hex-editor and scroll down a few pages until:Now I didn't do even one simple piece of arithmatic, but can there be any doubt whatsoever what the 4 palette entries are? I think no.
If only everything about reverse engineering software was like this.
---------------------------------------
So I did this for each of the 8 player minimap colors, then as we know the player colors for a fixed order game order (if you can't remember just look at the menu from the Blizzard .PUD editor) I arranged the 8 bytes in that order, then did a search for those 8 bytes. BINGO!
...and call me a nerdy nutter, but i absolutely LOVE that such absolutely crude and uncalculated methods can pin-point the precise location to do exactly what I set out to do, in over 700,000 bytes of exe file . That shiz just makes me giggle like a school-girl IDK, perhaps I should make out that it was all extremely complicated and it took me leading a team of NASA software engineers programming a network of helium cooled quantum processors to calculate all the variables because I'm such a freakin guru xD NAH... just 'cos I'm learning some GOW doesn't mean I have to be a complete tosser...