Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Apr 10, 2024
1 parent 9becdf3 commit e3b54a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_procmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,4 @@ def test_procmemdnpe():
assert p.pe is not None
assert p.pe.dn_metadata.struct.Version == b'v4.0.30319\x00\x00'
assert p.pe.dn_metadata.struct.NumberOfStreams == len(p.pe.dn_metadata.streams)

assert p.pe.dn_user_string(1).value == "Hello World!"
4 changes: 4 additions & 0 deletions tests/test_procmemelf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_hello_static():
assert pelf.elf.elfclass == 64
assert pelf.elf.get_machine_arch() == 'x64'
assert pelf.elf.little_endian
assert pelf.imgend == 7159808


def test_hello_32():
Expand All @@ -26,6 +27,7 @@ def test_hello_32():
assert pelf.elf.elfclass == 32
assert pelf.elf.get_machine_arch() == 'x86'
assert pelf.elf.little_endian
assert pelf.imgend == 8192


def test_hello_32_static():
Expand All @@ -35,6 +37,7 @@ def test_hello_32_static():
assert pelf.elf.elfclass == 32
assert pelf.elf.get_machine_arch() == 'x86'
assert pelf.elf.little_endian
assert pelf.imgend == 135200768


def test_hidden_32_static():
Expand All @@ -48,3 +51,4 @@ def test_hidden_32_static():
b"\x00\xcd\x80\x5a\x59\x5b\x58\x68\x73\x87\x04\x08\xc3\x28\x68\x69\x64\x64\x65\x6e\x20\x63\x6f"\
b"\x64\x65\x21\x29\x0a"
assert pelf.readv(0x80ed200, len(hidden_code)) == hidden_code
assert pelf.imgend == 135200768

0 comments on commit e3b54a4

Please sign in to comment.