Calling DllMain, fixing ref count, and fixing module search.

This commit is contained in:
Ben Vanik
2015-05-09 00:56:42 -07:00
parent 0c646f4bc2
commit 23eb343484
11 changed files with 168 additions and 66 deletions

View File

@@ -325,15 +325,18 @@ bool Processor::Execute(ThreadState* thread_state, uint32_t address) {
PPCContext* context = thread_state->context();
// Setup registers.
uint64_t previous_lr = context->lr;
// This could be set to anything to give us a unique identifier to track
// re-entrancy/etc.
uint32_t lr = 0xBEBEBEBE;
// Setup registers.
context->lr = lr;
context->lr = 0xBEBEBEBE;
// Execute the function.
return fn->Call(thread_state, lr);
auto result = fn->Call(thread_state, uint32_t(context->lr));
context->lr = previous_lr;
return result;
}
uint64_t Processor::Execute(ThreadState* thread_state, uint32_t address,