Fix LBP1 user agent patching #9

Merged
uhwot merged 1 commit from lbp1-race-condition-fix into main 2025-06-27 23:59:28 +00:00
uhwot commented 2025-06-27 17:45:27 +00:00 (Migrated from github.com)

This fixes a race condition where LBP1 could copy the user agent elsewhere in memory before Patchwork writes to it, thus still sending the original one to the gameserver

Looks like this mainly affected RPCS3 and not real hardware

This fixes a race condition where LBP1 could copy the user agent elsewhere in memory before Patchwork writes to it, thus still sending the original one to the gameserver Looks like this mainly affected RPCS3 and not real hardware
jvyden (Migrated from github.com) approved these changes 2025-06-27 18:06:56 +00:00
jvyden (Migrated from github.com) left a comment

Has this been tested on RPCS3 and PS3? If not I can give it a shot.

Has this been tested on RPCS3 and PS3? If not I can give it a shot.
@ -84,11 +84,27 @@ void patch_thread(uint64_t arg) {
const sys_pid_t processPid = sys_process_getpid();
uint8_t game = 0;
int password_randomized = 1;
jvyden (Migrated from github.com) commented 2025-06-27 18:04:20 +00:00

This is a nitpick, but we're targeting C99, maybe best to use stdbool here?

This is a nitpick, but we're targeting C99, maybe best to use stdbool here?
uhwot commented 2025-06-27 18:18:58 +00:00 (Migrated from github.com)

I tested on RPCS3 only, couldn't test on PS3 since mine broke ¯\_(ツ)_/¯

I tested on RPCS3 only, couldn't test on PS3 since mine broke ¯\\\_(ツ)\_/¯
uhwot (Migrated from github.com) reviewed 2025-06-27 18:21:41 +00:00
@ -84,11 +84,27 @@ void patch_thread(uint64_t arg) {
const sys_pid_t processPid = sys_process_getpid();
uint8_t game = 0;
int password_randomized = 1;
uhwot (Migrated from github.com) commented 2025-06-27 18:21:41 +00:00

This was already an int on upstream, so i just left it that way
But yeah, i think using stdbool here would be better

This was already an int on upstream, so i just left it that way But yeah, i think using stdbool here would be better
jvyden commented 2025-06-27 18:22:58 +00:00 (Migrated from github.com)

That's okay. I'll give it a shot on PS3 in a little bit.

That's okay. I'll give it a shot on PS3 in a little bit.
Zaprit (Migrated from github.com) approved these changes 2025-06-27 23:59:11 +00:00
Sign in to join this conversation.
No description provided.