Fix saving arguments in custom registers in combination with arguments on the stack
If a function was optimized to only pass one parameter in a register, but still pass other parameters on the stack, save the registers at the correct offset in the buffer.
This commit is contained in:
parent
38aca973db
commit
02e0545d75
@ -599,8 +599,9 @@ HookParamsStruct *CDynamicHooksSourcePawn::GetParamStruct()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
int size = argTypes[i].size;
|
int size = argTypes[i].size;
|
||||||
|
void *paramAddr = (void *)((intptr_t)params->orgParams + offset);
|
||||||
void *regAddr = callingConvention->GetArgumentPtr(i + firstArg, m_pDetour->m_pRegisters);
|
void *regAddr = callingConvention->GetArgumentPtr(i + firstArg, m_pDetour->m_pRegisters);
|
||||||
memcpy(params->orgParams + offset, regAddr, size);
|
memcpy(paramAddr, regAddr, size);
|
||||||
offset += size;
|
offset += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user