flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 27 Feb 2025, 19:15
Perhaps you are confusing .o with .ko?
|
|||
![]() |
|
duanebonas6822 27 Feb 2025, 19:22
Im just trying a few things i see the other FASM guides, just in this example its talking about a FASM patch (https://board.flatassembler.net/topic.php?t=7519). Does anyone know if this patch has been fixed, I am just trying loads of differant options. I will probs get this working maybe iuts because im using the newest kernal version.
|
|||
![]() |
|
revolution 27 Feb 2025, 19:36
The current version of fasm puts zeros in the relocated fields.
Code: format elf64 extrn func ;... mov rdi, text call func text: Code: 00000049 48BF000000000000 mov rdi,0x0 -0000 00000053 E800000000 call 0x58 |
|||
![]() |
|
duanebonas6822 27 Feb 2025, 19:50
Yeah that version i think ive figured out, just this version i get compile error maybe u know why: ?
========================================================================================================================= format ELF64 extrn printk section '.init.text' executable module_init: push rdi mov rdi, str1 xor eax, eax call printk xor eax, eax pop rdi ret section '.exit.text' executable module_cleanup: xor eax, eax ret section '.rodata.str1.1' str1 db '<0> Here I am, gentlemen!', 0x0a, 0 section '.modinfo' align 10h db 'license=GPL', 0 db 'depends=', 0 db 'vermagic=6.12.10-arch1-1 SMP preempt mod_unload ', 0 section '.gnu.linkonce.this_module' writable this_module: rb 18h db 'simple_module', 0 rb 148h - ($ - this_module) rb 150h - ($ - this_module) dq module_init rb 238h - ($ - this_module) rb 248h - ($ - this_module) dq module_cleanup dq 0 section '__versions' dq 0x568fba06 dq 0x2ab9dba5 @@: db 'module_layout', 0 rb 56 - ($ - @b) dq 0x27e1a049 @@: db 'printk', 0 rb 56 - ($ - @b) ========================================================================================================================= # I get this error ============================================================================================================ flat assembler version 1.73.32 (16384 kilobytes memory, x64) shelllsm40.asm [36]: rb 150h - ($ - this_module) dq module_init processed: rb 150h-($-this_module)dq module_init error: extra characters on line. ============================================================================================================ # Do you know how i can format this so it works... # # rb 150h - ($ - this_module) dq module_init <<-- (extra characters on line) # # Do u know how i could fix this as i can get this version to load ok # # Just any thoughts ?? cheers |
|||
![]() |
|
revolution 27 Feb 2025, 19:57
rb and dq are separate things.
Code: rb 150h - ($ - this_module) dq module_init |
|||
![]() |
|
duanebonas6822 27 Feb 2025, 20:58
ohh , because ive never done kernal modules i thought the format had to be like that, cheers mate thats fixed it, theres just loads of differant ways to structure FASM thats why i love it soo much, cheers mate.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.