From e8d8174ea9db5f36f4dac618334d1118411221ec Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:58:29 +1300 Subject: [PATCH] StartPipingSession2 matching --- src/DETHRACE/common/piping.c | 5 +++-- src/DETHRACE/dr_types.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/DETHRACE/common/piping.c b/src/DETHRACE/common/piping.c index 9ab2fd0a..471f1ebb 100644 --- a/src/DETHRACE/common/piping.c +++ b/src/DETHRACE/common/piping.c @@ -386,13 +386,14 @@ void StartPipingSession2(tPipe_chunk_type pThe_type, int pMunge_reentrancy) { } gReentrancy_count++; } + gLocal_buffer_size = 0; ((tPipe_session*)gLocal_buffer)->chunk_type = pThe_type; ((tPipe_session*)gLocal_buffer)->number_of_chunks = 0; #if defined(DETHRACE_REPLAY_DEBUG) ((tPipe_session*)gLocal_buffer)->pipe_magic1 = REPLAY_DEBUG_SESSION_MAGIC1; #endif - gLocal_buffer_size = offsetof(tPipe_session, chunks); - gMr_chunky = &((tPipe_session*)gLocal_buffer)->chunks; + gLocal_buffer_size = (tU8*)&((tPipe_session*)gLocal_buffer)->chunks - gLocal_buffer; + gMr_chunky = gLocal_buffer + gLocal_buffer_size; } } diff --git a/src/DETHRACE/dr_types.h b/src/DETHRACE/dr_types.h index f2e408ef..81666d03 100644 --- a/src/DETHRACE/dr_types.h +++ b/src/DETHRACE/dr_types.h @@ -2415,13 +2415,13 @@ typedef struct tPipe_chunk { // size: 0x58 } chunk_data; // @0x4 } tPipe_chunk; -typedef struct tPipe_session { - tPipe_chunk_type chunk_type; - tU8 number_of_chunks; +typedef struct tPipe_session { // size: 0x60 + tPipe_chunk_type chunk_type; // @0x0 + tU8 number_of_chunks; // @0x4 #if defined(DETHRACE_REPLAY_DEBUG) int pipe_magic1; #endif - tPipe_chunk chunks; + tPipe_chunk chunks; // @0x8 } tPipe_session; typedef struct tCollison_data {