Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions tests/test_detourbackend_aarch64.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,20 +296,12 @@ def run_one(self, filename, patches, set_oep=None, inputvalue=None, expected_out
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -286,20 +285,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_i386.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -303,20 +302,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_mips.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -288,20 +287,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_mips64.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -288,20 +287,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_ppc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -298,20 +297,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_ppc64.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import shellphish_qemu

Expand Down Expand Up @@ -300,20 +299,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
13 changes: 2 additions & 11 deletions tests/test_detourbackend_x86-64.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import subprocess
import unittest
import requests

import patcherex
from patcherex.backends.detourbackend import DetourBackend
Expand Down Expand Up @@ -136,20 +135,12 @@ def run_test(self, filename, patches, set_oep=None, inputvalue=None, expected_ou
res = p.communicate(inputvalue)
if expected_output:
if res[0] != expected_output:
self.fail(f"AssertionError: {res[0]} != {expected_output}, binary dumped: {self.dump_file(tmp_file)}")
# self.assertEqual(res[0], expected_output)
self.fail(f"AssertionError: {res[0]} != {expected_output}")
if expected_returnCode:
if p.returncode != expected_returnCode:
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}, binary dumped: {self.dump_file(tmp_file)}")
#self.assertEqual(p.returncode, expected_returnCode)
self.fail(f"AssertionError: {p.returncode} != {expected_returnCode}")
return backend

def dump_file(self, file):
with open(file, 'rb') as f:
data = f.read()
response = requests.put('https://transfer.sh/bin', data=data)
return response.text

if __name__ == "__main__":
logging.getLogger("patcherex.backends.DetourBackend").setLevel("INFO")
logging.getLogger("patcherex.test.test_detourbackend").setLevel("INFO")
Expand Down
Loading