| 308 | } |
| 309 | |
| 310 | void 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 | |
| 332 | WOW64_CONTEXT ReconstructWowContext(CONTEXT* Context) { |
| 333 | if (!IsDispatcherAddress(Context->Pc)) { |
no test coverage detected