Comments (7)
I got this so far and it works, but the loading tune is forcibly stopped when the menu is supposed to show up anyway. I assume it's because of a call to stop the audio somewhere, but I can't figure out exactly where.
if( bSkipIntroJingle )
{
// S T A R T I N G _ T U N E
auto pattern = hook::pattern( "53 54 41 52 54 49 4E 47 5F 54 55 4E 45 00" );
// L O A D I N G _ T U N E
// 4C 4F 41 44 49 4E 47 5F 54 55 4E 45 00 00
injector::WriteMemory( pattern.get_first( 0 ), 0x44414F4C, true ); // change the string from STARTING_TUNE to LOADING_TUNE
injector::WriteMemory( pattern.get_first( 4 ), 0x5F474E49, true );
injector::WriteMemory( pattern.get_first( 8 ), 0x454E5554, true );
injector::WriteMemory<uint16_t>( pattern.get_first( 12 ), 0x0000, true );
// skip replaying the loading tune
pattern = hook::pattern( "8B 8C 24 94 00 00 00 5E 5B 33 CC" ); // end of function before target function
injector::WriteMemory( pattern.get_first( 40 ), 0x00FFFFB8, true ); // mov eax, -1
injector::WriteMemory<uint16_t>( pattern.get_first( 44 ), 0xC300, true ); // ret
}
from gtaiv.eflc.fusionfix.
I managed to get it to work. Frontend noises will cancel the loading tune, so I made it so that the hidden menu doesn't make a noise after the GTA IV logo. The following code does the job, testers welcome.
if( bSkipIntroJingle && bSkipMenu )
{
// S T A R T I N G _ T U N E
auto pattern = hook::pattern( "53 54 41 52 54 49 4E 47 5F 54 55 4E 45 00" );
// L O A D I N G _ T U N E
// 4C 4F 41 44 49 4E 47 5F 54 55 4E 45 00 00
injector::WriteMemory( pattern.get_first( 0 ), 0x44414F4C, true ); // change the string from STARTING_TUNE to LOADING_TUNE
injector::WriteMemory( pattern.get_first( 4 ), 0x5F474E49, true );
injector::WriteMemory( pattern.get_first( 8 ), 0x454E5554, true );
injector::WriteMemory<uint16_t>( pattern.get_first( 12 ), 0x0000, true );
// skip playing the loading tune the second time
pattern = hook::pattern( "8B 8C 24 94 00 00 00 5E 5B 33 CC" ); // end of the function before the target function
injector::WriteMemory( pattern.get_first( 40 ), 0x00FFFFB8, true ); // mov eax, -1
injector::WriteMemory<uint16_t>( pattern.get_first( 44 ), 0xC300, true ); // ret
// dont stop the loading tune after the GTA IV logo
pattern = hook::pattern( "EB E7 68 3B 28 AA 3F B9 ? ? ? ? E8" );
injector::WriteMemory<uint16_t>( pattern.get_first( 17 ), 0xC030, true ); // xor al, al
}
The end result: youtube video
from gtaiv.eflc.fusionfix.
@NTxC I noticed that the signatures for this patch are for Complete Edition, at least the last 2 ones. I was trying to implement it into the pre-ivce branch which supports v1.0.8.0 and below. I found the signatures for v1.0.8.0 but it keeps throwing the assertion failed error when booting up the game. I was able to trace it back to the pattern.get_first
method
if (bSkipIntroJingle)
{
/*S T A R T I N G _ T U N E*/
auto pattern = hook::pattern("53 54 41 52 54 49 4E 47 5F 54 55 4E 45 00");
/*L O A D I N G _ T U N E */
/*4C 4F 41 44 49 4E 47 5F 54 55 4E 45 00 00*/
injector::WriteMemory(pattern.get_first(0), 0x44414F4C, true); // change the string from STARTING_TUNE to LOADING_TUNE
injector::WriteMemory(pattern.get_first(4), 0x5F474E49, true);
injector::WriteMemory(pattern.get_first(8), 0x454E5554, true);
injector::WriteMemory<uint16_t>(pattern.get_first(12), 0x0000, true);
// skip playing the loading tune the second time
pattern = hook::pattern("8B 8C 24 94 00 00 00 5F 5B 33 CC"); // end of the function before the target function
injector::WriteMemory(pattern.get_first(40), 0x00FFFFB8, true); // mov eax, -1
injector::WriteMemory<uint16_t>(pattern.get_first(44), 0xC300, true); // ret*/
// dont stop the loading tune after the GTA IV logo
pattern = hook::pattern("00 00 68 3B 28 AA 3F B9 ? ? ? ? E8 19 67 45 00 84 C0");
injector::WriteMemory<uint16_t>(pattern.get_first(17), 0xC030, true); // xor al, al
}
This is the updated code with the two v1.0.8.0 signatures below, the last signature might be overkill, not really sure about that. STARTING and LOADING_TUNE strings signatures have not been changed since 1.0.8.0.
Hope you can help me figure out what's wrong with it.
from gtaiv.eflc.fusionfix.
@sierratangocharlie26 The assertion errors may show up if the patterns haven't been found in the memory. Haven't had more time to look into it yet, but this one was sticking out. The last pattern in your version of the code:
pattern = hook::pattern("00 00 68 3B 28 AA 3F B9 ? ? ? ? E8 19 67 45 00 84 C0");
seems to be hardcoding the target CALL address (the four bytes after E8). Remember that the executable is relocatable in the memory, so you have to assume that the target CALL address might be different every time, so you must use the question marks instead, like this:
pattern = hook::pattern("00 00 68 3B 28 AA 3F B9 ? ? ? ? E8 ? ? ? ? 84 C0");
Edit: nevermind, looks like that CALL is relative. Still wouldn't risk it with the hardcoded one, though, as the relative offset may be different for different versions of gtaiv.exe. I wrote my code using v1.2.0.43.
from gtaiv.eflc.fusionfix.
@NTxC I just realised that this
// skip playing the loading tune the second time
pattern = hook::pattern("8B 8C 24 94 00 00 00 5F 5B 33 CC"); // end of the function before the target function
injector::WriteMemory(pattern.get_first(40), 0x00FFFFB8, true); // mov eax, -1
injector::WriteMemory<uint16_t>(pattern.get_first(44), 0xC300, true); // ret
won't work for v1.0.8.0 since it will be the start a completely different function, the desired function is at another location.
I think for now I'm trying to solve the issue that it can't even change STARTING_TUNE string to LOADING_TUNE because of aforementioned assertion failure. If I comment out the write memory stuff it works fine so I assume the pattern hooking has no issues (?).
I have to mention that I'm relatively new to this topic, I only did little patches in other games and I'm also not really familiar with the methods such as get_first
etc. yet.
from gtaiv.eflc.fusionfix.
@NTxC I found the correct signatures for the two bottom patches for v1.0.8.0 and it works, yet, for some unknown reasons it simply can't find the signature of the STARTING_TUNE string. I tried to check the size of the pattern and it seems it's empty so I assume it just can't find it at all on v1.0.8.0. I still managed to make it work although it requires editing the sounds.dat15 file in the audio configs replacing the LOADING_TUNE there, pretty much the same procedure like in your implementation if you ask me, but not as elegant.
Anyway here's the code with the 1.0.8.0 signatures in case you (or someone else) are interested:
// skip playing the loading tune the second time
auto pattern = hook::pattern("50 E8 ? ? ? ? 5E 5F 83 C4 48 C3"); // end of the function before the target function
injector::WriteMemory(pattern.get_first(13), 0x00FFFFB8, true); // mov eax, -1
injector::WriteMemory<uint16_t>(pattern.get_first(17), 0xC300, true); // ret
// dont stop the loading tune after the GTA IV logo
pattern = hook::pattern("E9 16 07 00 00 68 3B 28 AA 3F B9 ? ? ? ?");
injector::WriteMemory<uint16_t>(pattern.get_first(20), 0xC030, true); // xor al, al
I really have no clue at this point why it couldn't find the signature of that string, maybe one day someone will find the solution for this.
from gtaiv.eflc.fusionfix.
@NTxC @sTc2201 Old feed, but how would I implement this code into the game? I'm still learning as I go, but seeing this and the YT video are how I remember it beginning and I am working to make it as close to original as possible.
from gtaiv.eflc.fusionfix.
Related Issues (20)
- Toggle to enable pre-fusion fix water texture. HOT 2
- crash while climbing various obstacles HOT 1
- Stuttering while using gamepad with FusionFix installed HOT 3
- Fusion Fix settings won't save after restart
- After installing 2.5.6, the game crashes on start. HOT 6
- [Feature Request] Fix Kate's walking path?
- There's some visual glitches mostly on car windows HOT 20
- Menu options change all together HOT 2
- TBOGT slow texture streaming and missing models after long play session HOT 6
- [Bug] Language does not change in the legal screen HOT 3
- Aiming Zoom Fix doesn't reflect on controllers
- Centering Delay, FOV sliders don't save right HOT 2
- [Feature Request] Better SSAA settings
- [Feature Request] Inherit Windows resolution onto game (DXVK) HOT 2
- Escuela of the Streets crashing when the both cutscenes play
- FusionFix settings problem!! HOT 1
- Disable the FPS counter in menu HOT 1
- [Feature Request] Only Independence FM mode HOT 2
- Alt tab causes black screen and freeze HOT 4
- Error 126 when launching game and settings are bugged. (Using Lutris) *FIXED* HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtaiv.eflc.fusionfix.