flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 22 Feb 2007, 10:50
fasm's syntax is:
Code: mov [cs:eax],ebx |
|||
![]() |
|
MazeGen 22 Feb 2007, 11:24
![]() Then, this instruction gets assembled, but it is always illegal in its context: Code: format PE mov [cs:eax],ebx |
|||
![]() |
|
Tomasz Grysztar 22 Feb 2007, 11:33
Not necessarily illegal. Note that you can run PE files under DOS with an extender like WDOSX, and you may be able to modify your code segment descriptor using DPMI functions in such context, etc. etc.
And also: fasm isn't really supposed to check whether instruction can execute properly - it just ensures that instruction can be encoded properly. |
|||
![]() |
|
MazeGen 22 Feb 2007, 11:43
1) Is there really any way how to make code segment writable, since there is no bit in the descriptor to mark it writable?
2) LEA EAX, EAX can be also encoded properly, but fasm doesn't accept it. |
|||
![]() |
|
Tomasz Grysztar 22 Feb 2007, 12:00
MazeGen wrote: 1) Is there really any way how to make code segment writable, since there is no bit in the descriptor to mark it writable? Well, you could even make some kind of extender based on my 32-bit unreal mode driver, which would use PE format (however stupid that idea might be). These are just examples to show that assembler shouldn't put constraints on how the generated code will be used. MazeGen wrote: 2) LEA EAX, EAX can be also encoded properly, but fasm doesn't accept it. There's no such instruction (even though there is such encoding). It cannot then be encoded properly, since it doesn't exist. |
|||
![]() |
|
MazeGen 22 Feb 2007, 12:42
Ok, I got it, thanks Tomasz.
|
|||
![]() |
|
f0dder 22 Feb 2007, 13:42
You can make the code section of memory writable, sure, but you can't write to [cs:whater] afaik... still, no reason that fasm shouldn't assemble the instruction, though
![]() |
|||
![]() |
|
rugxulo 22 Feb 2007, 18:42
Eh? Maybe I'm too dumb to understand (okay, I definitely am) but ...
Code: use32 lea eax,[eax] ndisasm -b32 wrote:
|
|||
![]() |
|
MazeGen 22 Feb 2007, 19:13
lea eax, eax (8DC0) is different from lea eax, [eax] (8D00)
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.