Skip to content

Instantly share code, notes, and snippets.

@hodzanassredin
Created June 26, 2024 10:06
Show Gist options
  • Save hodzanassredin/7106b0699640fb5799e21ffebcdb8ff1 to your computer and use it in GitHub Desktop.
Save hodzanassredin/7106b0699640fb5799e21ffebcdb8ff1 to your computer and use it in GitHub Desktop.
Find module and proc by addr
MODULE TestModules;
IMPORT SYSTEM, Log := StdLog, Kernel;
CONST adr = 43711E10H;
PROCEDURE Do*;
VAR m : Kernel.Module;addr : INTEGER;
BEGIN
m := Kernel.modList;
WHILE m # NIL DO
IF (m.refcnt >= 0) & (m.code <= adr) & ((m.code + m.csize) > adr)THEN
Log.String(LONG(m.name) + " 0x");
Log.IntForm(m.code, Log.hexadecimal, 9, '0', Log.showBase); Log.Ln;
Log.String(" offset ");Log.IntForm(adr - m.code, Log.hexadecimal, 9, '0', Log.showBase);
(*todo Kernel.GetRefFrameDo*)
Log.Ln;
END;
m := m.next;
END;
END Do;
END TestModules.
TestModules.Do
Kernel.SearchProcVar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment