MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / ReconstructThreadState

Function ReconstructThreadState

Source/Windows/WOW64/Module.cpp:310–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void ReconstructThreadState(CONTEXT* Context) {
311 const auto& Config = SignalDelegator->GetConfig();
312 auto* Thread = GetTLS().ThreadState();
313 auto& State = Thread->CurrentFrame->State;
314
315 State.rip = CTX->RestoreRIPFromHostPC(Thread, Context->Pc);
316
317 // Spill all SRA GPRs
318 for (size_t i = 0; i < Config.SRAGPRCount; i++) {
319 State.gregs[i] = Context->X[Config.SRAGPRMapping[i]];
320 }
321
322 // Spill all SRA FPRs
323 for (size_t i = 0; i < Config.SRAFPRCount; i++) {
324 memcpy(State.xmm.sse.data[i], &Context->V[Config.SRAFPRMapping[i]], sizeof(__uint128_t));
325 }
326
327 // Spill EFlags
328 uint32_t EFlags = CTX->ReconstructCompactedEFLAGS(Thread, true, Context->X, Context->Cpsr);
329 CTX->SetFlagsFromCompactedEFLAGS(Thread, EFlags);
330}
331
332WOW64_CONTEXT ReconstructWowContext(CONTEXT* Context) {
333 if (!IsDispatcherAddress(Context->Pc)) {

Callers 3

ReconstructWowContextFunction · 0.70
HandleSuspendInterruptFunction · 0.70

Calls 4

GetTLSFunction · 0.85
RestoreRIPFromHostPCMethod · 0.80

Tested by

no test coverage detected