on Windows, you might need to set the file access mode in patch_odex.py to binary: odex_buff = open(odexFile, "rb").read() and patched_odex = open(outputFile, "wb") or else you will get "struct.error: unpack requires a string argument of length 4".
if you only need the "patch" function of "patch_odex.py", you can simply remove the line "import androguard.core.bytecodes.dvm"