News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Ollydbg anomoly?

Started by Foulone, February 26, 2005, 06:04:05 PM

Previous topic - Next topic

Foulone

I have incorporated this code into my project, but the code displayed looks invalid in ollydbg.
Can anyone shed any light on this?

; - Source code -

random proc

   mov eax, rseed
   mov ecx, 23
   mul ecx
   add eax, 7
   and eax, 0FFFFFFFFh
   ror eax, 1
   xor eax, rseed
   mov rseed, eax
   mov ecx, range
   xor edx, edx
   div ecx
   mov eax, edx
   ret

random endp

; - Ollydbg code -

0040110E > $ A1 08404000    MOV EAX,DWORD PTR DS:[rseed]
00401113   . B9 17000000    MOV ECX,17
00401118   . F7E1           MUL ECX
0040111A   . 83C0 07        ADD EAX,7
0040111D   . 83E0 FF        AND EAX,FFFFFFFF
00401120   . D1C8           ROR EAX,1
00401122     33             DB 33                                    ;  CHAR '3'                      <--- WHAT HAS HAPPENED  HERE ?????
00401123     05             DB 05
00401124 > . 08404000       DD OFFSET Luck.rseed
00401128   . A3 08404000    MOV DWORD PTR DS:[rseed],EAX
0040112D   . 8B0D 0C404000  MOV ECX,DWORD PTR DS:[range]
00401133   . 33D2           XOR EDX,EDX
00401135   . F7F1           DIV ECX
00401137   . 8BC2           MOV EAX,EDX
00401139   . C3             RETN

Foulone

fixed the problem, the code is fine, just needed to turn off analysis in ollydbg  :bg