about summary refs log tree commit diff stats
path: root/miasm2/jitter/vm_mngr_py.c
diff options
context:
space:
mode:
authorAxel Souchet <0vercl0k@tuxfamily.org>2018-09-09 06:11:00 -0700
committerserpilliere <serpilliere@users.noreply.github.com>2018-09-09 15:11:00 +0200
commit8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9 (patch)
treedbf342089690704e89c10532b83d1d81709a49f4 /miasm2/jitter/vm_mngr_py.c
parente61116884ac7879db08313542c6c28a8b00297c5 (diff)
downloadmiasm-8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9.tar.gz
miasm-8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9.zip
Adds Windows support and AppVeyor CI (#835)
* Get miasm to work on Windows, also add AppVeyor CI

* Fix gcc jitter on Linux

* Make the dse_crackme tests work on Windows

* calling build and then install is less confusing than install twice

* fix os.rename race condition on Windows

* clean it up

* Clean up after the unused cl.exe's artifacts

* Use is_win instead of an additional check

* Fix issue on Windows where 'w' and 'wb' modes are different

* Address review feedback

* setuptools is actually not required, so reverting
Diffstat (limited to 'miasm2/jitter/vm_mngr_py.c')
-rw-r--r--miasm2/jitter/vm_mngr_py.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/miasm2/jitter/vm_mngr_py.c b/miasm2/jitter/vm_mngr_py.c
index 24f9dd9a..d1610fb8 100644
--- a/miasm2/jitter/vm_mngr_py.c
+++ b/miasm2/jitter/vm_mngr_py.c
@@ -117,7 +117,7 @@ PyObject* vm_add_memory_page(VmMngr* self, PyObject* args)
 			RAISE(PyExc_TypeError,"name must be str");
 		name_ptr = PyString_AsString(name);
 	}
-	mpn = create_memory_page_node(page_addr, buf_size, page_access, name_ptr);
+	mpn = create_memory_page_node(page_addr, (unsigned int)buf_size, (unsigned int)page_access, name_ptr);
 	if (mpn == NULL)
 		RAISE(PyExc_TypeError,"cannot create page");
 	if (is_mpn_in_tab(&self->vm_mngr, mpn)) {
@@ -261,7 +261,7 @@ PyObject* vm_add_memory_breakpoint(VmMngr* self, PyObject* args)
 	PyGetInt(size, b_size);
 	PyGetInt(access, b_access);
 
-	add_memory_breakpoint(&self->vm_mngr, b_ad, b_size, b_access);
+	add_memory_breakpoint(&self->vm_mngr, b_ad, b_size, (unsigned int)b_access);
 
 	/* Raise exception in the following pattern:
 	   - set_mem(XXX)
@@ -287,7 +287,7 @@ PyObject* vm_remove_memory_breakpoint(VmMngr* self, PyObject* args)
 
 	PyGetInt(ad, b_ad);
 	PyGetInt(access, b_access);
-	remove_memory_breakpoint(&self->vm_mngr, b_ad, b_access);
+	remove_memory_breakpoint(&self->vm_mngr, b_ad, (unsigned int)b_access);
 
 	Py_INCREF(Py_None);
 	return Py_None;
@@ -452,7 +452,7 @@ PyObject* vm_get_all_memory(VmMngr* self, PyObject* args)
 		PyDict_SetItemString(dict2, "access", o);
 		Py_DECREF(o);
 
-		o = PyInt_FromLong((long)mpn->ad);
+		o = PyLong_FromUnsignedLongLong(mpn->ad);
 		PyDict_SetItem(dict, o, dict2);
 		Py_DECREF(o);
 		Py_DECREF(dict2);