From dd3d42461e32f7339725ac64a5688f8608f3e3c3 Mon Sep 17 00:00:00 2001 From: tmpz23 <28760271+tmpz23@users.noreply.github.com> Date: Sat, 16 Apr 2022 00:52:52 +0200 Subject: [PATCH] Update doltool.py --- doltool/doltool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doltool/doltool.py b/doltool/doltool.py index 9a5fa53..c5df3dc 100644 --- a/doltool/doltool.py +++ b/doltool/doltool.py @@ -3,7 +3,7 @@ import logging import re -__version__ = "0.0.4" +__version__ = "0.0.5" __author__ = "rigodron, algoflash, GGLinnk" __license__ = "MIT" __status__ = "developpement" @@ -126,14 +126,14 @@ class Dol: def resolve_img2virtual(self, offset:int): memory_address = None for section_info in self.__sections_info: - if section_info[0] == 0: continue + if not section_info[3]: continue if offset >= section_info[0] and offset < section_info[0] + section_info[2]: return section_info[1] + offset - section_info[0] raise InvalidImgOffsetError(f"Not found: {offset:08x}") # Resolve a virtual memory address to a dol absolute offset def resolve_virtual2img(self, address:int): for section_info in self.__sections_info: - if section_info[0] == 0: continue + if not section_info[3]: continue if address >= section_info[1] and address < section_info[1] + section_info[2]: return section_info[0] + address - section_info[1] raise InvalidVirtualAddressError(f"Not found in dol initial segments: {address:08x}")