-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXTRACE.py
More file actions
31 lines (27 loc) · 758 Bytes
/
XTRACE.py
File metadata and controls
31 lines (27 loc) · 758 Bytes
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
# XTRACE(u"hello, world\n")
# XTRACE_COLOR(0xff, u"red\n")
# XTRACE_COLOR(0xff00, u"green\n")
# XTRACE_COLOR(0xff0000, u"blue\n")
import tempfile
import os
import sys
import platform
from ctypes import *
if "64" in platform.architecture()[0]:
_dll_filename = tempfile.gettempdir() + "\\xTrace64.dll"
else:
_dll_filename = tempfile.gettempdir() + "\\xTrace.dll"
__dll_handle = None
if os.path.exists(_dll_filename):
__dll_handle = cdll.LoadLibrary(_dll_filename)
pass
def XTRACE(str_output):
if None == __dll_handle:
return
__dll_handle.MagicTraceProc(0, 0, str_output)
pass
def XTRACE_COLOR(color, str_output):
if None == __dll_handle:
return
__dll_handle.MagicTraceProc(0, color, str_output)
pass