Advanced Search

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Grahf78

Pages: [1]
1
Mega Man Discussion / Re: Rockman 8 FC
« on: October 09, 2017, 12:16:14 AM »
I've made some progress trying to make this game moddable.

The game is coded in C++, so I used IDA to decompile the source code and reconstruct whatever bits I could.

As we all know, all images are stored into the image.bin file, but its contents are obfuscated and can't be ripped or re-encoded easily.

All i've found for now is that this is the function that loads the images from image.bin into memory:
Code: [Select]
//----- (00403C50) --------------------------------------------------------
int __stdcall sub_403C50(int a1)
{
  FILE binFile; // eax@1
  FILE *binFilePtr; // edi@1
  FILE *logFile; // esi@2
  __int32 fileValue; // esi@4
  void *binStructure; // ebx@4
  int v6; // ecx@4
  __int32 v7; // eax@4
  int v8; // edx@5
  int v9; // esi@10
  int result; // eax@11
  int v11; // [sp+10h] [bp-78h]@4
  char v12; // [sp+18h] [bp-70h]@2

  sub_4DC770(off_61AD48);
  binFile = fopen("./image/image.bin", "r");
  binFilePtr = binFile;
  if ( !binFile )
  {
    logFile = fopen("dbg.txt", "a+");
    sprintf(&v12, "[dbg] func_name:%s, line:%d\n", "Graphics::init_bmp", 919);
    fputs(&v12, logFile);
    fclose(logFile);
    sub_4C2E00((int)binFilePtr);
    exit_1((int)binFilePtr);
  }
  //starts reading image.bin at 0x02
  //int fseek ( FILE * stream, long int offset, int origin );
  fseek(binFile, 0, 2);
  fileValue = ftell(binFilePtr);
  fseek(binFilePtr, 0, 0);
  binStructure = malloc(fileValue);
  //size_t fread ( void * ptr, size_t size, size_t count, FILE * stream );
  //Reads an array of count elements, each one with a size of size bytes, from the stream and stores them in the block of memory specified by ptr.
  fread(binStructure, 1u, fileValue, binFilePtr);
  v6 = 0;
  v7 = 0;
  v11 = 0;
  if ( fileValue > 0 )
  {
    do
    {
      v8 = *((_BYTE *)binStructure + v7++);
      v6 += v8;
    }
    while ( v7 < fileValue );
    v11 = v6;
  }
  fclose(binFilePtr);
  free(binStructure);
  if ( v11 != 250926440 )
  {
    MessageBoxA(0, "invalid external files.", "Rockman8FC", 0);
    sub_4C2E00((int)binFilePtr);
    exit_1(0);
  }
  v9 = 0;
  do
    result = sub_401590(v9++, a1);
  while ( v9 < 273 );
  return result;
}

If I read that correctly, the file is a simple data structure that needs to be serially decoded. Perhaps someone with debugging/hacking/programming skills can lend a hand?

2
Mega Man Discussion / Re: Rockman 7 FC
« on: October 09, 2017, 12:07:35 AM »
For everyone that has been wondering how to alter the text, I used some debugging skills to figure it out. I just used Cheat Engine for debugging and IDR to make the process a little easier. The game was programmed in Delphi 6 (yuck) and the full source code is impossible to reconstruct.

Basically, all text can be found in the exe but with Unicode-16 encoding (in litttle endian). You just need to open it with a hex editor that supports changing the encoding to UTF-16 and you'll be able to see and change all the text. Of course, you have to be careful not to exceed the length of the string. I used Tiny Hexer, which is free.

Here are some notes I took in the process, it contains some addresses to the text pointers:

Code: [Select]
Text lookup - unicode little endian

0030 <space>
01FF !
0EFF .
21FF A
22FF B
23FF C
24FF D
25FF E
26FF F
27FF G
28FF H
29FF I
2AFF J
2BFF K
2CFF L
2DFF M
2EFF N
2FFF O
30FF P
31FF Q
32FF R
33FF S
34FF T
35FF U
36FF V
37FF W
38FF X
39FF Y
3AFF Z
52FF r
26FF ...

String addresses

(0xD4620) - stage select
(0x0DB592) - weapon text
33FF34FF32FF29FF2BFF
STRIKE

(0xD30C0) - intro text
29FF2EFF003034FF
IN THE YEAR ...

(0x96df2) protoman text 1
(0x78e50) protoman text 2
(0x831B2) protoman text 3
(0xDD390) drlight text
(0xB06AC) bass text 1
(0xB4D98) bass text 2
(0xC1230) ending text
(0x74d90) bunch of text, unused?

As a proof of concept, here is a shoddily translated version of the game!

https://www.mediafire.com/file/b4c5d8cquxr9h5u/mm7fc.zip

EDIT: Posting an image as proof:
(click to show/hide)

After a short break I will move on to hacking Rockman 8 FC. It's way harder to mod because it's coded in C++, but i'm onto something. I'll post my findings on the other thread, for those who are interested.

3
Resources / Re: ENDOOM and Hexen Startup screens
« on: May 26, 2017, 02:47:12 AM »
That sounds nice, maybe it can be released as an optional addon, sort of as an extra?

4
Resources / ENDOOM and Hexen Startup screens
« on: May 24, 2017, 09:47:02 PM »
So I played v5b and thought it was great, and noticed that it's using the Zandronum beta version which brings a lot of new cool features.

I quickly made in a Hexen Startup and ENDOOM screens from existing assets inside the game, a completely useless addition:



I was going to keep this to myself, but decided to share it because why not. To use it, load Megagame_Load.pk3 instead of MM8BDM-v5b.pk3 (but make sure that it's findable by Zandronum).

Download:
http://www.mediafire.com/file/6zbkd5c3ckj9cqd/Megagame_Load.pk3

Source images:
http://www.mediafire.com/file/239xd959a6ug4yq/Megagame_Load-Src.7z

The software used for making these images was:

Playscii (ENDOOM)
https://forum.zdoom.org/viewtopic.php?f=44&t=55346

HexStartup++ (STARTUP,NOTCH,NETNOTCH)
https://forum.zdoom.org/viewtopic.php?f=44&t=56556

Gimp 2
https://www.gimp.org/downloads/

Pages: [1]