mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
1354d63b85
## Link to GitHub Issue, if one exists see my previous attempt #496, which has been reverted by #500 ## Description of change Two issues: 1. the original implementation of bi2x_hook for iidx misunderstood what `aioNMgrIob2_Create` does. In the original I/O code it returns a pointer to a C++ class instance, which would also have a vptr (pointer to a vtable) in the beginning. The original author of this code of the hook in spice thought that `aioNMgrIob2_Create` returns a pointer to a pointer. This may happen to work but it's not 100% accurate, so this has been fixed by separating out the class and the vtable allocation. Without this, the game could have accessed memory outside this buffer. 2. And then the SDVX implementation blindly copy-pasted the IIDX `bi2x_hook`. Along with the issue above, they also forgot to check the I/O DLLs to see how much memory needs to be allocated and change that. Instead, they kept the same value as IIDX, which was too small. Fix that as well. ## Testing Doing some extensive testing with IIDX (27-33) and SDVX versions (EG).
11 lines
89 B
C++
11 lines
89 B
C++
#pragma once
|
|
|
|
#if SPICE64
|
|
|
|
namespace games::iidx {
|
|
|
|
void bi2x_hook_init();
|
|
}
|
|
|
|
#endif
|