Unicorn interface working with test app in 32bit and 64bit builds.

This commit is contained in:
xorstream
2017-01-20 17:27:22 +11:00
parent 1aeaf5c40d
commit 002151874a
17 changed files with 248 additions and 829 deletions

21
uc.c
View File

@ -270,7 +270,15 @@ uc_err uc_open(uc_arch arch, uc_mode mode, uc_engine **result)
if (uc->reg_reset)
uc->reg_reset(uc);
return UC_ERR_OK;
// init winsock sockets so we can use select() for usleep() implementation
#ifdef _MSC_VER
{
WSADATA wsa_data;
WSAStartup(0x202, &wsa_data);
}
#endif
return UC_ERR_OK;
} else {
return UC_ERR_ARCH;
}
@ -312,7 +320,7 @@ uc_err uc_close(uc_engine *uc)
// Thread relateds.
if (uc->qemu_thread_data)
free(uc->qemu_thread_data);
g_free(uc->qemu_thread_data);
// Other auxilaries.
free(uc->l1_map);
@ -349,7 +357,14 @@ uc_err uc_close(uc_engine *uc)
memset(uc, 0, sizeof(*uc));
free(uc);
return UC_ERR_OK;
// free winsock sockets - used so we can use select() for usleep() implementation
#ifdef _MSC_VER
{
WSACleanup();
}
#endif
return UC_ERR_OK;
}