flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
MichaelH 18 Dec 2007, 08:00
http://board.flatassembler.net/topic.php?t=6085
Tomasz Grysztar wrote:
Yippee, a plugin system for fasm is in its final design stage ..... should be any day now ![]() |
|||
![]() |
|
bitRAKE 18 Dec 2007, 10:33
I'm very interested in what Tomasz has devised. Currently, I'm just marking the changes that have been made in the source to make it easier to forward patches.
I really don't like any of the syntax highlighting solutions thus far. Instead it would be better to have different color sets for different purposes. For example, the instructions can be divided into groups based on function, or architecture, or data type, or flags effected, etc... Each grouping has a specific use and coloring would help assist debugging or composing algorithms. Additionally, assembly directives should be colored differently than preprocessing directives (I like these bold). This way a sharp division in functionality of language syntax can be clearly seen. |
|||
![]() |
|
f0dder 18 Dec 2007, 12:53
bitRAKE: do you ever reach the ExitProcess call? If you do, the process really ought to terminate, on matter how many ATL threads have been created...
|
|||
![]() |
|
vid 18 Dec 2007, 13:06
I think f0dder is right. Study MSDN about when GetMessage returns 0.
|
|||
![]() |
|
Tomasz Grysztar 18 Dec 2007, 13:16
Good, that you reminded me. I should finally make at least the elementary plugin interface available, so people could start to extend fasmw in at least the basic areas.
|
|||
![]() |
|
LocoDelAssembly 18 Dec 2007, 13:42
Code: test eax,eax
jne .msg
Could be changed to Code: inc eax cmp eax, 1 ja .msg To also handle the case in which GetMessage could return -1. It is documented but normally no one cares about the possibility of a -1 result. Perhaps there is something that guarantees that such result will never happen? |
|||
![]() |
|
bitRAKE 18 Dec 2007, 17:37
f0dder wrote: bitRAKE: do you ever reach the ExitProcess call? If you do, the process really ought to terminate, on matter how many ATL threads have been created... Code: .msg: invoke SendMessageA,esi,WM_FORWARDMSG,0,ebx test eax,eax jne .get invoke DispatchMessageA,ebx .get: invoke GetMessageA,ebx,ebp,ebp,ebp test eax,eax je .x inc eax jne .msg |
|||
![]() |
|
f0dder 18 Dec 2007, 23:47
Yeah, you probably need to stuff it inside a parent window, and let the parent window handle WM_CLOSE and WM_DESTROY... think of it, it'd be hilarious for a child control to PostQuitMessage when it's destroyed
![]() |
|||
![]() |
|
bitRAKE 19 Dec 2007, 00:49
Was going to setup event handler for quit message from browser, but then I noticed other stuff not working - can't even post to the forum without it choking on some script.
There is one example ( http://www.codeproject.com/KB/cpp/FlashGui.aspx ) that doesn't pass a parent window, but everything else I've come across does. And there is a good article which doesn't indicate the need for a parent window, but their code always has it as a child window. It says the control sub-classes the AtlAxWin window. Anyhow, I can't imagine it posting the WM_QUIT message - something must be done about that. Obviously, much more involved than I wish it to be. ![]() |
|||
![]() |
|
f0dder 19 Dec 2007, 12:10
Well, if you subclass the window, you can have it PostQuitMessage on window close, and probably don't need a parent window then...
|
|||
![]() |
|
Yardman 20 Dec 2007, 18:45
[ Post removed by author. ]
Last edited by Yardman on 04 Apr 2012, 02:57; edited 1 time in total |
|||
![]() |
|
bitRAKE 20 Dec 2007, 19:08
Thank you, that is a cute game. (c:
I was just trying to find a way around creating the parent window - silly, I know! |
|||
![]() |
|
f0dder 20 Dec 2007, 23:37
bitRAKE wrote: Thank you, that is a cute game. (c: Well, subclass and have WM_CLOSE do PostQuitMessage. But you might as well go for parent window right away, will make it easier to add toolbars and whatnot if you want to do that later on. _________________ ![]() |
|||
![]() |
|
bitRAKE 21 Dec 2007, 11:34
Couple changes:
(parent window of course solved all the previous problems. yet, I still have no idea why it is required.)
|
|||||||||||
![]() |
|
Yardman 21 Dec 2007, 17:48
[ Post removed by author. ]
Last edited by Yardman on 04 Apr 2012, 02:58; edited 1 time in total |
|||
![]() |
|
bitRAKE 31 Mar 2008, 18:38
Another example of using Javascript and HTML from fasm:
(I just converted it to FASM, author is http://www.kakeeware.com/i_htmldialog.php) Code: include 'win32wx.inc' .end start start: .frame = 4096 sub esp,.frame xor ebx,ebx mov ebp,esp invoke lstrcpy,ebp,uRes lea eax,[ebp+uRes.bytes-2] invoke GetModuleFileName,ebx,eax,.frame-uRes.bytes invoke lstrcat,ebp,uMet invoke CoInitialize,ebx push ebp invoke CreateURLMoniker,ebx,ebp,esp invoke ShowHTMLDialog,ebx,dword[esp+12],ebx,ebx,ebx invoke CoUninitialize invoke ExitProcess,ebx uRes du "res://",0 .bytes = $-uRes uMet du "/#1",0 data resource directory \ RT_HTML,html resource html,\ 1,LANG_ENGLISH+SUBLANG_DEFAULT,html_data resdata html_data db \ '<html>',\ '<head>',\ '<title>HTMLDialog</title>',\ '<script>',\ 'function init()',\ '{',\ 'C=Math.cos;',\ 'L=H.filters.Light;',\ 't=144;',\ 'x=520;',\ 'A=setInterval("A+=.1;L.clear();',\ 'L.addPoint(t+256*C(A),t-t*C(A*3),t+96*C(A*2),192,x,x,x);',\ 'L.addPoint(t-128*C(A*1.7),192+t*C(A*2),t+32*C(A*2),x,x,192,x);',\ 'L.addPoint(t-64*C(A*1.3),t+64*C(A*2),128+t*C(A*2),x,255-x,64,x)",9)',\ '}',\ '</script>',\ '</head>',\ '<body onload=init(); scroll=no style="border:0;margin:0;padding;0" bgcolor=#000000>',\ '<table align=center valign=middle cellpadding=0 cellspacing=0 width=100 style="border:0;margin:0;padding;0">',\ '<tr valign=middle>',\ '<td align=center>',\ '<textarea id=H style=filter:Light;height:500;width:500>',\ 'JavaScript code ripped (and modified :) ',\ 'from an amazing HTML Metaballs demo by poi ;)',\ '</textarea>',\ '</td>',\ '</tr>',\ '</table>',\ '</body>',\ '</html>',0 endres end data |
|||
![]() |
|
itsnobody 01 Apr 2008, 00:47
The reason it doesn't terminate is because it's just a message loop...I don't think a parent window is required
if you just have a message loop in any program it won't terminate |
|||
![]() |
|
itsnobody 01 Apr 2008, 02:35
I got it kind of working without a Parent window, you have to use Sub-classing for child windows...
|
|||
![]() |
|
itsnobody 01 Apr 2008, 02:45
Here it is works perfectly without a useless wasted parent window:
Code: format PE GUI 4.0 hInstance = $400000 section '.bitRAKE' code import readable executable writeable dd 0,0,0, RVA kernel_name, RVA kernel_table dd 0,0,0, RVA user_name, RVA user_table dd 0,0,0, RVA atl_name, RVA atl_table dd 0,0,0, 0, 0 kernel_table: ExitProcess dd RVA _ExitProcess dd 0 user_table: CallWindowProc dd RVA _CallWindowProc CreateWindowExA dd RVA _CreateWindowExA DispatchMessageA dd RVA _DispatchMessageA GetMessageA dd RVA _GetMessageA GetSystemMetrics dd RVA _GetSystemMetrics MessageBoxA dd RVA _MessageBoxA SetWindowLong dd RVA _SetWindowLong dd 0 atl_table: AtlAxWinInit dd RVA _AtlAxWinInit dd 0 ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ include "WIN32AX.INC" oldProc dd ? entry $ xor ebp,ebp call [AtlAxWinInit] test eax,eax jne .ok invoke MessageBoxA,ebp,"Failed!",_AtlAxWinInit+2,MB_ICONEXCLAMATION jmp .x .ok: invoke GetSystemMetrics,SM_CXSCREEN mov esi,eax invoke GetSystemMetrics,SM_CYSCREEN mov edi,eax invoke CreateWindowExA,\ WS_EX_ACCEPTFILES or WS_EX_OVERLAPPEDWINDOW,\ "AtlAxWin",\ "http://board.flatassembler.net/index.php",\ WS_VISIBLE or WS_POPUP or WS_HSCROLL or WS_VSCROLL,\ ebp,ebp,esi,edi,\ ebp,ebp,hInstance,ebp invoke SetWindowLong,eax,GWL_WNDPROC,DestroyProc mov [oldProc],eax mov ebx,msg jmp .get .msg: push ebx call [DispatchMessageA] .get: invoke GetMessageA,ebx,ebp,ebp,ebp test eax,eax jne .msg .x: push eax call [ExitProcess] retn proc DestroyProc hwnd,wmsg,wparam,lparam cmp [wmsg],WM_DESTROY je .wmdestroy invoke CallWindowProc,[oldProc],[hwnd],[wmsg],[wparam],[lparam] ret .wmdestroy: invoke ExitProcess,0 endp ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ kernel_name db 'KERNEL32',0 user_name db 'USER32',0 atl_name db "ATL",0 _ExitProcess db 0,0,'ExitProcess',0 _CreateWindowExA db 0,0,'CreateWindowExA',0 _DispatchMessageA db 0,0,'DispatchMessageA',0 _GetMessageA db 0,0,'GetMessageA',0 _GetSystemMetrics db 0,0,'GetSystemMetrics',0 _MessageBoxA db 0,0,'MessageBoxA',0 _SetWindowLong db 0,0,'SetWindowLongA',0 _CallWindowProc db 0,0,'CallWindowProcA',0 _AtlAxWinInit db 0,0,"AtlAxWinInit",0 ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ msg MSG I just had to import 2 functions and add a variable |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.