flat assembler
Message board for the users of flat assembler.

Index > Windows > Interfacing with my WebBrowser control?

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 16:18
Awesome! Thanks.

The reason I wanted this is because this program & dev notes do exactly what I need my program to do.

http://m8software.com/developer/keysend/howtosend.htm

I've tried to sendkey in VB till my fingers bled... so that is why I switched to a lowlevel program lang.

Thanks again for your input & help. Hope I do not wear out my welcome.

~BigVent
Post 29 May 2008, 16:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 16:24
You need to learn how to use my website a little bit better. It seems odd that this link could not have helped you!
Post 29 May 2008, 16:24
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 17:53
Thanks revolution

while (2>1)
{
int me;
me=wetardid;
cout>>me>>endl;
}
Post 29 May 2008, 17:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 18:00
BigVent wrote:
while (2>1)
{
int me;
me=wetardid;
cout>>me>>endl;
}
Hmm, that is the strangest looking ASM code I've ever seen. fasm will give me an error when compiling.

I rewrote it:
Code:
while (2>1)
display "Hi guys, what's up?",13,10
end while    
Post 29 May 2008, 18:00
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 18:39
ROTF!!!

Thanks for the link. I'm finding all sorts of things to use. However, lemme ask you this...

What language would you write this in if you have little to zero knowledge in any? I'll find some that look interesting in asm, then find something else that looks good in vb...

Thanks,

~BigVent
Post 29 May 2008, 18:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 18:51
BigVent wrote:
ROTF!!!
Rolling on the floor? Please, we don't want to hear about your bizarre love making rituals.
BigVent wrote:
Thanks for the link.
You're welcome
BigVent wrote:
I'm finding all sorts of things to use. However, lemme ask you this...

What language would you write this in if you have little to zero knowledge in any?
If I knew no languages then I have little choice but to "write" in cave man drawings (although that may also be considered a language).
BigVent wrote:
I'll find some that look interesting in asm, then find something else that looks good in vb...
You mean there is actually really something that actually really looks good in VB? You're just teasing me ... right?
Post 29 May 2008, 18:51
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 19:10
It could be a language.

As I said before I know a little C++. I took a asm class years ago in college.

Well, it looks good... whether it works or not... remains to be seen.

I'm lost in this crazy world of programming. I can get my https site open & see the login screen. If I only knew how to pass data to the box....
Post 29 May 2008, 19:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 19:36
BigVent wrote:
I took a asm class years ago in college.
Then you're one step ahead of me, I've never taken any asm class, or even any programming class. Yeah, I know, it shows in my crappy code, but I don't care, I just need it to work fro 5 minutes then run away after the client pays me
Post 29 May 2008, 19:36
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 19:39
BigVent wrote:
If I only knew how to pass data to the box....
You mean you're still searching?

Try:
  1. FindWindow
  2. WaitForInputIdle
  3. SendMessage (or PostMessage)
  4. Party time
Post 29 May 2008, 19:39
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 19:48
Yup, still searching. I conceptually understand but do not programatically understand how to do this.

I wrote a vb script that does this... but when it hits the login screen my password is not sent. Something about vb and sendkeys do not work now with xp & vista.
Post 29 May 2008, 19:48
View user's profile Send private message Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 20:13
Now that's funny! Just saw your 5 min client pay run away Razz
Post 29 May 2008, 20:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 20:33
BigVent wrote:
Now that's funny! Just saw your 5 min client pay run away Razz
Ya gotta keep your eyes open 'cause ya just never know what li'l Easter Eggs will turn up in my postings.


WARNING: Easter Egg is here, you are not allowed to read, OK!

Not many people here seem to get my obscure jokes, but I don't mind, because the jokes are mainly just for my own personal satisfaction. Hehe, probably no one will read this anyway, what with it being of size=0, so I am talking to myself. I expect you have hit the "Quote" button, because your browser generally won't display anything.


Post 29 May 2008, 20:33
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 20:37
Easter Egg me some code that will help! Razz
Post 29 May 2008, 20:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 20:51
BigVent wrote:
Easter Egg me some code that will help! Razz
Maybe try:
  1. FindWindow
  2. SetForegroundWindow
  3. keybd_event
  4. open the champagne
But it relies heavily on the foreground window not changing, like I previously mentioned.


Sorry, no Easter Egg here. But you weren't looking for one anyway so it doesn't matter.




Post 29 May 2008, 20:51
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 29 May 2008, 21:53
Alright, this compiles... but does not add anything to window.

Craziness Sad

Code:
format PE GUI 4.0 
entry start 
Include 'win32a.inc' 

;;;;;;;;;;;;;;;;;;;;;;;;; 
;    Data Section       ; 
;;;;;;;;;;;;;;;;;;;;;;;;; 

section '.data' data readable writeable 
_title db 'Basic Web Browser By Calpol2004',0
_class db 'MyWindowClass',0 
browserclassname db 'AtlAxWin',0                      ;class name of browser control 
browserhome      db 'http://www.google.com',0        ;page to go to
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class 
msg MSG 
edithwnd dd ? 
client RECT
;;;;;;;;;;;;;;;;;;
; extra code added to Calpol2004's  ;;
;;;;;;;;;;;;;;;;;;


;.data
StrToSend db 'text to send',0

;.code
..Start: 
push ebp 
mov ebp,esp 

;push [WindowHandle]
call [SetForegroundWindow]

push StrToSend 
call SendKeys 

mov esp,ebp 
pop ebp 
ret 0 

