flat assembler
Message board for the users of flat assembler.
Index
> Windows > Basic Win32/Win64 headers for fasmg Goto page Previous 1, 2 |
Author |
|
Tomasz Grysztar 15 Nov 2017, 16:47
All the Windows headers of fasm 1 are now emulated, including syntax like ".if" and basic parameter count checking.
|
|||
15 Nov 2017, 16:47 |
|
yeohhs 08 Jan 2018, 13:21
Tomasz Grysztar wrote: All the Windows headers of fasm 1 are now emulated, including syntax like ".if" and basic parameter count checking. Thanks! This is great. |
|||
08 Jan 2018, 13:21 |
|
VEG 01 Apr 2018, 07:16
It seems that you've accidentally included older versions of format.inc and pe.inc into the latest archive:
|
|||
01 Apr 2018, 07:16 |
|
bitRAKE 04 May 2018, 18:22
I was curious if there is some reasoning behind the use of absolute paths in the include files? With relative paths it'd be possible to just INCLUDE '..\fasmg\include\win64w.inc' without it being broken. Maybe there is a use case I'm neglecting which relative paths would break?
|
|||
04 May 2018, 18:22 |
|
Tomasz Grysztar 04 May 2018, 18:46
I wanted to say that it should not break anything, but wait, it breaks the "format" macros - they include files only when macro is called and the relative path is then of the file that called the macro.
This could be fixed by changing INCLUDE to INCLUDE!, but this would make it read all the files unnecessarily only to define the format macros. Or, there is also an option of FORMAT.INC extracting its path from __FILE__ and then attaching this path to the name of every file it includes. I'm going to look into this solution to see how clean can I make it. |
|||
04 May 2018, 18:46 |
|
bitRAKE 04 May 2018, 19:05
Thank you, I was seeing other side effects as I don't have the environment defined and some includes weren't throwing any errors. Yet, it doesn't seem like they would be in the path. One would initially think that all includes would be in the context of the file that does the including. But if it's wrapped in a macro or eval, what then?
I'll adapt - just confused. |
|||
04 May 2018, 19:05 |
|
Tomasz Grysztar 04 May 2018, 19:22
I have a prototype working. The basic (and universal) macro goes like this:
Code: macro local_include? instr local pos,chr,path pos = lengthof __FILE__ while pos chr = (__FILE__ shr (8*(pos-1))) and 0FFh if chr = '/' | chr = '\' break end if pos = pos - 1 end while path = string __FILE__ and not ( (-1) shl (8*pos) ) macro instr file include string path + file shl (8*lengthof path) end macro end macro Code: local_include format?.include Code: format?.include 'pe.inc' format?.include '../cpu/x64.inc' And by the way - when INCLUDE is used in a macro, the path it sees is of the file that called the macro and not the file that defined the macro exactly for the reason that you should be able to wrap things like INCLUDE with macros, etc. |
|||
04 May 2018, 19:22 |
|
bitRAKE 04 May 2018, 21:31
Excellent, now it appear to work from everywhere.
|
|||
04 May 2018, 21:31 |
|
VEG 18 Aug 2018, 08:09
You have stopped to update the file in the first post. Probably, it should be downloaded from another place now?
|
|||
18 Aug 2018, 08:09 |
|
Tomasz Grysztar 18 Aug 2018, 08:31
Yes, I moved it to GitHub, though the headers themselves had no updates recently.
|
|||
18 Aug 2018, 08:31 |
|
asmant 22 Nov 2018, 17:56
Hi all!
In old FASM i did so and everything works well: Code: format pe gui use32 xor eax, eax use64 xor rax, rax in new FASM i did so and have error ("Error: definition in conflict with already defined symbol."): Code: include 'format/format.inc' include 'cpu/x64.inc' format pe gui use32 xor eax, eax use64 xor rax, rax Why not change by default (in file "format/format.inc") Quote: format?.include '../cpu/p6.inc' to Quote: format?.include '../cpu/x64.inc' ? This is the first thing that came to my mind. Any other suggestions? |
|||
22 Nov 2018, 17:56 |
|
Tomasz Grysztar 22 Nov 2018, 20:32
This kind of architecture mixing is a bit unusual, so I would suggest in such case to use the new formatter directly and not through the fasm-like "format" macro:
Code: ; example how to adjust some settings: format binary as 'exe' PE.Settings.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE or IMAGE_FILE_32BIT_MACHINE or IMAGE_FILE_LINE_NUMS_STRIPPED or IMAGE_FILE_LOCAL_SYMS_STRIPPED include 'format/pe.inc' include 'cpu/x64.inc' use32 xor eax, eax use64 xor rax, rax |
|||
22 Nov 2018, 20:32 |
|
asmant 22 Nov 2018, 20:46
Tomasz Grysztar wrote: This kind of architecture mixing is a bit unusual Thanks for the answer and your program! |
|||
22 Nov 2018, 20:46 |
|
bitRAKE 20 Dec 2018, 19:17
fasmg/packages/x86/examples/windows/usecom/usecom.asm, line 10
Code: label . : 16 _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
20 Dec 2018, 19:17 |
|
bitRAKE 01 Jan 2019, 18:01
On windows 10 and invalid PE is produced by:
Code: section '.data' data readable writeable |
|||
01 Jan 2019, 18:01 |
|
Tomasz Grysztar 01 Jan 2019, 19:56
bitRAKE wrote: ...if the section is empty. I know - a strange corner case. https://twitter.com/grysztar/status/1023556002480832513 @grysztar wrote: Modern Windows (based on NT kernel) rejects to load a PE file containing an empty section (one that has virtual size set to zero). Other implementations, like Windows 9x or Win32s, did not object to such setup. |
|||
01 Jan 2019, 19:56 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.