Some small changes to clean up before pull request.

This commit is contained in:
xorstream
2017-01-20 22:34:14 +11:00
parent 92392e0f57
commit 1fea4e6d87
4 changed files with 48 additions and 51 deletions

View File

@ -3,39 +3,7 @@
/* Sample code to demonstrate how to emulate X86 code */
#include "platform.h"
#include <unicorn/unicorn.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "unicorn.lib")
#pragma comment(lib, "x86_64-softmmu.lib")
/*
// windows specific
#ifdef _MSC_VER
#include <io.h>
#include <windows.h>
#define PRIx64 "llX"
#ifdef DYNLOAD
#include "unicorn_dynload.h"
#else // DYNLOAD
#include <unicorn/unicorn.h>
#ifdef _WIN64
#pragma comment(lib, "unicorn_staload64.lib")
#else // _WIN64
#pragma comment(lib, "unicorn_staload.lib")
#endif // _WIN64
#endif // DYNLOAD
// posix specific
#else // _MSC_VER
#include "platform.h"
#include "platform.h"
#include <unicorn/unicorn.h>
#endif // _MSC_VER
*/
// common includes
#include <string.h>
@ -999,16 +967,6 @@ static void test_x86_16(void)
int main(int argc, char **argv, char **envp)
{
// dynamically load shared library
#ifdef DYNLOAD
if (!uc_dyn_load(NULL, 0)) {
printf("Error dynamically loading shared library.\n");
printf("Please check that unicorn.dll/unicorn.so is available as well as\n");
printf("any other dependent dll/so files.\n");
return 1;
}
#endif
if (argc == 2) {
if (!strcmp(argv[1], "-16")) {
test_x86_16();
@ -1047,10 +1005,6 @@ int main(int argc, char **argv, char **envp)
test_x86_64_syscall();
}
// dynamically free shared library
#ifdef DYNLOAD
uc_dyn_free();
#endif
return 0;
}