flat assembler
Message board for the users of flat assembler.
Index
> Main > Multiple aliases |
Author |
|
revolution 11 Jan 2023, 02:06
All of the four labels have the same address.
Code: GetCurrentProcess rq 0 NtCurrentProcess rq 0 NtCurrentSilo rq 0 FastPebLock dq 0xFFFFFFFFFFFFFFFF |
|||
11 Jan 2023, 02:06 |
|
Furs 11 Jan 2023, 14:13
Or you can just literally use normal labels:
Code: GetCurrentProcess: NtCurrentProcess: NtCurrentSilo: FastPebLock dq 0xFFFFFFFFFFFFFFFF |
|||
11 Jan 2023, 14:13 |
|
macomics 11 Jan 2023, 14:48
Furs wrote: Or you can just literally use normal labels: But in this case, the labels will not have a size and you will have to specify the qword everywhere when using them. |
|||
11 Jan 2023, 14:48 |
|
bitRAKE 11 Jan 2023, 17:05
In fasmg it's possible to define the details of a label in another way - both the location of the label and the size can be specified (with an expression); with code located arbitrarily.
Code: GetCurrentProcess dq 0xFFFFFFFFFFFFFFFF label NtCurrentProcess :qword at GetCurrentProcess label NtCurrentSilo :qword at GetCurrentProcess label FastPebLock :qword at GetCurrentProcess macomics wrote:
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
11 Jan 2023, 17:05 |
|
revolution 11 Jan 2023, 17:22
bitRAKE wrote: In fasmg it's possible to define the details of a label in another way - both the location of the label and the size can be specified (with an expression); with code located arbitrarily. Code: GetCurrentProcess dq 0xFFFFFFFFFFFFFFFF
label NtCurrentProcess qword at GetCurrentProcess
label NtCurrentSilo qword at GetCurrentProcess
label FastPebLock qword at GetCurrentProcess |
|||
11 Jan 2023, 17:22 |
|
AE 11 Jan 2023, 17:24
Thank you!
|
|||
11 Jan 2023, 17:24 |
|
revolution 11 Jan 2023, 17:33
bitRAKE wrote: Unsized labels allow general use - without any size protection. Code: a: b db ? mov [b],2 ; okay mov [a],2 ; error: operand size not specified. |
|||
11 Jan 2023, 17:33 |
|
macomics 11 Jan 2023, 19:01
bitRAKE wrote: That's not true. Unsized labels allow general use - without any size protection. Code: GetCurrentProcess rq 0 NtCurrentProcess rq 0 NtCurrentSilo rq 0 FastPebLock dq 0xFFFFFFFFFFFFFFFF ... and [GetCurrentProcess], 0 Code: GetCurrentProcess: NtCurrentProcess: NtCurrentSilo: FastPebLock dq 0xFFFFFFFFFFFFFFFF ... and [GetCurrentProcess], 0 |
|||
11 Jan 2023, 19:01 |
|
Tomasz Grysztar 11 Jan 2023, 20:47
Yet another option is to use symbolic substitution:
Code: GetCurrentProcess equ QxFFFFFFFFFFFFFFFF
NtCurrentProcess equ QxFFFFFFFFFFFFFFFF
NtCurrentSilo equ QxFFFFFFFFFFFFFFFF
FastPebLock equ QxFFFFFFFFFFFFFFFF
QxFFFFFFFFFFFFFFFF dq 0xFFFFFFFFFFFFFFFF And yes, "label X qword at Y" has been around since fasm 1.0. And fasmg accepts legacy syntax (without ":") as well. |
|||
11 Jan 2023, 20:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.