Results 1 to 13 of 13

Thread: ADD and DEC instructions

  1. #1
    cse_india
    Guest

    ADD and DEC instructions

    please clarify my 3 doubts

    1)add eax, dword ptr [404000] : means adding the value of eax + the 4 byte value at memory address 40400 and storing it in eax. correct?

    2) what does this mean : add eax, dword ptr [eax] ?

    3) what does this mean : add eax, dword ptr [eax+00404000] ?

    and how does the registers get related to memory?


    ---------------------------------------------------------------------

    the instruction : dec [eax+401000]

    does it mean :
    1) decreases the dword value at eax + the value 401000h by 1?

    2) decrease the dword that is stored at [eax+401000] ?


    are 1 and 2 the same ? if different please xplain in an easy language( not hi fi assembly terms)
    and what does the second instruction mean?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    Naides is Nobody
    Join Date
    Jan 2002
    Location
    Planet Earth
    Posts
    1,647
    Option 2

    [eax + 00410xxxxxx]

    is a reference to the dword stored at that address

    dec substracts one.

    Find "art of assembly" in the web and give it a read

  3. #3
    cse_india
    Guest
    come on!
    reading "art of assembly" is a joke or what?
    i know the doubts can be cleared from any assembly lang book.so why the forum?
    i know cracking is a difficult hobby.u got to learn assembly.but i feel if my these doubtr r cleared many more doubts of mine would be cleaed too. these instructions com a lot in the disassembled structure.if i can understand these codes i would probably understand a lot lot more things.

    can anyone please giv a solution.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  4. #4
    Naides is Nobody
    Join Date
    Jan 2002
    Location
    Planet Earth
    Posts
    1,647
    It is not a joke.
    And you need not read it from begining to end, but it is a searchable reference for questions such as these. . .
    And learning enough assembly and the inner workings of a computer is a necesity if you want to do reversing of any substance.

    The forum is here for exchange of ideas, when you are stock, when you have a difficult problem, when you do not know obscure sources.

    The forum DOES NOT replace searching, studying, reading and the intellectual challenge of RCE

  5. #5
    cse_india
    Guest
    okay can u tell me which chapters r to be read in " art of asembly" for having a quite enough good knowledge of assembly.
    i know i am weak at assembly.i thought i would try to learn assembly and at the same time i would try reversing.
    i want 1 suggestion: should i learn assembly to a good extentfirst and then try reversing or should i learn assembly and reverse at the same time with very basic idea abt assembly and then progressing????
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  6. #6
    read the whole thing.. get stronger at assembly....

    1)add eax, dword ptr [404000]
    adds the value @ memory address 404000 to eax
    2) what does this mean : add eax, dword ptr [eax] ?
    adds the value @ memory address eax is pointing to to eax...
    eg: eax = 11223344
    add eax,dword ptr [eax] translates to add eax,dword ptr [11223344]

    3) what does this mean : add eax, dword ptr [eax+00404000] ?
    add eax, value @ memory address 404000 + eax
    so again, say eax = 10
    add eax,dword ptr [eax+404000] translates to add eax,dword ptr [10+404000]
    so...
    add eax, dword ptr [404010]

    the instruction : dec [eax+401000]
    doesnt look right... because you have no byte/word/dword/qword/?word mnemonics...

    but it subtracts 1 (decriment) from the byte/word/dword/qword/?word stored @ eax+401000


    now, read the faq, do some research and stop being agressive to those trying to help... oh and stop being lazy too.. theres no corners to be cut when learning asm and/or rce

  7. #7
    cse_india
    Guest
    hmm . i am sorry for showing my aggression . actually u said rt . i am too lazy.

    but now i am gion to learn assembly from a proper book rather learning from short tutorials. i suppose good assembly knowledge and being a good cracker are directly proportional.
    thanks for the help evlncrn8 .
    next time i will enter the forum only when i hav a good knowledge of assembly.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  8. #8
    It looks like the forum killed my posts again

    I definitely do not recommend Art of Assembly to anyone planning on studying Asm. It used to be reasonably well-written, until the author decided to write his own "high-level-assembler" (which isn't really an assembler) with a completely different syntax and "high-level constructs" (Asm is NOT an HLL, nor should it ever become one). Reading it will confuse the minds of the infirm. What we all think of as "add eax, 4" he writes as "add(4, eax)". Everything looks like a function call, much too verbose for Asm (a language which already has a very high source:binary ratio) and confusing for the beginners. A friend of mine says she had difficulty remembering the correct operand order for a few days after reading AoA, even though she had many years of Asm experience already

    I recommend the Intel(R) IA-32 Architecture Software Developer's Manuals which you can download for free from their site. They have an entire section explaining the addressing modes, as well as an extensive instruction set reference that shows the function of each instruction.

  9. #9
    dzCepheus
    Guest
    LLXX - after having read everywhere that "art of assembly" would be a good read, I was greatly disappointed by all the "HLA" stuff in it... So I'm glad to hear someone more knowledgeable than I agrees with me on that. :P

    As far as the developer's manuals - thanks for the tip on that. I wasn't aware there was such a thing. :P piece of cake finding them too.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  10. #10
    uhm... my post went thrown away too.
    I disagree recommending IA manuals -they are at 'master' level, and one wouldn't really learn anything [opening casually voll. 3.. eek!!].

    AoA still teaches assembler, though in a odd form and -if you just skip the part that talks of HLA structures, it is ok too (a bit messy for AT&T syntax style and parenthesis, however).

    As an alternative, look for [uhm... fetching it, a sec...]
    http://www.drpaulcarter.com/pcasm/

    should be fine (didnt read it all, but enough to say it seems pretty good). On many languages.

    Regards,
    Maximus
    I want to know God's thoughts ...the rest are details.
    (A. Einstein)
    --------
    ..."a shellcode is a command you do at the linux shell"...

  11. #11
    dzCepheus
    Guest
    I tried as you suggested - ignoring the HLA parts - except the whole document is practically peppered with it... So for a noob like me it's hard to seperate the crap from the gold...

    And yeah - I think I will try to get a better handle on ASM before I delve into the Intel docs... yikes.
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  12. #12
    If you can find the older versions of AoA, they might be worth reading since he didn't write HLA yet and used a standard assembler like MASM.

    In fact, if you Google HLA + "not an assembler" you'll find some interesting discussions.
    Last edited by LLXX; June 4th, 2006 at 18:05.

  13. #13
    Quote Originally Posted by Maximus
    AoA still teaches assembler, though in a odd form and -if you just skip the part that talks of HLA structures, it is ok too (a bit messy for AT&T syntax style and parenthesis, however).
    I found it to be a stretch trying to read between the lines. I think the author made a major mistake by trying to cater to students from a different discipline rather than teaching them assembler as it is normally used.

    Check out this apparent freebie at:

    http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/

    some of the diagrams are in gif format and the fonts seem to be wrong.

    I like to have hard copies of books available as well. I use the small reference manual from Microsoft that came with it's MASM compiler (see URL above). Many cities have bookstores that specialize in computers. It's possible to get really good deals on computer books at these stores. I have two such books that I can recommend:

    1)Microsoft Macro Assembler by Nabajyoti Barkakati (SAMS Publishing - The Waite Group)

    http://www.amazon.com/gp/product/0672301555/104-4983491-1771163?v=glance&n=283155 (price is quoted from $11.45). Beware that it probably costs more than the book is worth to ship it.

    2)Mastering Turbo Assembler (2nd ed.) - by Tom Swan (SAMS publishing)

    http://www.amazon.com/gp/product/0672305267/104-4983491-1771163?v=glance&n=283155

    both of these books explain assembler in depth and give good explanations of the instruction set.
    Last edited by WaxfordSqueers; June 4th, 2006 at 18:50.

Similar Threads

  1. 4 instructions and more?
    By BanMe in forum Advanced Reversing and Programming
    Replies: 6
    Last Post: January 19th, 2013, 14:23
  2. Extending subroutines with new instructions in IDA
    By fywdm in forum The Newbie Forum
    Replies: 2
    Last Post: March 26th, 2012, 11:50
  3. Basic blocks and instructions statistics.
    By Piotr Bania Chronicles in forum Blogs Forum
    Replies: 0
    Last Post: June 23rd, 2011, 01:21
  4. Finding instructions
    By Hex Blog in forum Blogs Forum
    Replies: 0
    Last Post: September 24th, 2009, 15:20
  5. I don't know anything about assembly instructions
    By nicromonicon in forum The Newbie Forum
    Replies: 16
    Last Post: February 28th, 2005, 21:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •