Skip to content

ExeReader: Support 64 Bit executables - #3317

Merged
carstene1ns merged 1 commit into
EasyRPG:masterfrom
Ghabry:64bit-exe
Dec 22, 2024
Merged

ExeReader: Support 64 Bit executables#3317
carstene1ns merged 1 commit into
EasyRPG:masterfrom
Ghabry:64bit-exe

Conversation

@Ghabry

@Ghabry Ghabry commented Dec 21, 2024

Copy link
Copy Markdown
Member

Maniac Patch is now detected when the new exe is used.


The difference between 32bit PE and 64 bit PE is actually not that huge when you only care about the resources.

The differences:

  • The machine type is 0x8664
  • In the optional header the magic at the beginning is 0x20b instead of 0x10b (0x20b is a "PE32+" header, 0x10b is a "PE32" header)
  • The data direction offset is different because the PE32+ image file header is larger

The offset calculation was the major change:

Before the resource offset was hardcoded to 0x88 (136) which is actually size_of_optional_header (24) + size_of_image_file_header (96/112 [PE+]) + 16.

All the resource format itself is the same. (lucky for us).


Tested it with:

Player.exe, both 32 Bit and 64 Bit: PASSED

Maniac exe: PASSED

Various RPG_RT (32 bit): PASSED

@Ghabry Ghabry added this to the 0.8.1 milestone Dec 21, 2024
Comment thread src/exe_reader.cpp Outdated
Maniac Patch is now detected when the new exe is used.

The difference between 32bit PE and 64 bit PE is actually not that huge when you only care about the resources.

The differences:

- The machine type is 0x8664
- In the optional header the magic at the beginning is 0x20b instead of 0x10b (0x20b is a "PE32+" header, 0x10b is a "PE32" header)
- The data direction offset is different because the PE32+ image file header is larger

The offset calculation was the major change:

Before the resource offset was hardcoded to 0x88 (136) which is actually "size_of_optional_header (24) + size_of_image_file_header (96/112 [PE+]) + 16".
@carstene1ns
carstene1ns merged commit 39b022f into EasyRPG:master Dec 22, 2024
sevenc-nanashi pushed a commit to sevenc-nanashi/easyrpg-player that referenced this pull request May 31, 2026
ExeReader: Support 64 Bit executables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants