flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 10 May 2005, 11:37
This operator applies only to the one symbol that immediately follows it, for example `MB_OK+MB_YESNO becomes 'MB_OK'+MB_YESNO. Also special characters, like [ are treated differently than symbols by preprocessor and therefore cause an error (this actually might be changed, but again, even if allowed, the `[ebx] would make the '['ebx] for you, since preprocessor sees each of [, ebx and ] as separate line elements. This is all because preprocessor operates on its own internal format, which looses some of the original information from source (like spacing) - for that reason I have not used the other possible syntax for this operator, which was like `argument` - converting everything enclosed within, as it wouldn't preserve the original formatting of text, since it was lost anyway while loading the source into preprocessor.
This feature was added in a late stage of fasm's development, mainly for the specific needs of the Fresh project - that's why it's design had to be affected by already existing architecture of fasm (reverse to how it should be usually). And more and more of such problems appear when I try to design (due to requests) some new features that were not initially planned - there are some limits: fasm was designed differently and it cannot become to be like any other assembler without rewriting it and breaking some of the most substantial features it has and principles it follows. Last edited by Tomasz Grysztar on 10 May 2005, 11:49; edited 2 times in total |
|||
![]() |
|
vid 10 May 2005, 11:43
ok, here it is.
`'str2' doesn't work, because you only can convert symbols to strings, not string to string. `MB_OK+MB_YESNO "`" operator converts next symbol to string, so it will become "MB_OK"+MB_YESNO `[eax] - [eax] is not a symbol `dword [tmp] isn't symbol too in conclusion - you only can convert single symbols with "`" operator. To chekc others you have to use "eqtype"s, but there are many types. I suggest something like (not tested) [code] macro displayvalue arg { if arg eqtype "a" ;if arg is string display arg else if arg eqtype 0 ;if arg is numeric constant/label/number display `arg else if arg eqtype ss ;if arg is semgnet register display `arg else ;we can't display things like [eax]. In theory it could have be done ;with virtually generating code, loading it and testing value ;in opcode, but IMHO that's not worth of effort, too many ;possibilietes ([ss:edi],dword [eax], byte [ss:4*eax+ebx+3], ...) } |
|||
![]() |
|
tomz1 10 May 2005, 16:16
I just want to carry out the source code to debug to try in the olldbg.
so My problem is: How get a line of source code? for try it,my some steps is as follows: Code: 1.make F8.bat: @echo off del F:\Ollydbg_v1.10\udd\%1.* F:\fasm\bin\FASM.EXE %1.asm %1.exe >map.txt F:\Ollydbg_v1.10\Ollydbg.exe %1.exe 2.modify some macro: macro proc name,[arg] { common if used name if BuildSourceCodeDebugMap=true display name,' CALL ',`name end if name: ... } macro invoke proc,[arg] { common if BuildSourceCodeDebugMap=true nop display $-1,' <INVOKE ',`proc,'>' end if ... } macro .until [vars] { common if BuildSourceCodeDebugMap=true display $,' <.until>' end if ... } .... 3.use F8.bat compile project,and For example,Include the nether code proc TApp_Run .msg MSG enter lea ebx,[.msg] xor esi,esi .repeat invoke DispatchMessage,ebx .until. <icall GetMessage,ebx,esi,esi,esi>,e,0 return endp 4.we get map.txt: flat assembler version 1.60 00401000 CALL Sub_null ... 00401298 CALL TApp_Run 004012A1 <.repeat> 004012A1 <INVOKE DispatchMessage> 004012A9 <ICALL GetMessage> 004012B4 <.until> ... 7 passes, 1.6 seconds, 2048 bytes. 5.use some plugins(p.s. Labelmaster.dll) in olldbg,import Labels and Comments from "map.txt". so we can see source code in olldbg: 00401298 >/$ C8 200000 ENTER 20,0 ; CALL TApp_Run 0040129C |. 8D5D E0 LEA EBX,[LOCAL.8] 0040129F |. 31F6 XOR ESI,ESI 004012A1 >|> 90 NOP ; <INVOKE DispatchMessage> 004012A2 |. 53 PUSH EBX ; /pMsg 004012A3 |. FF15 FE204000 CALL [4020FE] ; \DispatchMessageA 004012A9 >|. 90 NOP ; <ICALL GetMessage> 004012AA |. 56 PUSH ESI ; /MsgFilterMax 004012AB |. 56 PUSH ESI ; |MsgFilterMin 004012AC |. 56 PUSH ESI ; |hWnd 004012AD |. 53 PUSH EBX ; |pMsg 004012AE |. FF15 06214000 CALL [402106] ; \GetMessageA 004012B4 >|. 85C0 TEST EAX,EAX ; <.until> 004012B6 |.^ 75 E9 JNZ SHORT 004012A1 ; <<INVOKE DispatchMessage>> 004012B8 |. E8 43FDFFFF CALL 00401000 ; <CALL Sub_null> 004012BD |. C9 LEAVE 004012BE \. C3 RETN |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.