SendKeys: 
.theStr equ ebp-8 
  push ebp 
  mov ebp,esp 
  push esi 
  mov esi, [.theStr] 
.LoopToNull: 
  cmp byte[esi],0 
  je .AllDone 
  movzx eax,byte[esi] 
  push eax ;save it for 2nd call 

  push 0 ;extra info 
  push 1 ;flag 
  push 0 ;key ScanCode 
  push eax ;Virtual Keycode using ASCII 
  call [keybd_event] 
  pop eax ;get saved VK code 
  push 0 ;extra info 
  push 3 ;flags for key UP 
  push 0 ;scan code 
  push eax ;VK Code 
  call [keybd_event] 

  add esi,1 
  jmp .LoopToNull 
.AllDone: 
  pop esi 
  mov esp,ebp 
  pop ebp 
  ret 4

;;;;end of added code;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;             Start               ; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

section '.code' code readable executable 
start: 
invoke  GetModuleHandle,0 
mov     [wc.hInstance],eax 
invoke  LoadIcon,0,IDI_APPLICATION 
mov     [wc.hIcon],eax 
invoke  LoadCursor,0,IDC_ARROW 
mov     [wc.hCursor],eax 
invoke  RegisterClass,wc 
invoke  CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_SYSMENU+WS_MAXIMIZEBOX+WS_MINIMIZEBOX+WS_SIZEBOX,50,30,700,500,NULL,NULL,[wc.hInstance],NULL 
msg_loop: 
invoke  GetMessage,msg,NULL,0,0 
or      eax,eax 
jz      end_loop 
invoke  TranslateMessage,msg 
invoke  DispatchMessage,msg 
jmp     msg_loop 
end_loop: 
invoke  ExitProcess,[msg.wParam] 
;end message loop 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;        Window Procedure           ; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

proc WindowProc hwnd,wmsg,wparam,lparam 
push    ebx esi edi 
cmp     [wmsg],WM_CLOSE 
je      wmclose 
cmp     [wmsg],WM_DESTROY 
je      wmdestroy 
cmp     [wmsg],WM_CREATE 
je      wmcreate 
cmp     [wmsg],WM_SIZE 
je      wmsize 
defwndproc: 
invoke  DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] 
jmp     finish 
        wmdestroy: 
                invoke  PostQuitMessage,0 
                xor     eax,eax 
        jmp     finish 
        wmclose: 

                invoke  DestroyWindow,[hwnd] 
        jmp     finish 
        wmcreate: 
                invoke  AtlAxWinInit         ;make class available 
                invoke  GetClientRect,[hwnd],client      ;get size of window so browser control is set to the same size 
                invoke  GetModuleHandle,0 
                invoke  CreateWindowEx,WS_EX_CLIENTEDGE,browserclassname,browserhome,WS_CHILD+WS_VISIBLE+WS_VSCROLL+WS_HSCROLL,[client.left],[client.top],[client.right],[client.bottom],[hwnd],eax,0 
                mov     [edithwnd],eax          ;hwnd returned by CreateWindowEx is moved onto edithwnd variable as its a parameter for MoveWindow() 
        jmp     finish 
        wmsize: 
                invoke  GetClientRect,[hwnd],client       ;re-retrieve the window size 
                invoke  MoveWindow,[edithwnd],[client.left],[client.top],[client.right],[client.bottom],TRUE        ;adjust size of control 
        jmp     finish 
finish: 
pop     edi esi ebx 
ret 
endp 
;end of window procedure 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;       Import Data           ; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

section '.idata' import data readable writeable 
library kernel32,'KERNEL32.DLL',user32,'USER32.DLL',atl,'ATL.dll' 
include 'api\kernel32.inc'
include 'api\user32.inc'
import  atl,AtlAxWinInit,'AtlAxWinInit' 
;end of imports

    
Post 29 May 2008, 21:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 22:06
You can't send Virtual-Key codes like that. You have to convert from ASCII to VK codes. Use MapVirtualKey.

You are setting the foreground window to what? Your stack will be unbalanced after the return because you didn't push the correct number of parameters.

I expect the flag value should be 0, not 1. And the second call the flag should be KEYEVENTF_KEYUP, not 3.
Post 29 May 2008, 22:06
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 22:08
BTW: I like your browserhome value Smile
Post 29 May 2008, 22:08
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20518
Location: In your JS exploiting you and your system
revolution 29 May 2008, 22:11
Ooh, I just scrolled down to the bottom. Where do you call ..start? You have to actualy call it from somewhere else nothing will happen!
Post 29 May 2008, 22:11
View user's profile Send private message Visit poster's website Reply with quote
BigVent



Joined: 28 May 2008
Posts: 24
BigVent 30 May 2008, 01:10
That my friend is why you are a guru & and I am but a newb. Very Happy I tried to implement some code... and it does not work.

I left the code the same from Calpol2004's post because I cannot broadcast my username & password to the world. No offense...

I have changed my https:// site in my actual app... that will pull up the server logon.

Please help!!! I know this would take you like 5 minutes to do since you are ubah.


Many thanks,

~BigVent
Post 30 May 2008, 01:10
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4161
Location: vpcmpistri
bitRAKE 30 May 2008, 01:38
I would venture to say 90% of the people using AutoHotKey use it to automate internet usage. It's extremely easy because it records and plays back - no programming required. From people that play online games to sweepstakes entries - the forum over there is literally filled with similar requests as yours, and example macros.

If the interest is in learning/using x86 then please ignore the above paragraph.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 30 May 2008, 01:38
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.