flat assembler
Message board for the users of flat assembler.

Index > Windows > Fasm Simple Web Browser

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Force



Joined: 12 Jun 2012
Posts: 29
Force 02 Nov 2012, 21:22
Simple ATL web browser


Description:
Download
Filename: BROWSER.zip
Filesize: 2.08 KB
Downloaded: 977 Time(s)

Post 02 Nov 2012, 21:22
View user's profile Send private message Reply with quote
pool



Joined: 08 Jan 2007
Posts: 97
pool 03 Nov 2012, 00:50
..


Last edited by pool on 17 Mar 2013, 12:16; edited 1 time in total
Post 03 Nov 2012, 00:50
View user's profile Send private message Reply with quote
Force



Joined: 12 Jun 2012
Posts: 29
Force 03 Nov 2012, 14:16
[ Post removed by author. ]


Last edited by Force on 17 Mar 2013, 20:01; edited 1 time in total
Post 03 Nov 2012, 14:16
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 03 Nov 2012, 20:35
Change the URL to this: ftp://ftp.microsoft.com/
Post 03 Nov 2012, 20:35
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 04 Nov 2012, 13:59
it does nothing
Post 04 Nov 2012, 13:59
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 04 Nov 2012, 15:59
DOS386 wrote:
it does nothing


This isn't DOS.
Post 04 Nov 2012, 15:59
View user's profile Send private message Reply with quote
patchariadog



Joined: 24 Mar 2013
Posts: 94
patchariadog 19 Aug 2014, 01:27
does anyone know how to get the current url address the user is on?

P.S. nice stuff here. I noticed that it uses a third less memory then the regular IE (90,000 vs 30,000)
Post 19 Aug 2014, 01:27
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 19 Aug 2014, 19:52
patchariadog wrote:
does anyone know how to get the current url address the user is on?

P.S. nice stuff here. I noticed that it uses a third less memory then the regular IE (90,000 vs 30,000)


Yes of course. Use COM

Check out the FASM COM example and within minutes you can convert the following to FASM.

Remember to start with IUnknown members (3 dwords) when defining your IWebBrowser2 interface.

Code:
       CoInitialize(NULL);

        // just a pointer to a VTABLE (Check the FASM COM example)
        IWebBrowser2 * wb;
        IUnknown * pUnk;

        // easy to create this in FASM
        VARIANT vVal = {0};

        // send message to host
        AtlAxGetControl(handle, &pUnk); // atl.dll

        // get web the browser interface (version 2) (you can also get the IDocument interface, etc)
        // more info here: http://msdn.microsoft.com/en-us/library/aa752127(v=vs.85).aspx
        pUnk->QueryInterface(IID_IWebBrowser2, (void**)&wb);

        BSTR loc = NULL;
        wb->get_LocationURL(&loc);

        MessageBoxW(0, loc, 0, 0);

        SysFreeString(loc);
    
        wb->Release();
    


Put some buttons and an edit box then you have yourself a fully fledged web browser.

If you want an example in FASM I can do it. But I'll need 5 or more votes lol.
Post 19 Aug 2014, 19:52
View user's profile Send private message Reply with quote
patchariadog



Joined: 24 Mar 2013
Posts: 94
patchariadog 24 Aug 2014, 04:39
Thanks typedef. I will try the example tomorrow, but I may need help converting it to fasm, although I think I can do it.
Post 24 Aug 2014, 04:39
View user's profile Send private message Reply with quote
patchariadog



Joined: 24 Mar 2013
Posts: 94
patchariadog 24 Aug 2014, 06:59
I decided to stay up and I could not figure this out for the past 2 hours. I am going to bed, I did not get that far at all because I dont understand the commands. I would really appreciate it if you could build that example in fasm.

thanks
Post 24 Aug 2014, 06:59
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 25 Aug 2014, 17:28
looks cool,
i am in, will try to figure this out, i see that i could use it in my project too if i could transfer string from javascript into another dll.
Post 25 Aug 2014, 17:28
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 25 Aug 2014, 21:04
i figure out a bit, able to GoHome and GoBack,

Code:
invoke  LoadLibrary, <'atl.dll',0>
invoke  GetProcAddress, eax, <'AtlAxGetControl',0>
  mov   [_AtlAxGetControlAddr],eax
------------
.wmactivate:
invoke  CreateWindowEx,NULL,<'AtlAxWin',0>,<'http://www.google.com',0>,\
                WS_CHILD + WS_VISIBLE + WS_BORDER + WS_HSCROLL + WS_VSCROLL,\
                5,5,370,300,\
                [hwnd],NULL,[wc.hInstance],NULL
  mov   [web],eax
