flat assembler
Message board for the users of flat assembler.

Index > Main > New directive(instruction) help

Author
Thread Post new topic Reply to topic
lamar



Joined: 05 Jun 2009
Posts: 16
lamar
Hello!
I'am need to add some modifications to PE Executable format which produce FASM.

currently i need thee directives:
Quote:

linker major(byte),optional minor(byte)
system major(word),optional minor(word)
subsystem major(word),optional minor(word)


after reading the source code i'am trying to do this:

Quote:

;;;;;Insert after "heap_directive" label ;;;;;
linker_directive:
bts [format_flags],13h
jc setting_already_specified
mov al,[output_format]
cmp al,3
je pe_linker
jmp illegal_instruction
;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;Insert after "pe_heap" label ;;;;;
pe_linker:
lods byte [esi]
cmp al,'('
jne invalid_argument
cmp byte [esi],'.'
je invalid_value
call get_count_value
mov edx,[code_start]
mov byte [edx+0x2],al
jmp instruction_assembled
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;Insert after "instructions_6" label ;;;;;;;;;;;;;;;;;
db 'linker',0
dw linker_directive-instruction_handler
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


then i compile assembler, replace(ide) and try to compile source with new directive:
Quote:

format PE GUI
linker 1
ret


and finally i am get this error: "Error: illegal instruction.".

What's wrong fuck Smile Question
Tomasz or anyone can help?

Maybe someone already try to add new instructions i know that not hard, gimme example how to do this. I'am not sure but maybe need to fix some offsets or constants.
Post 17 May 2011, 00:09
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
lamar wrote:


and finally i am get this error: "Error: illegal instruction.".

What's wrong fuck Smile Question Tomasz or anyone


Shocked Shocked

Sentence Question
Post 17 May 2011, 01:02
View user's profile Send private message Reply with quote
lamar



Joined: 05 Jun 2009
Posts: 16
lamar
Yeah, need help Surprised
Post 17 May 2011, 09:52
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.