""" Extract the static IV string from DLL and find how key derivation works. Key findings from disassembly: 1. Static 30-byte string at RVA 0x02725C60 used as IV (truncated to 16) 2. SHA256(combined) used as AES key material 3. Combined = some_function(key_string, iv_from_data, flag) 4. Function at 0x18006c3d0 combines key + iv_prefix Need to: a) Read the static IV string b) Disassemble function 0x18006c3d0 to understand combination c) Try decryption """ import struct, hashlib from capstone import Cs, CS_ARCH_X86, CS_MODE_64 DLL_PATH = r"c:\Users\MattyMroz\Desktop\PROJECTS\ONEOCR\ocr_data\oneocr.dll" MODEL_PATH = r"c:\Users\MattyMroz\Desktop\PROJECTS\ONEOCR\ocr_data\oneocr.onemodel" with open(DLL_PATH, "rb") as f: dll = f.read() with open(MODEL_PATH, "rb") as f: model = f.read() # Parse PE sections for RVA → file offset mapping e_lfanew = struct.unpack_from('= 24: magic = struct.unpack_from('= 24: magic = struct.unpack_from('= 24 else 0 if magic == MAGIC: print("FOUND THE CORRECT PARAMETERS!") print("\nDone.")