------------
on button 1 click event
  mov   eax,[_AtlAxGetControlAddr]
  push  wbIUnknown
  push  [web]
  call  eax
  comcall [wbIUnknown],IWebBrowser2,QueryInterface,IID_IWebBrowser2,ppv
  cmp   eax,0
  mov   eax,[ppv]
  comcall eax,IWebBrowser2,GoHome
------------
on button 2 click event
  mov   eax,[ppv]
  comcall eax,IWebBrowser2,GoBack
------------
IID_IWebBrowser2                GUID D30C1661-CDAF-11D0-8A3E-00C04FC9E26E

    


Last edited by sleepsleep on 26 Aug 2014, 14:17; edited 1 time in total
Post 25 Aug 2014, 21:04
View user's profile Send private message Reply with quote
patchariadog



Joined: 24 Mar 2013
Posts: 94
patchariadog 26 Aug 2014, 04:26
Hi sleepsleep nice job, but I don't get your code. i don't understand lots of things, but what is comcall is this a call to a function you made? also what is ppv
Post 26 Aug 2014, 04:26
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 26 Aug 2014, 14:18
this one good for you =)
i am having problem with VARIANT struct,
i am trying to figure out how to supply VARIANT type arguments methods eg. Navigate.
Code:
interface IWebBrowser2,\
           QueryInterface,\
           AddRef,\
           Release,\
           GetTypeInfoCount,\
           GetTypeInfo,\
           GetIDsOfNames,\
           Invoke,\
           GoBack,\
           GoForward,\
           GoHome,\
           GoSearch,\
           Navigate,\
           Refresh,\
           Refresh2,\
           Stop,\
           get_Application,\
           get_Parent,\
           get_Container,\
           get_Document,\
           get_TopLevelContainer,\
           get_Type,\
           get_Left,\
           put_Left,\
           get_Top,\
           put_Top,\
           get_Width,\
           put_Width,\
           get_Height,\
           put_Height,\
           get_LocationName,\
           get_LocationURL,\
           get_Busy,\
           Quit,\
           ClientToWindow,\
           PutProperty,\
           GetProperty,\
           get_Name,\
           get_HWND,\
           get_FullName,\
           get_Path,\
           get_Visible,\
           put_Visible,\
           get_StatusBar,\
           put_StatusBar,\
           get_StatusText,\
           put_StatusText,\
           get_ToolBar,\
           put_ToolBar,\
           get_MenuBar,\
           put_MenuBar,\
           get_FullScreen,\
           put_FullScreen,\
           Navigate2,\
           QueryStatusWB,\
           ExecWB,\
           ShowBrowserBar,\
           get_ReadyState,\
           get_Offline,\
           put_Offline,\
           get_Silent,\
           put_Silent,\
           get_RegisterAsBrowser,\
           put_RegisterAsBrowser,\
           get_RegisterAsDropTarget,\
           put_RegisterAsDropTarget,\
           get_TheaterMode,\
           put_TheaterMode,\
           get_AddressBar,\
           put_AddressBar,\
           get_Resizable,\
           put_Resizable
    
Post 26 Aug 2014, 14:18
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 26 Aug 2014, 14:20
patchariadog wrote:
Hi sleepsleep nice job, but I don't get your code. i don't understand lots of things, but what is comcall is this a call to a function you made? also what is ppv


typedef wrote:
Check out the FASM COM example and within minutes you can convert the following to FASM.
Post 26 Aug 2014, 14:20
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 27 Aug 2014, 06:55
i couldn't get the VARIANT to work, =(

data section
=========
vv rb 0xFFFF
url1 dd 0

code section
=========
Code:
.btn3:
  invoke        SysAllocString,<'http://www.google.com/',0>
  mov   [url1],eax
  invoke        VariantInit, vv
  mov  eax,vv
  comcall [ppv],IWebBrowser2,Navigate,[url1], eax,eax,eax,eax
  invoke        SysFreeString,[url1]
    


btw,
i created a VARIANT struct, maybe this is how it supposes to be done?
Code:
struct VARIANT
 vt  dd ?
 wr1 dd ?
 wr2 dd ?
 wr3 dd ?
ends

invoke  VariantInit, vv1
  mov  [vv1.vt],0
  comcall [ppv],IWebBrowser2,Navigate,[url1], vv1, vv1, vv1, vv1
    

