mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
21 lines
560 B
Python
21 lines
560 B
Python
import pytest
|
|
|
|
import windows.generated_def as gdef
|
|
import windows.debug.symbols as symbols
|
|
from .pfwtest import *
|
|
|
|
|
|
@pytest.fixture()
|
|
def symctx():
|
|
yield symbols.VirtualSymbolHandler()
|
|
|
|
# Disable defered loading
|
|
# symbols.engine.options = gdef.SYMOPT_UNDNAME
|
|
|
|
def test_symbols_loadfile(symctx):
|
|
mod = symctx.load_file(path=r"c:\windows\system32\ntdll.dll", addr=0x42000)
|
|
assert mod.addr == 0x42000
|
|
# Resolve by name
|
|
createfile = symctx[b"ntdll!NtCreateFile"]
|
|
# Resolve by addr
|
|
assert symctx[createfile.addr].name == b"NtCreateFile" |