• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

help sending input to a windows edit control using python

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
jake2891
Just Arrived
Just Arrived


Joined: 20 Mar 2010
Posts: 0


Offline

PostPosted: Wed Mar 24, 2010 9:27 pm    Post subject: help sending input to a windows edit control using python Reply with quote

Hi ive tried asking on a python forum but no ones has been able to help me. I am trying to write text into a windows edit control using python. it seems to write to every control i try except the edit box not sure if this is a security measure or not. here is my code any help please.

Code:

import os,sys,subprocess,time
from subprocess import *
from os import *
from ctypes import *
from ctypes.wintypes import *

PROCESS_ALL_ACCESS =     ( 0x000F0000 | 0x00100000 | 0xFFF )
kernel32 = windll.kernel32
pid      = sys.argv[1]

h_process = kernel32.OpenProcess( PROCESS_ALL_ACCESS, False, int(pid) )

if not h_process:
    print "[*] Couldn't acquire a handle to PID: %s" % pid
    sys.exit(0)

user32 = windll.user32
# parent window
window_handle = windll.user32.FindWindowA(None, "Windows App")


if not window_handle:
    print "[*] cant find window"

# 1 is the control id of the edit box child window
#below line has no effect on the control for some reason??
windll.user32.SetDlgItemTextA(window_handle, 1, "bla")

# 2 is the control id of a button
# this line works ? not sure whats going on
windll.user32.SetDlgItemTextA(window_handle, 2, "bla")


Back to top
View user's profile Send private message
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register