still doesn't seems to work..
Post 27 Aug 2014, 06:55
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 27 Aug 2014, 09:30
A VARIANT is a big struct/union. What does not work: what HRESULT are you getting back from the Navigate comcall?
Post 27 Aug 2014, 09:30
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12878
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 27 Aug 2014, 17:19
opened up IEContainer, written by masm japheth,

relevant portion
Code:
004011DE  |. FF15 54304000  CALL DWORD PTR DS:[<&OleAut32.#8>]       ;  OleAut32.VariantInit
004011E4  |. 6A 00          PUSH 0                                   ; /Index = 0.
004011E6  |. FF75 08        PUSH DWORD PTR SS:[EBP+8]                ; |hWnd
004011E9  |. FF15 6C304000  CALL DWORD PTR DS:[<&USER32.GetWindowLon>; \GetWindowLongA
004011EF  |. 8BC8           MOV ECX,EAX
004011F1  |. 8B51 24        MOV EDX,DWORD PTR DS:[ECX+24]
004011F4  |. 8B12           MOV EDX,DWORD PTR DS:[EDX]
004011F6  |. 8D45 E8        LEA EAX,DWORD PTR SS:[EBP-18]
004011F9  |. 50             PUSH EAX
004011FA  |. 68 C0324000    PUSH IEContai.004032C0
004011FF  |. FF71 24        PUSH DWORD PTR DS:[ECX+24]
00401202  |. FF12           CALL DWORD PTR DS:[EDX]
00401204  |. 83F8 00        CMP EAX,0
00401207  |. 75 29          JNZ SHORT IEContai.00401232
00401209  |. 8B55 E8        MOV EDX,DWORD PTR SS:[EBP-18]
0040120C  |. 8B12           MOV EDX,DWORD PTR DS:[EDX]
0040120E  |. 8D45 EC        LEA EAX,DWORD PTR SS:[EBP-14]
00401211  |. 50             PUSH EAX
00401212  |. 8D45 EC        LEA EAX,DWORD PTR SS:[EBP-14]
00401215  |. 50             PUSH EAX
00401216  |. 8D45 EC        LEA EAX,DWORD PTR SS:[EBP-14]
00401219  |. 50             PUSH EAX
0040121A  |. 8D45 EC        LEA EAX,DWORD PTR SS:[EBP-14]
0040121D  |. 50             PUSH EAX
0040121E  |. FF75 FC        PUSH DWORD PTR SS:[EBP-4]
00401221  |. FF75 E8        PUSH DWORD PTR SS:[EBP-18]
00401224  |. FF52 a2C        CALL DWORD PTR DS:[EDX+2C]
00401227  |. 8B55 E8        MOV EDX,DWORD PTR SS:[EBP-18]
0040122A  |. 8B12           MOV EDX,DWORD PTR DS:[EDX]
0040122C  |. FF75 E8        PUSH DWORD PTR SS:[EBP-18]
0040122F  |. FF52 08        CALL DWORD PTR DS:[EDX+8]
00401232  |> FF75 FC        PUSH DWORD PTR SS:[EBP-4]
00401235  |. FF15 44304000  CALL DWORD PTR DS:[<&OleAut32.#6>]       ;  OleAut32.SysFreeString
    


Code:
;--- Navigate to the URL
        invoke GetWindowLong, hwnd, WO_CONTAINER
        mov ecx, eax
        invoke vf( [ecx].CContainer.m_pOleObject, IUnknown, QueryInterface ), addr IID_IWebBrowser2, addr pWebBrowser
        DebugOut "Navigate: QueryInterface(IID_IWebBrowser2)=%X", eax
        .if ( eax == S_OK )
                invoke vf( pWebBrowser, IWebBrowser2, Navigate), bstrURL, addr vtEmpty, addr vtEmpty, addr vtEmpty, addr vtEmpty
                DebugOut "Navigate: IWebBrowser2::Navigate(%S)=%X", bstrURL, eax
                invoke vf( pWebBrowser, IUnknown, Release )
        .endif
        invoke SysFreeString, bstrURL
    

need coffee...
Post 27 Aug 2014, 17:19
View user's profile Send private message Reply with quote
patchariadog



Joined: 24 Mar 2013
Posts: 94
patchariadog 01 Sep 2014, 00:19
I have been quite busy, but I will try adding to this discussion soon. the progress looks great. (now I know why I have seen people say that com is extremely hard in asm)
Post 01 Sep 2014, 00:19
View user's profile Send private message Reply with quote
uor99



Joined: 04 Dec 2014
Posts: 42
uor99 06 Dec 2014, 00:03
How cool .
I tried hard to implement the GoHome,Navigate ,but failed .
Post 06 Dec 2014, 00:03
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.