GithubHelp home page GithubHelp logo

tgrysztar / fasmg Goto Github PK

View Code? Open in Web Editor NEW
190.0 26.0 26.0 13.21 MB

flat assembler g - adaptable assembly engine

Home Page: https://flatassembler.net/

Assembly 77.04% Batchfile 0.05% C++ 10.21% PHP 3.89% HTML 4.70% Pawn 1.39% NASL 0.01% BitBake 2.71%
fasmg assembly x86 x86-64 macro instructions opcodes assembler executable-formats binary-format

fasmg's Introduction

fasmg's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fasmg's Issues

Strange number to character conversion in 'display'

display 209,210,211,10
display 21'

The two lines above, when compiled, print three different characters on the first line of output, and one character on the second line. The character on the second line seems to be the same as character with code 210.
Is that interpretation of number 21' by design, or possibly a bug?
version: g.jmhx

Also, in the Fasm g manual there is missing a complete description of integer literals syntax, i.e. no mention that ' characters are accepted.

duplicate lines?

mov ecx,[ebx+FreeMemory.left]
mov edx,[ebx+FreeMemory.right]
mov [ecx+FreeMemory.right],eax
mov [edx+FreeMemory.left],eax
mov ecx,[ebx+FreeMemory.left]
mov edx,[ebx+FreeMemory.right]

Duplicate lines look superfluous?

fix path to fasmg or bad include for make.cmd and examples ?

I think is a bug area of put fasmg on path and fix examples with set include folder
I suppose is need to add the fasmg on windows path and this let the set command to include the folder include.
I think is more good to set the path for examples to work with fasmg executable and not to add fasmg to windows path.
In this case the make.cmd come show this error:

C:\fasmg-master\core\examples\x86>fasmg win64avx.asm win64avx.exe

'fasmg' is not recognized as an internal or external command,
operable program or batch file.

The examples come with this include path and cannot access the real path fasmg-master\core\examples\x86\include\format, see:

include 'format\format.inc'   

Multi-language support in Windows resources:

Present resource macros do not support multiple resources with the same ID:

macro resource dir,definitions&
iterate <id,lang,label>, definitions
dir dd 0,%t,0,%% shl 16
local total,current,next,counter
total = %%
current = -1
next = 0
while current < next
current = next
counter = 0
repeat total
indx %
if id = current
if counter = 0
dd id,80000000h+label.directory-root@resource
end if
counter = counter + 1
label.count = counter
else if id > current & ( next = current | next > id )
next = id
end if
end repeat
end while
current = -1
next = 0
while current < next
current = next
counter = 0
repeat total
indx %
if id = current
if counter = 0
label.directory dd 0,%t,0,label.count shl 16
dd lang,label-root@resource
label.resid = id
else
dd lang,label-root@resource
end if
counter = counter + 1
else if id > current & ( next = current | next > id )
next = id
end if
end repeat
end while
break
end iterate
end macro

It's best to use an external resource editor and load the RES file with:

section '.rsrc' resource from 'my_resource.res' data readable

The resource macros also lack support for named resources.

Some resource editors on github ...
https://github.com/katahiromz/RisohEditor

`format MS64 COFF` not builds

What is variant here?

macro format?.MS64?
match =COFF?, variant
format binary as 'obj'
COFF.Settings.Machine = IMAGE_FILE_MACHINE_AMD64
COFF.Settings.Characteristics = IMAGE_FILE_32BIT_MACHINE or IMAGE_FILE_LINE_NUMS_STRIPPED or IMAGE_FILE_BYTES_REVERSED_LO
format?.include 'coffms.inc'
format?.include '../cpu/x64.inc'
use64
else
err 'invalid argument'
end match
end macro

Excuse me if this is stupid question. I am a new in fasmg.
But I can not build format MS64 COFF line in my .asm file.

du size bug version g.igri1

mov eax,string.size

string du 'test',0
.size = $-string

Error: symbol 'size' is undefined or out of scope.

Invalid PE32/64 image directory bug

lea rax,[test1] ;no fixups generated
mov rax,test1 ;fixups generated

When used lea, in data directory fasm set invalid pointer IMAGE_DIRECTORY_ENTRY_BASERELOC
Also this bug present in fasm1

Test on ms link vs2017 with options:
link.exe /release /subsystem:windows /nocoffgrpinfo /dll /dynamicbase /entry:Main "test64.obj"

It worked correctly: IMAGE_DIRECTORY_ENTRY_BASERELOC/size are 0 and module is relocatable.
If build "exe" windows will load it with ASLR, then there is no message like "This app can't run on your PC"

Apple M1 binary

do you need help to make it work on Apple silicon? I can help :)

Looking forward broken?

I'm trying to use fasmg to write code in windows but, the format is not working

Inside the format/pe.inc line 360, it fails to get .SizeOfHeaders dd SIZE_OF_HEADERS, even if this symbol is defined on line 407 of the same file.

So I don't know how exactly it should work.

Also, the format.inc is not including the pe.inc file, it needs it to look the symbols, but it only includes the file after including the symbols, so this is also an issue of the looking forward looks like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.