flat assembler
Message board for the users of flat assembler.
Index
> Linux > 64 bit source samples and ELF64 executables |
Author |
|
Feryno 23 Mar 2005, 07:22
This is it:
http://feryno.host.sk/linux/asm_amd64_linux64.tar.bz2 Sources for fasm, yasm and feature nasm release with 64 bit support. Working ELF64 programs. Method for debugging ELF64 by gdb. Linux syscall number list (thanx for it guys...). Please mail me if you interess about 64 bit asm linux. Mail address is at homepage. |
|||
23 Mar 2005, 07:22 |
|
drs 24 Mar 2005, 15:37
The link is down? Did anyone mirror the archive?
Thanks... |
|||
24 Mar 2005, 15:37 |
|
rea 24 Mar 2005, 16:55
The link is up, if yu recibe a forbided message, best press return enter in the direction bar, because the server have a switch somewhere for let or not let link directly to that space .
|
|||
24 Mar 2005, 16:55 |
|
Feryno 25 Mar 2005, 11:48
|
|||
25 Mar 2005, 11:48 |
|
coconut 25 Mar 2005, 21:46
privalov, that would be a great addition to the documentation
|
|||
25 Mar 2005, 21:46 |
|
hyrax 05 Apr 2005, 02:37
I tried the simple examples that came with fasm 1.60 and they segfaulted until I made the executable section writeable.
fasm itself does not make it's executable section writeable, yet I can assemble it and use the resulting fasm, and it works just fine. If I omit the sections (or add writeable to the executable ones) I can get the 64 and 32 examples to work. I'm running Linux version 2.6.11-gentoo-r2 (gcc version 3.4.3 20041125) 64 bit only. (I don't have any 32 bit gcc toolchain and glibc installed) |
|||
05 Apr 2005, 02:37 |
|
Feryno 07 Apr 2005, 06:37
That's right. I had too much segfaults before create first good executable without segfault.
The advantage of asm coding is: for executable, it's enough to make 1 section only. You need set flags: exec, read, write to it. This make possibility to use one section for exec code as well writeable data segment mixed together. Unitialized data don't need section, udata is created with size defined in ELF64: p_memsz - p_filesz p_memsize = size codeseg+dataseg+udataseg p_filesize = size codeseg+dataseg udata is filled with zero bytes when Linux load executable befor jump to it's executable code. Because writeable flag for exec segment, this prevent seg fault. When you make ELF64 executable with 2 or more sections, you mustn't omit to make executable section writeable. If no - this make seg fault. I don't know why... Executable segment don't need be writeable. Exec and read privileges enough for it. For security it's better when exec seg is readable only, no writeable. This disable overwriting instructions. But asm coder need sometimes self-modifying exec code (e.g. antidebug protections...) and this is possible by 2 ways - executable segment with exec, read and WRITE flags, or use syscall _mprotect to set writeable flag. For all my projects, 1 section is enough, so i make only 1 segment to store executable code and writeable data with exec, read, write flags. Uninitialized data section follow with zero padding created with size (p_memsz - p_filesz). For detailed header structure, see yasm/1st/header64.asm in my source examples ELF64 executables (asm_amd64_linux64.tar.bz2) at http://feryno.host.sk. Good luck in great ASM64 coding under Linux, guys! Feryno |
|||
07 Apr 2005, 06:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.