Unicorn interface working with test app in 32bit and 64bit builds.
This commit is contained in:
21
uc.c
21
uc.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user