I.E /FF address bar manipulation

Everything else that doesn't fall into one of the other PB categories.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

I.E /FF address bar manipulation

Post by Pantcho!! »

Hello,
I have a generel question regarding domain names and domain masking in the browsers address bar.

I would to create a little software that helps manage certing stuff,By catching the address from the address bar of the browser and then filter it.
I mean grabbing the address when the user has input and press enter/go
and the software will check the domain name and if it consists a bad word such as SEX or somthing it will forward it to a diffrent IP but stays with the SAME name in the address bar.

This need to manipulate I.E with accessing the DNS server and name servers etc etc.

I tought of 2 options,
1. hard one - making a proxy server - which make users want to avoid using proxies.
2. easy one - edit the HOSTS file in the "...drivers\etc\hosts" and create whatever name i wish or change on the fly (can be suspicous for hijacking browser and this method is bad idea becuase of many spywares)

any suggestions? :roll:
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

(can be suspicous for hijacking browser and this method is bad idea becuase of many spywares)
Don't know how suspicious it is; but it is an easy thing to change. And many knows the trick..

The proxy server would allow you to check the content of the page too; wich would help you create a bettter filter. You could make a point system for words too and so on.

Be aware of the word "SEX", as it also means gender; this is also the problem with other words. Just because a page contains the word "porn" doesnt mean its a porn page. It could also be a page against it or so.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

Found this on the forums to reterive I.E address,

posted by justin

Code: Select all

hedit.l=0 

Procedure EnumFunc(hchild,lparam) 
  Shared hedit 
  class$=Space(30) 
  GetClassName_(hchild,@class$,30) 
  If class$="Edit" 
    hedit=hchild 
    ProcedureReturn 0 
  EndIf 
  ProcedureReturn 1 
EndProcedure 

;IE handle 
hie.l=FindWindow_("IEFrame",#null) 
If hie=0 : MessageRequester("Error","IE Window not found.",0) : End : EndIf 

;find Edit handle 
EnumChildWindows_(hie,@EnumFunc(),0) 
If hedit=0 : MessageRequester("Error","Edit control not found.",0) : End : EndIf 

;get text 
editcont$=Space(500) 
sendmessage_(hedit,#WM_GETTEXT,500,@editcont$) 

MessageRequester("Edit",editcont$,0) 
this doesnt work :?

anyone have idea why?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

It works okay here on xp home.
I may look like a mule, but I'm not a complete ass.
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

This Code returns a null result in "editcont$"

Tested on WIN XP home edition
and WIN XP PRO SP2

I get this weird results if i debug all the class$ results in the procedure
i see the "edit" 2 times!

plz help or maybe there is a way to get this ?
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

srod wrote:It works okay here on xp home.
On XP pro sp2 danish it doesnt work.

edit: solved.

Code: Select all

hedit.l=0
Global editcont$
editcont$=Space(500)

Procedure EnumFunc(hchild,lparam)
  Shared hedit
  class$=Space(30)
  GetClassName_(hchild,@class$,30)
  If class$="Edit"
  
    hedit=hchild
    ;editcont$=Space(500)
SendMessage_(hedit,#WM_GETTEXT,500,@editcont$)
If editcont$=""
;nothing
Else
    ProcedureReturn 0
    EndIf

  EndIf
  ProcedureReturn 1
EndProcedure

;IE handle
hie.l=FindWindow_("IEFrame",#Null)
Debug hie
If hie=0 : MessageRequester("Error","IE Window not found.",0) : End : EndIf

;find Edit handle
EnumChildWindows_(hie,@EnumFunc(),0)
If hedit=0 : MessageRequester("Error","Edit control not found.",0) : End : EndIf

MessageRequester("Edit",editcont$,0) 
Post Reply