flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2 |
Author |
|
Tomasz Grysztar 29 Jul 2004, 18:37
Very soon, there is already a pre-release in the "IDE development" forum.
|
|||
![]() |
|
fasm9 29 Jul 2004, 19:27
some_kind_of_form:(mov eax,0 inc ebx mov eax,[ebx] org 700h mov eax,$)
Hi, Admin how about this? i am serious. -- |
|||
![]() |
|
fasm9 30 Jul 2004, 00:19
s/form/mechanism
In assembly language, is there some equivalent to C language's function? i mean something like this int function_1(int i){ ... return j;} |
|||
![]() |
|
crc 30 Jul 2004, 00:42
Quote: some_kind_of_form:(mov eax,0 inc ebx mov eax,[ebx] org 700h mov eax,$) Looks too high-level in my opinion. This isn't C! If you want procedures, use the macros to set them up. |
|||
![]() |
|
Octavio 30 Jul 2004, 23:06
Privalov wrote: Very simple to do, just open ASSEMBLE.INC file and find the "instruction_assembler" label (around the line 324), and then instruction I think that there could be a problem with combinations like this: mov ebx,5 xor eax,6 is fasm able to know if xor is a instruction or a operator? |
|||
![]() |
|
Tomasz Grysztar 31 Jul 2004, 10:13
For the same reason fasm supports the optional colon charactrer after the "times" directive, because in case of:
Code: times 4 shl al,1 the "shl" would be treated as operator, not instruction, so you have to do: Code: times 4: shl al,1 Note that this tweak replaces the error jump, so the added feature works only where that error is applied by standard version. |
|||
![]() |
|
Matrix 11 Sep 2004, 16:59
Octavio wrote:
nice ![]() - let the crosslinked elements have a copy of the overlapping area - like in scandisk ![]() - mov ebx,5 xor eax,6 in my opinion it is not a big problem to make a difference in the two, because xor has 2 parameters as you see it in your code, so if xor has parameters it cannot be a logical operation to mov ebx,5 and by the way, why whould you do such a thing? just evaluate your constants and you won't have problems like this. see my code: Code: mov ax,$1 ; this puts in 1 and this is a working program org 100h mov ax,msg call DOSWRITESTR mov ax,$4c00 int $21 set320x200: mov ax,$13 int $10 ret set80x25t: mov ax,$07 int $10 ret DOSWRITESTR: mov DX,AX mov AH,0x9 INT 0x21 ret msg db 'Is anybody out there?$'; hy Privalov, i think it is not a bad thing, you should also add a switch and/or an option for this in the menu and there is something about the editor itself, have you seen totalcommander's and norton commander's brief function? with assembly codes you can write at least 4 times more code onto screen by brief displaying. <= so you should add it to your features list ![]() you know in the menu/options/display/brief: enabled/disabled, define brief width so you have many ideas now, you can decide which is better / and or more important/useful MATRIX |
|||
![]() |
|
Matrix 11 Sep 2004, 17:01
ps.: if you really need these in one line : mov ebx,5 xor eax,6
use this piece of code : mov ebx,5 nop xor eax,6 MATRIX |
|||
![]() |
|
Tomasz Grysztar 11 Sep 2004, 17:12
Even
Code: mov ebx,5 some_label: xor eax,6 PS. In fasm you don't have any switches that would affect the result of compilation, that is: the same source should compile always in the same way, no matter which OS port of fasm is compiling it and with what settings (the switches can decide only, whether fasm can actually manage to compile the given source, as they can control memory allocation or passes limit). That's why, for instance, fasm has the directive for choosing output format, instead of command line switch.This is one of the substantial attributes of fasm, and I'm not going to change it. Last edited by Tomasz Grysztar on 12 Sep 2004, 11:13; edited 1 time in total |
|||
![]() |
|
scientica 12 Sep 2004, 08:19
>This is one of the substantial attributes of fasm, and I'm not going to change it.
![]() ![]() |
|||
![]() |
|
metalfishx 25 Oct 2004, 20:21
Hello.
Theres a way to use macros in the same line? I want to use some kind of basic declaration... Ex: DECLARE ExitProcess LIB "KERNEL32" ALIAS Exit Wheres DECLARE is one macro, LIB is other and ALIAS is another one. Is this possible? Thanks! _________________ --------------------------------------- Roberto A. Berrospe Machin Ruta Internet, Florida Uruguay --------------------------------------- |
|||
![]() |
|
crc 25 Oct 2004, 20:47
No, this won't work with macros
![]() |
|||
![]() |
|
metalfishx 26 Oct 2004, 12:32
![]() Why, why god why this happen to me ..... ![]() Thanks crc for your answer. _________________ --------------------------------------- Roberto A. Berrospe Machin Ruta Internet, Florida Uruguay --------------------------------------- |
|||
![]() |
|
Zetus 15 Sep 2006, 06:44
Thanks))
|
|||
![]() |
|
hidden 13 Mar 2007, 06:32
Quote:
Hek... ![]() It's already few ways to make fasm code unreadable ![]() 1 hover research and... somebody's bad dream is real ![]() Code: @ fix rept 1 { mov.eax fix } rept 1 { xor.esi fix } rept 1 { not.ebp fix } rept 1 { xchg.edi fix } rept 1 { lea.not fix } rept 1 { test.r fix } rept 1 { @ format PE GUI 4.0 mov.eax entry start not.ebp include 'win32a.inc' not.ebp IDM_NEW = 101 not.ebp IDM_EXIT = 102 not.ebp IDM_ABOUT = 901 xor.esi section '.data' data readable writeable mov.eax _class TCHAR 'MINIPAD32',0 xor.esi _edit TCHAR 'EDIT',0 mov.eax _title TCHAR 'MiniPad',0 xor.esi _about_title TCHAR 'About MiniPad',0 xor.esi _about_text TCHAR 'This is Win32 example program created with flat assembler.',0 xor.esi _error TCHAR 'Startup failed.',0 not.ebp wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class xor.esi edithwnd dd ? mov.eax editfont dd ? mov.eax msg MSG mov.eax client RECT not.ebp section '.code' code readable executable not.ebp start: xor.esi invoke GetModuleHandle,0 not.ebp mov [wc.hInstance],eax xor.esi invoke LoadIcon,eax,17 not.ebp mov [wc.hIcon],eax xor.esi invoke LoadCursor,0,IDC_ARROW mov.eax mov [wc.hCursor],eax xor.esi invoke RegisterClass,wc not.ebp test eax,eax xor.esi jz error mov.eax invoke LoadMenu,[wc.hInstance],37 not.ebp invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW,144,128,256,256,NULL,eax,[wc.hInstance],NULL xor.esi test eax,eax mov.eax jz error not.ebp msg_loop: not.ebp invoke GetMessage,msg,NULL,0,0 xor.esi cmp eax,1 mov.eax jb end_loop xor.esi jne msg_loop xor.esi invoke TranslateMessage,msg mov.eax invoke DispatchMessage,msg not.ebp jmp msg_loop xor.esi error: xor.esi invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK mov.eax end_loop: xor.esi invoke ExitProcess,[msg.wParam] xor.esi proc WindowProc hwnd,wmsg,wparam,lparam not.ebp push ebx esi edi mov.eax cmp [wmsg],WM_CREATE not.ebp je .wmcreate mov.eax cmp [wmsg],WM_SIZE xor.esi je .wmsize xor.esi cmp [wmsg],WM_SETFOCUS xor.esi je .wmsetfocus mov.eax cmp [wmsg],WM_COMMAND not.ebp je .wmcommand not.ebp cmp [wmsg],WM_DESTROY not.ebp je .wmdestroy mov.eax .defwndproc: mov.eax invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] mov.eax jmp .finish xor.esi .wmcreate: mov.eax invoke GetClientRect,[hwnd],client xor.esi invoke CreateWindowEx,WS_EX_CLIENTEDGE,_edit,0,WS_VISIBLE+WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_AUTOHSCROLL+ES_AUTOVSCROLL+ES_MULTILINE,[client.left],[client.top],[client.right],[client.bottom],[hwnd],0,[wc.hInstance],NULL mov.eax or eax,eax xor.esi jz .failed mov.eax mov [edithwnd],eax xor.esi invoke CreateFont,16,0,0,0,0,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_RASTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH+FF_DONTCARE,NULL mov.eax or eax,eax xor.esi jz .failed xor.esi mov [editfont],eax xor.esi invoke SendMessage,[edithwnd],WM_SETFONT,eax,FALSE xor.esi xor eax,eax mov.eax jmp .finish mov.eax .failed: not.ebp or eax,-1 xor.esi jmp .finish mov.eax .wmsize: xor.esi invoke GetClientRect,[hwnd],client xor.esi invoke MoveWindow,[edithwnd],[client.left],[client.top],[client.right],[client.bottom],TRUE xor.esi xor eax,eax not.ebp jmp .finish xor.esi .wmsetfocus: not.ebp invoke SetFocus,[edithwnd] not.ebp xor eax,eax xor.esi jmp .finish mov.eax .wmcommand: not.ebp mov eax,[wparam] not.ebp and eax,0FFFFh xor.esi cmp eax,IDM_NEW xor.esi je .new not.ebp cmp eax,IDM_ABOUT mov.eax je .about xor.esi cmp eax,IDM_EXIT xor.esi je .wmdestroy xor.esi jmp .defwndproc mov.eax .new: xor.esi invoke SendMessage,[edithwnd],WM_SETTEXT,0,0 mov.eax jmp .finish not.ebp .about: xor.esi invoke MessageBox,[hwnd],_about_text,_about_title,MB_OK not.ebp jmp .finish xor.esi .wmdestroy: not.ebp invoke DeleteObject,[editfont] xor.esi invoke PostQuitMessage,0 not.ebp xor eax,eax not.ebp .finish: not.ebp pop edi esi ebx xor.esi ret mov.eax endp mov.eax section '.idata' import data readable writeable mov.eax library kernel,'KERNEL32.DLL', user,'USER32.DLL', gdi,'GDI32.DLL' xor.esi import kernel, GetModuleHandle,'GetModuleHandleA', ExitProcess,'ExitProcess' xor.esi import user, RegisterClass,'RegisterClassA', CreateWindowEx,'CreateWindowExA', DefWindowProc,'DefWindowProcA', SetWindowLong,'SetWindowLongA', RedrawWindow,'RedrawWindow', GetMessage,'GetMessageA', TranslateMessage,'TranslateMessage', DispatchMessage,'DispatchMessageA', SendMessage,'SendMessageA', LoadCursor,'LoadCursorA', LoadIcon,'LoadIconA', LoadMenu,'LoadMenuA', GetClientRect,'GetClientRect', MoveWindow,'MoveWindow', SetFocus,'SetFocus', MessageBox,'MessageBoxA', PostQuitMessage,'PostQuitMessage' xor.esi import gdi, CreateFont,'CreateFontA', DeleteObject,'DeleteObject' mov.eax section '.rsrc' resource data readable xor.esi directory RT_MENU,menus, RT_ICON,icons, RT_GROUP_ICON,group_icons, RT_VERSION,versions not.ebp resource menus, 37,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu not.ebp resource icons, 1,LANG_NEUTRAL,icon_data xor.esi resource group_icons, 17,LANG_NEUTRAL,main_icon xor.esi resource versions, 1,LANG_NEUTRAL,version xor.esi menu main_menu mov.eax menuitem '&File',0,MFR_POPUP xor.esi menuitem '&New',IDM_NEW xor.esi menuseparator xor.esi menuitem 'E&xit',IDM_EXIT,MFR_END not.ebp menuitem '&Help',0,MFR_POPUP + MFR_END not.ebp menuitem '&About...',IDM_ABOUT,MFR_END not.ebp icon main_icon,icon_data,'minipad.ico' not.ebp versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0, 'FileDescription','MiniPad - example program', 'LegalCopyright','No rights reserved.', 'FileVersion','1.0', 'ProductVersion','1.0', 'OriginalFilename','MINIPAD.EXE' not.ebp } Exploit:(Protected ![]() ![]() Code: open(I,'MINIPAD.ASM');open(O,'>MINIPAD1.ASM');@alt=('mov.eax','xor.esi','not.ebp','xchg.edi','lea.not','test.r');$line='';while(<I>){$_.="\n";s/(('.*')*);.*/$1/;s/[\s\t]+/ /g;s/$/${alt[rand(3)]}/ if(!s/(('.*')*)\x5C.*$/$1/&&length()>1);$line.=" $_ ";}$line=~s/[\s\t]+/ /g;print O "@ fix rept 1 {\n";for(@alt){print 0 "$_ fix } rept 1 {\n"}print O "\@$line}";close(O);close(I); I think programmer should decide, does he wont his code to be readable or not, and language should get to him alternatives whatever he's decided. ![]() PS sorry for off topic
|
|||||||||||
![]() |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.