flat assembler
Message board for the users of flat assembler.
Index
> Linux > [solved] Linux elf64 macro help |
Author |
|
duanebonas6822 22 Dec 2024, 23:29
Anybody know if the statically linked C librarys are going to work with macros, really needed anyone to comment on this by tomorrow, just i need my binary to be Position independant with no linker at all, i can get normal syscalls to work ok but i just dont know if it possible to use macros with call [socket], as the memory is defined like this:
_socket db "socket", 0 and also like this socket dq ? # i reading up on ccall but even that i not quite sure even works fully with format elf64, i can get them working with extern socket as it doesnt declair memory, but that cant be used like i want, cheers let know anyone |
|||
22 Dec 2024, 23:29 |
|
revolution 23 Dec 2024, 00:04
You seem to be defining socket twice?
Code: macro socket ... ;... socket dq ? ; this expands the "socket" macro with domain="dq ?" and type/protocol undefined, hence the error |
|||
23 Dec 2024, 00:04 |
|
duanebonas6822 23 Dec 2024, 00:06
OMG, i been here for 2 hours wondering how to figure calling with this memory address error:
# It only works without a memory address at all called like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ macro socketvv domain, type, protocol { mov rdi, domain mov rsi, type mov rdx, protocol call [socket] } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # I cant believe i could use macros like this to make programming easier, i was writing assembley the bastard hard way # for ages, i been stressing out for months ways to get C code to execute with messing on with stack alligning and it # gets stressing as hell. Really if anyone is trying to get C code and assembley to work dont use summet like NASM # these macros are magical, i can repeat TEXT and do things miles faster. I wish i would of read up on these macros ages ago # FASM is the Daddy, long live ASM hahaha, gonna be checking out all the posts on macro tricks |
|||
23 Dec 2024, 00:06 |
|
duanebonas6822 23 Dec 2024, 00:12
well i have it working now, i just sat and read all the docs fully last nite and realized that i have been ignoring the macros, they do exactly what ive been doing the hard way for ages. I just have already thought of loads of ways they can be used, u just have to really take time to understand how structs and memory work , lol but no cheers mate for the reply many thanks i take note of the above response but just sat reading lol
|
|||
23 Dec 2024, 00:12 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.