From 8a514cd3cbe6081e07f448569c6535d429422905 Mon Sep 17 00:00:00 2001 From: dataisland Date: Wed, 3 Nov 2021 21:01:06 +0800 Subject: [PATCH 1/3] Fix a simple bug in gpio odr --- qiling/hw/gpio/stm32f4xx_gpio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiling/hw/gpio/stm32f4xx_gpio.py b/qiling/hw/gpio/stm32f4xx_gpio.py index f93e75bb..dca8d2d4 100644 --- a/qiling/hw/gpio/stm32f4xx_gpio.py +++ b/qiling/hw/gpio/stm32f4xx_gpio.py @@ -98,7 +98,7 @@ class STM32F4xxGpio(QlPeripheral, GpioHooks): if new_bit: self.set_pin(i) else: - self.reset_pin(i - 16) + self.reset_pin(i) return From 96551f603b79bbe382dd7f056bc051cbe6d4e255 Mon Sep 17 00:00:00 2001 From: dataisland Date: Sat, 6 Nov 2021 15:05:59 +0800 Subject: [PATCH 2/3] Fix the utf-8 decode error --- qiling/os/posix/syscall/unistd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiling/os/posix/syscall/unistd.py b/qiling/os/posix/syscall/unistd.py index 682108bf..0f8a1f7c 100644 --- a/qiling/os/posix/syscall/unistd.py +++ b/qiling/os/posix/syscall/unistd.py @@ -266,7 +266,7 @@ def ql_syscall_write(ql: Qiling, fd: int, buf: int, count: int): except: regreturn = -1 else: - ql.log.debug(f'write() CONTENT: {data.decode()!r}') + ql.log.debug(f'write() CONTENT: {bytes(data)}') if hasattr(ql.os.fd[fd], 'write'): ql.os.fd[fd].write(data) From 8a1ad3ef98992bf6e9b92db33d3cf6562d804e8f Mon Sep 17 00:00:00 2001 From: dataisland Date: Sat, 6 Nov 2021 15:06:25 +0800 Subject: [PATCH 3/3] Replace exception with warning --- qiling/os/posix/syscall/prctl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiling/os/posix/syscall/prctl.py b/qiling/os/posix/syscall/prctl.py index fabaa3bb..3652c2bd 100644 --- a/qiling/os/posix/syscall/prctl.py +++ b/qiling/os/posix/syscall/prctl.py @@ -20,9 +20,9 @@ def ql_syscall_arch_prctl(ql: Qiling, code: int, addr: int): } if code not in handlers: - raise NotImplementedError(f'prctl code {code:#x} not implemented') - - handlers[code]() + ql.log.warning(f'prctl code {code:#x} not implemented') + else: + handlers[code]() return 0