diff options
| author | Axel Souchet <0vercl0k@tuxfamily.org> | 2018-09-09 06:11:00 -0700 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2018-09-09 15:11:00 +0200 |
| commit | 8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9 (patch) | |
| tree | dbf342089690704e89c10532b83d1d81709a49f4 /miasm2/jitter/jitcore_cc_base.py | |
| parent | e61116884ac7879db08313542c6c28a8b00297c5 (diff) | |
| download | miasm-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/jitcore_cc_base.py')
| -rw-r--r-- | miasm2/jitter/jitcore_cc_base.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/miasm2/jitter/jitcore_cc_base.py b/miasm2/jitter/jitcore_cc_base.py index 81a5d009..7853816a 100644 --- a/miasm2/jitter/jitcore_cc_base.py +++ b/miasm2/jitter/jitcore_cc_base.py @@ -2,11 +2,13 @@ import os import tempfile +import platform from distutils.sysconfig import get_python_inc from miasm2.jitter.jitcore import JitCore from miasm2.core.utils import keydefaultdict +is_win = platform.system() == "Windows" def gen_core(arch, attrib): lib_dir = os.path.dirname(os.path.realpath(__file__)) @@ -70,9 +72,9 @@ class JitCore_Cc_Base(JitCore): def load(self): lib_dir = os.path.dirname(os.path.realpath(__file__)) - libs = [os.path.join(lib_dir, 'VmMngr.so'), - os.path.join(lib_dir, - 'arch/JitCore_%s.so' % (self.ir_arch.arch.name))] + ext = ".so" if not is_win else ".lib" + libs = [os.path.join(lib_dir, "VmMngr" + ext), + os.path.join(lib_dir, "arch", "JitCore_%s%s" % (self.ir_arch.arch.name, ext))] include_files = [os.path.dirname(__file__), get_python_inc()] @@ -91,7 +93,7 @@ class JitCore_Cc_Base(JitCore): Return the C code corresponding to the @irblocks @irblocks: list of irblocks """ - f_declaration = 'int %s(block_id * BlockDst, JitCpu* jitcpu)' % self.FUNCNAME + f_declaration = '_MIASM_EXPORT int %s(block_id * BlockDst, JitCpu* jitcpu)' % self.FUNCNAME out = self.codegen.gen_c(block, log_mn=self.log_mn, log_regs=self.log_regs) out = [f_declaration + '{'] + out + ['}\n'] c_code = out |