Format code
This commit is contained in:
@@ -65,7 +65,7 @@ typedef size_t uc_hook;
|
|||||||
#define UNICORN_DEPRECATED __declspec(deprecated)
|
#define UNICORN_DEPRECATED __declspec(deprecated)
|
||||||
#else
|
#else
|
||||||
#pragma message( \
|
#pragma message( \
|
||||||
"WARNING: You need to implement UNICORN_DEPRECATED for this compiler")
|
"WARNING: You need to implement UNICORN_DEPRECATED for this compiler")
|
||||||
#define UNICORN_DEPRECATED
|
#define UNICORN_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1682,7 +1682,9 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap ax
|
// bswap ax
|
||||||
0x66, 0x0F, 0xC8,
|
0x66,
|
||||||
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_32, code);
|
TEST_CODE(UC_MODE_32, code);
|
||||||
TEST_IN_REG(EAX, 0x44332211);
|
TEST_IN_REG(EAX, 0x44332211);
|
||||||
@@ -1692,7 +1694,9 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap ax
|
// bswap ax
|
||||||
0x66, 0x0F, 0xC8,
|
0x66,
|
||||||
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1702,7 +1706,10 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap rax (66h ignored)
|
// bswap rax (66h ignored)
|
||||||
0x66, 0x48, 0x0F, 0xC8,
|
0x66,
|
||||||
|
0x48,
|
||||||
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1712,7 +1719,10 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap ax (rex ignored)
|
// bswap ax (rex ignored)
|
||||||
0x48, 0x66, 0x0F, 0xC8,
|
0x48,
|
||||||
|
0x66,
|
||||||
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1722,7 +1732,8 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap eax
|
// bswap eax
|
||||||
0x0F, 0xC8,
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_32, code);
|
TEST_CODE(UC_MODE_32, code);
|
||||||
TEST_IN_REG(EAX, 0x44332211);
|
TEST_IN_REG(EAX, 0x44332211);
|
||||||
@@ -1732,7 +1743,8 @@ static void test_bswap_ax(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// bswap eax
|
// bswap eax
|
||||||
0x0F, 0xC8,
|
0x0F,
|
||||||
|
0xC8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1746,7 +1758,10 @@ static void test_rex_x64(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// mov ax, bx (rex.w ignored)
|
// mov ax, bx (rex.w ignored)
|
||||||
0x48, 0x66, 0x89, 0xD8,
|
0x48,
|
||||||
|
0x66,
|
||||||
|
0x89,
|
||||||
|
0xD8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1757,7 +1772,10 @@ static void test_rex_x64(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// mov rax, rbx (66h ignored)
|
// mov rax, rbx (66h ignored)
|
||||||
0x66, 0x48, 0x89, 0xD8,
|
0x66,
|
||||||
|
0x48,
|
||||||
|
0x89,
|
||||||
|
0xD8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
@@ -1768,7 +1786,9 @@ static void test_rex_x64(void)
|
|||||||
{
|
{
|
||||||
uint8_t code[] = {
|
uint8_t code[] = {
|
||||||
// mov ax, bx (expected encoding)
|
// mov ax, bx (expected encoding)
|
||||||
0x66, 0x89, 0xD8,
|
0x66,
|
||||||
|
0x89,
|
||||||
|
0xD8,
|
||||||
};
|
};
|
||||||
TEST_CODE(UC_MODE_64, code);
|
TEST_CODE(UC_MODE_64, code);
|
||||||
TEST_IN_REG(RAX, 0x8877665544332211);
|
TEST_IN_REG(RAX, 0x8877665544332211);
|
||||||
|
|||||||
3
uc.c
3
uc.c
@@ -2837,7 +2837,8 @@ static uc_err uc_restore_latest_snapshot(struct uc_struct *uc)
|
|||||||
subregions_link, subregion_next)
|
subregions_link, subregion_next)
|
||||||
{
|
{
|
||||||
uc->memory_filter_subregions(subregion, uc->snapshot_level);
|
uc->memory_filter_subregions(subregion, uc->snapshot_level);
|
||||||
if (subregion->priority >= uc->snapshot_level || (!subregion->terminates && QTAILQ_EMPTY(&subregion->subregions))) {
|
if (subregion->priority >= uc->snapshot_level ||
|
||||||
|
(!subregion->terminates && QTAILQ_EMPTY(&subregion->subregions))) {
|
||||||
uc->memory_unmap(uc, subregion);
|
uc->memory_unmap(uc, subregion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user