SendMessage by winappdbg
2013. 6. 12. 15:27
특정 Control에 특정 메세지를 전송.
target window 아래 child window을 뒤져 원하는 핸들값을 찾아내고 메시지를 전송.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from winappdbg import System, version, HexDump, win32 import sys, time def send_input(hwnd, msg): for c in msg: win32.SendMessage(hwnd, user32.WM_CHAR, ord (c), 0 ) time.sleep( 0.5 ) user32 = win32.user32 txt = 'I am Legend.\n' system = System() for window in system.get_windows(): if window.classname = = 'Notepad' : tmp = user32.EnumChildWindows(window) for x in tmp: if user32.GetClassNameA(x) = = 'Edit' : send_input(x, txt) |
'Code > Python' 카테고리의 다른 글
decode captcha by python (0) | 2012.11.12 |
---|---|
handling HTTP by python module (0) | 2011.07.04 |
ISEC 2009 level3 solution by winappdbg (0) | 2010.09.16 |
hust 8th level D - python (0) | 2009.10.17 |