@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> Whats the offset to the pointers to the commandline arguments relative to esp ***uming push hasn't been used once in the program yet in a linux environment
<1> argv == esp+sizeof(void*)
<0> the size of any pointer should be 4 ***uming 32 bit code
<1> yeah
<1> so basically the first 32bit pop will get you argc
<1> the second one argv[0]
<1> the third one argv[1]
<1> and so on
<1> I think it's very nice to have it like that... for example in DOS it's a lot harder to get the arguments
<0> because, I am trying to load a pointer to the first command line arg in eax with mov eax, dword ptr esp + 4
<0> But it isn't working
<1> well argv[0] is the program name
<1> and argv[1] is the first argument
<0> I know, but I am not getting the program name, I am getting unprintable characters
<0> which generally means I am indexing into nomans land
<0> I am trying ultimately to put the pointer to the first command line arg in a memory location with label msg with...
<0> mov eax, esp + 4
<0> mov msg, dword ptr eax
<0> but it aint working
<0> oggis, why doesn't the above code work
<1> it should. If you put something like the address of a constant string to msg before you print it does it work?
<0> IT isn't working
<0> I am getting unprintable characters
<1> I mean, even if you use a well-known working string as msg?
<1> show me your printing code
<0> its just push msg
<0> call puts
<0> michael@michael-desktop:~$ ./a.out asdf
<0> michael@michael-desktop:~$
<1> well at least if i just do _start: add esp, byte 4 \n call puts that works as expected
<1> try if that works for you
<0> Nope
<0> segment faults all around when I do that
<1> yeah it should because of no exit syscall but it doesn't print anything before it
<1> what if you run it in gdb?
<1> it segvs in strlen right?
<0> No, it just segfaults, no output
<1> btw what ***embler are you using
<0> the gnu ***embler, with intel syntax support
<1> ok
<0> Ok, now I get the string XQR no mater what I type in
<2> how does bp differ from bx?
<1> they are different registerts...
<1> -t
<2> thats it?
<1> ah, for usage
<1> blah, a lot of things...
<2> aside from typical usage, you are free to use either for the same purpose right?
<0> WHy won't this work, I did exaclty what you said
<0> ok, got it finally
<0> oggis, something weird is going on, the program name is at offset [esp +8] and the environment variables start at [esp + 12]
<1> what was it?
<1> hmm.. wonder what that extra stuff is then
<0> and anything bellow [esp + 8] causes a seg fault
<1> prologue?
<0> And I can't locate the pointers to the command line args
<0> There is no prolog
<0> No
<1> are you using main+starfiles?
<1> startfiles*
<0> no
<1> because you should be using -nostartfiles and _start
<0> i have a label main: and the start of the code
<0> Ill try the no start files thing
<1> yeah, yeah, that's it, really
<1> name it _start and use -nostartfiles
<1> the thing is with main there is some code run already so push has really been used already
<0> the idea of using an ***embler is that should never happen though, the only code that should be ***embled is the code you typed and the functions you import
<1> yeah, but it doesn't get ***embled. It comes from libraries when linking.
<1> And when you use -nostartfiles it doesn't
<0> But now that I did that, I get segmentation faults again
<1> yeah, after printing. That's because you don't exit from the program at all.
<0> No, it isn't printing now either
<1> ah, ok
<0> ok fixed
<1> first try just _start: add esp, byte 4 \n call puts
<1> does it print then?
<1> it should segfault right after printing
<0> Now it does
<0> I have been calling exit but I think I have this now
<0> thanks
<1> i'd call the syscall directly instead
<1> like mov eax, 1 \n mov ebx, 0 \n int 80h
<0> I don't like mixing crt and system calls
<1> yeah, i like to use syscalls whenever possible and only use libc for stuff there isn't a single syscall equivalent
<0> I have to go be back later
<3> might anyone know anything about compiling/writing BPF filters?
<4> hi, I have a question about the PE format
<4> does anyone know anything about the export table
<4> ?
<5> yes
<0> I actualy used to know where the export table was in the pe format files
<0> its just a matter of finding the right section header
<0> All the headers appear in sequence torwards the begining of the file, and are labeled based on what their feilds point to
<6> hi
<6> one question
<6> programming asm in x86-64 is more diffent than x86-32?
<0> There are edditional registers in 64 bit
<0> and the size of a pointer is 64 bits
<0> s/edditional/additional
<6> mmm
<6> but, in the internet there aren't a lor of information about asm in x86-64...
<6> no?
<0> BEcause the technology is fairly new
<6> ahm...
<6> okey
<0> But the only real difference is that there are 64 bit general purpose registers, which have their own name, which I don't know off hand
<0> and that the pointer is 64 bits wide
<6> and.. if I use s.o for 64-bit, I can used programns in asm 32-bit? with emulator..
<6> I don't know
<0> 32 bit programs can run on 64 bit machines, but not visaversa
<6> mmm why?
<6> if my registers have other name, I can't used programs with 32-bit
<0> Mainly because 32 bit code is writen ***uming the size of a pointer is 32 bits
<0> So there are pointer scaling issues
<6> mmm
<6> although, if I have a source of asm in 32-biy I can ejecute in amd64?
<0> YEs, because an amd64 has whats called 32bit emulation
<6> but.. if I programming a source in C and ejecute gdb
<6> info registers
<6> this is registers of 64-bit
<6> I like 32-bit..
<0> Because the C compiler will produce 64 bit ***embly code or 32 bit ***embly code b***ed on what you tell it to do
<6> and
<6> why I tell it to do that compile code in 32-bit?
<0> I don't know?
<0> WHy would you
<6> sorry, I am spanish, I don't understand..
<6> I would that my program in C is form 32-bit..
<6> no for 64-bit
<0> I really can't help you then
<0> I don't speak spanish fluently enough to clarify
<6> mmm okey
<6> thanks for all
<0> no problem
<0> HEres a question, does anyone know of any example of appropiate use of the HLT instruction?
<7> Hi
<7> just wondering...
<7> is sub $4,%esp; movl %eax,(%esp); different from pushl eax ?
<8> no
<9> hi all
<9> any one know good asm editor for liunx
<9> replace for hiew in windows
<10> i use scite
<11> morning
<9> thanx
<12> what does ORG do? i see stuff like this in boot loaders...
<12> ORG 0x7C00
<13> seb-: it sets tho origin of the code segment (i think)
<13> or where the program is loaded


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #asm
or
Go to some related logs:

#python
freenode password lost nickserv
#perl
#php
#asm
(uniqueMember) index_param failed
#fedora
#perl
cygwin putty buffered output
module vfat not found ubuntu



Home  |  disclaimer  |  contact  |  submit quotes