about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2012-01-17 16:38:58 +0100
committerserpilliere <devnull@localhost>2012-01-17 16:38:58 +0100
commitaf39cd81b4d93e2e5b410f865a6fb4e2ce535ca7 (patch)
tree8c5f5fbfe3b49b4dcce21bc2663f95466ec2afcb
parentc653fb8faaee795e017dd88191ab0c19ce02d8a0 (diff)
downloadmiasm-af39cd81b4d93e2e5b410f865a6fb4e2ce535ca7.tar.gz
miasm-af39cd81b4d93e2e5b410f865a6fb4e2ce535ca7.zip
remove unused Crypo ref
Diffstat (limited to '')
-rw-r--r--miasm/tools/codenat.py7
-rwxr-xr-xmiasm/tools/hook_helper.py1
-rw-r--r--miasm/tools/win_api.py12
3 files changed, 8 insertions, 12 deletions
diff --git a/miasm/tools/codenat.py b/miasm/tools/codenat.py
index 3a88e74d..28ab9843 100644
--- a/miasm/tools/codenat.py
+++ b/miasm/tools/codenat.py
@@ -17,11 +17,8 @@
 #
 import os
 import sys
-try:
-    from Crypto.Hash import MD5
-except ImportError:
-    print "cannot find crypto MD5, skipping"
-    
+from hashlib import md5
+
 from  ctypes import *
 from miasm.tools.to_c_helper import *
 from miasm.tools.emul_lib import libcodenat_interface    
diff --git a/miasm/tools/hook_helper.py b/miasm/tools/hook_helper.py
index 10b0256b..3caca584 100755
--- a/miasm/tools/hook_helper.py
+++ b/miasm/tools/hook_helper.py
@@ -24,7 +24,6 @@ from miasm.core import asmbloc
 from miasm.core import parse_asm
 import re
 import sys
-from Crypto.Hash import MD5
 
 
 class hooks():
diff --git a/miasm/tools/win_api.py b/miasm/tools/win_api.py
index f58af474..dfcf2346 100644
--- a/miasm/tools/win_api.py
+++ b/miasm/tools/win_api.py
@@ -17,7 +17,10 @@
 #
 from to_c_helper import *
 import struct
-from Crypto.Hash import MD5
+try:
+    from Crypto.Hash import MD5
+except ImportError:
+    print "cannot find crypto MD5, skipping"
 import inspect
 from zlib import crc32
 import seh_helper
@@ -978,8 +981,7 @@ def kernel32_LoadLibraryA():
 
     print whoami(), hex(ret_ad), hex(dllname)
 
-    libname = vm_get_str(dllname, 0x100)
-    libname = libname[:libname.find('\x00')]
+    libname = get_str_ansi(dllname, 0x100)
     print repr(libname)
 
     eax = winobjs.runtime_dll.lib_get_add_base(libname)
@@ -1016,9 +1018,7 @@ def kernel32_LoadLibraryW():
 
     print whoami(), hex(ret_ad), hex(dllname)
 
-    libname = vm_get_str(dllname, 0x100)
-    libname = libname[:libname.find('\x00\x00')]
-    libname = libname[::2]
+    libname = get_str_unic(dllname, 0x100)
     print repr(libname)
 
     eax = winobjs.runtime_dll.lib_get_add_base(libname)