Win2k & Win32 Questions ...

Hello,
I got a source code for a program that was written for win2k, in those program there are some instruction that I never see before. Here are the instruction:

1. rol eax,16
2. test eax,eax
3. pushad
4. not edx
5. rcr ax,1
6. movzx eax,word ptr [edx+eax*2]

If you know what does they mean please answer me .
Thanks


Comments

  • This does not make sense at all.
    It pushes all registers, with the 16-bit halves of eax swapped.
    Then it arranges the bits of eax like this:
    (31) 0123456789ABCDEFGHIJKLMNOPQRSTUV (0)
    ->
    (30) HIJKLMNOPQRSTUVF0123456789ABCDE (0)
    Edx is subtracted. The value at that address is movzxed in eax.

    : Hello,
    : I got a source code for a program that was written for win2k, in those program there are some instruction that I never see before. Here are the instruction:
    :
    : 1. rol eax,16
    : 2. test eax,eax
    : 3. pushad
    : 4. not edx
    : 5. rcr ax,1
    : 6. movzx eax,word ptr [edx+eax*2]
    :
    : If you know what does they mean please answer me .
    : Thanks
    :



  • : This does not make sense at all.
    : It pushes all registers, with the 16-bit halves of eax swapped.
    : Then it arranges the bits of eax like this:
    : (31) 0123456789ABCDEFGHIJKLMNOPQRSTUV (0)
    : ->
    : (30) HIJKLMNOPQRSTUVF0123456789ABCDE (0)
    : Edx is subtracted. The value at that address is movzxed in eax.
    :
    : : Hello,
    : : I got a source code for a program that was written for win2k, in those program there are some instruction that I never see before. Here are the instruction:
    : :
    : : 1. rol eax,16
    : : 2. test eax,eax
    : : 3. pushad
    : : 4. not edx
    : : 5. rcr ax,1
    : : 6. movzx eax,word ptr [edx+eax*2]
    : :
    : : If you know what does they mean please answer me .
    : : Thanks
    : :
    :
    :
    Man I didn't understant anything



  • OK I'll explain in more detail.
    1. This rotates eax by 16. In other words, the upper and lower half are swapped. Bit 0 of the result goes in the carry flag.
    2. Sets the Z flag if eax is 0.
    3. Push some registers
    4. Edx is set to -1 - edx
    5. Ax is rotates by 1 to the right. The carry flag goes in bit 15.
    6. Movzxes the value at edx+eax*2 into eax.

    : : This does not make sense at all.
    : : It pushes all registers, with the 16-bit halves of eax swapped.
    : : Then it arranges the bits of eax like this:
    : : (31) 0123456789ABCDEFGHIJKLMNOPQRSTUV (0)
    : : ->
    : : (31) HIJKLMNOPQRSTUVF0123456789ABCDE (1)
    : : Edx+1 is subtracted. The value at that address is movzxed in eax.
    : :
    : : : Hello,
    : : : I got a source code for a program that was written for win2k, in those program there are some instruction that I never see before. Here are the instruction:
    : : :
    : : : 1. rol eax,16
    : : : 2. test eax,eax
    : : : 3. pushad
    : : : 4. not edx
    : : : 5. rcr ax,1
    : : : 6. movzx eax,word ptr [edx+eax*2]
    : : :
    : : : If you know what does they mean please answer me .
    : : : Thanks
    : : :
    : :
    : :
    : Man I didn't understant anything
    :
    :



  • : OK I'll explain in more detail.
    : 1. This rotates eax by 16. In other words, the upper and lower half are swapped. Bit 0 of the result goes in the carry flag.
    : 2. Sets the Z flag if eax is 0.
    : 3. Push some registers
    : 4. Edx is set to -1 - edx
    : 5. Ax is rotates by 1 to the right. The carry flag goes in bit 15.
    : 6. Movzxes the value at edx+eax*2 into eax.
    :
    : : : This does not make sense at all.
    : : : It pushes all registers, with the 16-bit halves of eax swapped.
    : : : Then it arranges the bits of eax like this:
    : : : (31) 0123456789ABCDEFGHIJKLMNOPQRSTUV (0)
    : : : ->
    : : : (31) HIJKLMNOPQRSTUVF0123456789ABCDE (1)
    : : : Edx+1 is subtracted. The value at that address is movzxed in eax.
    : : :
    : : : : Hello,
    : : : : I got a source code for a program that was written for win2k, in those program there are some instruction that I never see before. Here are the instruction:
    : : : :
    : : : : 1. rol eax,16
    : : : : 2. test eax,eax
    : : : : 3. pushad
    : : : : 4. not edx
    : : : : 5. rcr ax,1
    : : : : 6. movzx eax,word ptr [edx+eax*2]
    : : : :
    : : : : If you know what does they mean please answer me .
    : : : : Thanks
    : : : :
    : : :
    : : :
    : : Man I didn't understant anything
    : :
    : :
    :
    :
    Thanks man, you realy help me



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories