-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (32 loc) · 1.01 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from APITracer import *
import logging
import sys
from multiprocessing import Process
import os
TO_TRACE = [
("kernel32.dll", "LoadLibraryA"),
("kernel32.dll", "LoadLibraryW"),
("kernel32.dll", "GetProcAddress"),
]
# You can either create your own handler or use default one
#def myHandler():
# APITRACE.logger.tracer("---> CUSTOM HANDLER <----")
#
# To set it
# APITRACE.AddToTracer("kernel32.dll", "GetProcAddress", handler=myHandler)
# APITRACE.TraceAll(handler=myHandler)
# APITRACE.TraceDLL(["adVaPi32.dll"], handler=myHandler)
def runTrace(filename):
APITRACE = APITracer(filename, loglevel=logging.INFO)
for api in TO_TRACE:
APITRACE.AddToTracer(api[0], api[1])
#APITRACE.TraceAll()
#APITRACE.TraceAll(traceNtdll=True)
#APITRACE.TraceDLL(["adVaPi32.dll"])
APITRACE.Run()
#os.system(filename)
def main():
runTrace("")
print("############################################")
if __name__ == '__main__':
main()