flat assembler
Message board for the users of flat assembler.
Index
> Linux > argc, argv, argp in AMD64 |
Author |
|
Feryno 07 Jun 2006, 07:32
yes, that's right
if you try to load ELF64 under debugger, you can find how and why in ELF64 created directly by FASM you get args in the stack dword [rsp]=argc qword [rsp+8]=pointer to arg0 ... qword [rsp+8 + argc*8]=0 end of args qword [rsp+8 + argc*8 + 8]=pointer to first string of environment ... qword [...]=0 end of envirnment in ELF64 created by linker there are routines for loading libs before main, so routines read args from stack and prepare them into regs don't try to step this init routines, you'll waste a lot ot the time until you go to your main asm code try fdbg from Projects and Ideas section of the forum I'm working on it, next release with fully functionality will come in few days (I hope until this weekend, I'm finishig the last thing - hardware breakpoints, which is the most belowed debugger feature for me...) updates on my home page are more frequent than here in the forum, a newer version of fdbg for Linux 64-bit AMD64 is there from 2006 june 05 (hasn't hw bp) I wasted a lot of time with gdb with ugly asm syntax for uncover problems like your and then I decided to write more FASM-friendly debugger quick debug trick to bypass init lib routines in case of linking with libc: put db 0cch at the begin of your asm code recompile load under debugger run program stops in your main asm code |
|||
07 Jun 2006, 07:32 |
|
Chewy509 09 Jun 2006, 01:19
Hi Feryno,
Thanks for the info, exactly what I was after. |
|||
09 Jun 2006, 01:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.