能力值:
( LV2,RANK:10 )
|
-
-
7 楼
一开始没理解。
原来是对魔兽地图的debug。
没弄过。
但是首先得告诉你几个问题,所有的随机数都伪随机数,在计算机中产生真正的自然随机数是不可能的。
理论上推算出随机数是可行的。
你所说的那个随机算法是在地图中产生的。不是魔兽本身产生的。所以关键还是在地图。
但是那个JASSDEBUG,我没有,也没有研究过,就帮不了你了。既然是一种debug工具,找出算法问题应该不大。
|
能力值:
( LV2,RANK:10 )
|
-
-
9 楼
根据你给的信息找到了下面的代码。
下面从6F69E570开始是函数代码,
在此之前
6F2AB332 |. BA 106E816F mov edx, 6F816E10 ; ASCII "GetRandomInt"
6F2AB337 |. B9 A01C2D6F mov ecx, 6F2D1CA0
6F2AB33C |. E8 2F323F00 call 6F69E570
edx,和ecx的值都被修改了。
貌似其实就是一个switch结构。
6F69E606 |. E8 9752CFFF call <jmp.&Storm.#578>
这句跳到了Storm.#578这个函数,我也过去看了看。
貌似是一个错误处理,我目前能做到的也就这么多了。至于算法,不得要领。呵呵。
等待大牛分析。
---------------------------Storm.#578---------------------
1503B320 >/$ 55 push ebp
1503B321 |. 8BEC mov ebp, esp
1503B323 |. 8B45 10 mov eax, dword ptr [ebp+10]
1503B326 |. 57 push edi
1503B327 |. 8B7D 08 mov edi, dword ptr [ebp+8]
1503B32A |. 8BCF mov ecx, edi
1503B32C |. F7D9 neg ecx
1503B32E |. 1BC9 sbb ecx, ecx
1503B330 |. 8BD0 mov edx, eax
1503B332 |. F7DA neg edx
1503B334 |. 1BD2 sbb edx, edx
1503B336 |. 85CA test edx, ecx
1503B338 |. 75 0C jnz short 1503B346
1503B33A |. 6A 57 push 57
1503B33C |. E8 EFC3FDFF call #465
1503B341 |. 33C0 xor eax, eax
1503B343 |. 5F pop edi
1503B344 |. 5D pop ebp
1503B345 |. C3 retn
1503B346 |> 56 push esi
1503B347 |. 8B75 0C mov esi, dword ptr [ebp+C]
1503B34A |. 85F6 test esi, esi
1503B34C |. 74 68 je short 1503B3B6
1503B34E |. 81FE FFFFFF7F cmp esi, 7FFFFFFF
1503B354 |. 8B0D DCA90515 mov ecx, dword ptr [1505A9DC]
1503B35A |. 74 31 je short 1503B38D
1503B35C |. 85C9 test ecx, ecx
1503B35E |. 74 0E je short 1503B36E
1503B360 |. 8D4D 14 lea ecx, dword ptr [ebp+14]
1503B363 |. 51 push ecx
1503B364 |. 50 push eax
1503B365 |. 56 push esi
1503B366 |. 57 push edi
1503B367 |. E8 849CFFFF call 15034FF0
1503B36C |. EB 0D jmp short 1503B37B
1503B36E |> 8D55 14 lea edx, dword ptr [ebp+14]
1503B371 |. 52 push edx ; /arglist
1503B372 |. 50 push eax ; |format
1503B373 |. 56 push esi ; |count
1503B374 |. 57 push edi ; |buffer
1503B375 |. FF15 50720415 call dword ptr [<&MSVCRT._vsnprintf>] ; \_vsnprintf
1503B37B |> 83C4 10 add esp, 10
1503B37E |. 3BC6 cmp eax, esi
1503B380 |. 72 36 jb short 1503B3B8
1503B382 |. 8D46 FF lea eax, dword ptr [esi-1]
1503B385 |. 5E pop esi
1503B386 |. C60438 00 mov byte ptr [eax+edi], 0
1503B38A |. 5F pop edi
1503B38B |. 5D pop ebp
1503B38C |. C3 retn
1503B38D |> 85C9 test ecx, ecx
1503B38F |. 74 12 je short 1503B3A3
1503B391 |. 8D4D 14 lea ecx, dword ptr [ebp+14]
1503B394 |. 51 push ecx
1503B395 |. 50 push eax
1503B396 |. 57 push edi
1503B397 |. E8 34A1FFFF call 150354D0
1503B39C |. 83C4 0C add esp, 0C
1503B39F |. 5E pop esi
1503B3A0 |. 5F pop edi
1503B3A1 |. 5D pop ebp
1503B3A2 |. C3 retn
1503B3A3 |> 8D55 14 lea edx, dword ptr [ebp+14]
1503B3A6 |. 52 push edx ; /arglist
1503B3A7 |. 50 push eax ; |format
1503B3A8 |. 57 push edi ; |buffer
1503B3A9 |. FF15 20720415 call dword ptr [<&MSVCRT.vsprintf>] ; \vsprintf
1503B3AF |. 83C4 0C add esp, 0C
1503B3B2 |. 5E pop esi
1503B3B3 |. 5F pop edi
1503B3B4 |. 5D pop ebp
1503B3B5 |. C3 retn
1503B3B6 |> 33C0 xor eax, eax
1503B3B8 |> 5E pop esi
1503B3B9 |. 5F pop edi
1503B3BA |. 5D pop ebp
1503B3BB \. C3 retn
---------------------Storm.#578-----------------------
-----------GetRandomInt------------------------------
6F69E570 /$ 55 push ebp
6F69E571 |. 8BEC mov ebp, esp
6F69E573 |. 81EC 08010000 sub esp, 108
6F69E579 |. 56 push esi
6F69E57A |. 8B75 08 mov esi, dword ptr [ebp+8]
6F69E57D |. 57 push edi
6F69E57E |. 8BFA mov edi, edx
6F69E580 |. 56 push esi
6F69E581 |. 51 push ecx
6F69E582 |. 8D55 FC lea edx, dword ptr [ebp-4]
6F69E585 |. 8BCF mov ecx, edi
6F69E587 |. C745 FC 00000>mov dword ptr [ebp-4], 0
6F69E58E |. E8 1DFBFFFF call 6F69E0B0
6F69E593 |. 8B55 FC mov edx, dword ptr [ebp-4]
6F69E596 |. 8D46 01 lea eax, dword ptr [esi+1]
6F69E599 |. C742 20 00000>mov dword ptr [edx+20], 0
6F69E5A0 |. 8A08 mov cl, byte ptr [eax]
6F69E5A2 |. 80F9 29 cmp cl, 29
6F69E5A5 |. 74 2F je short 6F69E5D6
6F69E5A7 |> 84C9 /test cl, cl
6F69E5A9 |. 74 49 |je short 6F69E5F4
6F69E5AB |. 80F9 56 |cmp cl, 56
6F69E5AE |. 74 03 |je short 6F69E5B3
6F69E5B0 |. FF42 20 |inc dword ptr [edx+20]
6F69E5B3 |> 8A08 |mov cl, byte ptr [eax]
6F69E5B5 |. 80F9 48 |cmp cl, 48
6F69E5B8 |. 75 13 |jnz short 6F69E5CD
6F69E5BA |. 8D9B 00000000 |lea ebx, dword ptr [ebx]
6F69E5C0 |> 80F9 3B |/cmp cl, 3B
6F69E5C3 |. 74 08 ||je short 6F69E5CD
6F69E5C5 |. 8A48 01 ||mov cl, byte ptr [eax+1]
6F69E5C8 |. 40 ||inc eax
6F69E5C9 |. 84C9 ||test cl, cl
6F69E5CB |.^ 75 F3 |\jnz short 6F69E5C0
6F69E5CD |> 8A48 01 |mov cl, byte ptr [eax+1]
6F69E5D0 |. 40 |inc eax
6F69E5D1 |. 80F9 29 |cmp cl, 29
6F69E5D4 |.^ 75 D1 \jnz short 6F69E5A7
6F69E5D6 |> 0FBE40 01 movsx eax, byte ptr [eax+1]
6F69E5DA |. 83C0 BE add eax, -42 ; Switch (cases 42..56)
6F69E5DD |. 83F8 14 cmp eax, 14
6F69E5E0 |. 0F87 91000000 ja 6F69E677
6F69E5E6 |. 0FB688 A0E669>movzx ecx, byte ptr [eax+6F69E6A0]
6F69E5ED |. FF248D 80E669>jmp dword ptr [ecx*4+6F69E680]
6F69E5F4 |> 57 push edi
6F69E5F5 |. 68 4C31846F push 6F84314C ; ASCII "function '%s' has bad signature"
6F69E5FA |. 8D85 F8FEFFFF lea eax, dword ptr [ebp-108]
6F69E600 |. 68 04010000 push 104
6F69E605 |. 50 push eax
6F69E606 |. E8 9752CFFF call <jmp.&Storm.#578>
6F69E60B |. 83C4 10 add esp, 10
6F69E60E |. 5F pop edi
6F69E60F |. 5E pop esi
6F69E610 |. 8BE5 mov esp, ebp
6F69E612 |. 5D pop ebp
6F69E613 |. C2 0400 retn 4
6F69E616 |> 5F pop edi ; Case 56 ('V') of switch 6F69E5DA
6F69E617 |. C742 38 00000>mov dword ptr [edx+38], 0
6F69E61E |. 5E pop esi
6F69E61F |. 8BE5 mov esp, ebp
6F69E621 |. 5D pop ebp
6F69E622 |. C2 0400 retn 4
6F69E625 |> 5F pop edi ; Case 53 ('S') of switch 6F69E5DA
6F69E626 |. C742 38 06000>mov dword ptr [edx+38], 6
6F69E62D |. 5E pop esi
6F69E62E |. 8BE5 mov esp, ebp
6F69E630 |. 5D pop ebp
6F69E631 |. C2 0400 retn 4
6F69E634 |> 5F pop edi ; Case 49 ('I') of switch 6F69E5DA
6F69E635 |. C742 38 04000>mov dword ptr [edx+38], 4
6F69E63C |. 5E pop esi
6F69E63D |. 8BE5 mov esp, ebp
6F69E63F |. 5D pop ebp
6F69E640 |. C2 0400 retn 4
6F69E643 |> 5F pop edi ; Case 48 ('H') of switch 6F69E5DA
6F69E644 |. C742 38 07000>mov dword ptr [edx+38], 7
6F69E64B |. 5E pop esi
6F69E64C |. 8BE5 mov esp, ebp
6F69E64E |. 5D pop ebp
6F69E64F |. C2 0400 retn 4
6F69E652 |> 5F pop edi ; Case 52 ('R') of switch 6F69E5DA
6F69E653 |. C742 38 05000>mov dword ptr [edx+38], 5
6F69E65A |. 5E pop esi
6F69E65B |. 8BE5 mov esp, ebp
6F69E65D |. 5D pop ebp
6F69E65E |. C2 0400 retn 4
6F69E661 |> 5F pop edi ; Case 42 ('B') of switch 6F69E5DA
6F69E662 |. C742 38 08000>mov dword ptr [edx+38], 8
6F69E669 |. 5E pop esi
6F69E66A |. 8BE5 mov esp, ebp
6F69E66C |. 5D pop ebp
6F69E66D |. C2 0400 retn 4
6F69E670 |> C742 38 03000>mov dword ptr [edx+38], 3 ; Case 43 ('C') of switch 6F69E5DA
6F69E677 |> 5F pop edi ; Default case of switch 6F69E5DA
6F69E678 |. 5E pop esi
6F69E679 |. 8BE5 mov esp, ebp
6F69E67B |. 5D pop ebp
6F69E67C \. C2 0400 retn 4
-----------GetRandomInt------------------------------
|
能力值:
( LV12,RANK:210 )
|
-
-
15 楼
6F2AB332 |. BA 106E816F mov edx, 6F816E10 ; ASCII "GetRandomInt"
6F2AB337 |. B9 A01C2D6F mov ecx, 6F2D1CA0 ; 这个函数就是
6F2AB33C |. E8 2F323F00 call 6F69E570
悲剧,你就差一步。这个函数6F69E570是注册native的函数,ecx就是真正的GetRandomInt位置。
|
能力值:
( LV2,RANK:10 )
|
-
-
16 楼
6F2D1B80 /. 55 PUSH EBP
6F2D1B81 |. 8BEC MOV EBP,ESP
6F2D1B83 |. 83EC 10 SUB ESP,10
6F2D1B86 |. 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
6F2D1B89 |. 8B4D 0C MOV ECX,DWORD PTR SS:[EBP+C]
6F2D1B8C |. 3BC1 CMP EAX,ECX
6F2D1B8E |. 0F84 E9000000 JE Game.6F2D1C7D
6F2D1B94 |. 7E 08 JLE SHORT Game.6F2D1B9E
6F2D1B96 |. 2BC1 SUB EAX,ECX
6F2D1B98 |. 40 INC EAX
6F2D1B99 |. 8945 F8 MOV DWORD PTR SS:[EBP-8],EAX
6F2D1B9C |. EB 06 JMP SHORT Game.6F2D1BA4
6F2D1B9E |> 2BC8 SUB ECX,EAX
6F2D1BA0 |. 41 INC ECX
6F2D1BA1 |. 894D F8 MOV DWORD PTR SS:[EBP-8],ECX
6F2D1BA4 |> 53 PUSH EBX
6F2D1BA5 |. 56 PUSH ESI
6F2D1BA6 |. 8B35 08B9876F MOV ESI,DWORD PTR DS:[6F87B908]
6F2D1BAC |. 8B4E 04 MOV ECX,DWORD PTR DS:[ESI+4]
6F2D1BAF |. 8B06 MOV EAX,DWORD PTR DS:[ESI]
6F2D1BB1 |. 33D2 XOR EDX,EDX
6F2D1BB3 |. 8AD5 MOV DL,CH
6F2D1BB5 |. 8945 F0 MOV DWORD PTR SS:[EBP-10],EAX
6F2D1BB8 |. 894D 0C MOV DWORD PTR SS:[EBP+C],ECX
6F2D1BBB |. 33C0 XOR EAX,EAX
6F2D1BBD |. 8A45 0E MOV AL,BYTE PTR SS:[EBP+E]
6F2D1BC0 |. 57 PUSH EDI
6F2D1BC1 |. 8BFA MOV EDI,EDX
6F2D1BC3 |. 8BD1 MOV EDX,ECX
6F2D1BC5 |. C1E9 18 SHR ECX,18
6F2D1BC8 |. 83E9 04 SUB ECX,4
6F2D1BCB |. 83E8 0C SUB EAX,0C
6F2D1BCE |. 81E2 FF000000 AND EDX,0FF
6F2D1BD4 |. 85C9 TEST ECX,ECX
6F2D1BD6 |. 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
6F2D1BD9 |. 7D 06 JGE SHORT Game.6F2D1BE1
6F2D1BDB |. 81C1 BC000000 ADD ECX,0BC
6F2D1BE1 |> 83EF 18 SUB EDI,18
6F2D1BE4 |. 85C0 TEST EAX,EAX
6F2D1BE6 |. 897D 0C MOV DWORD PTR SS:[EBP+C],EDI
6F2D1BE9 |. 7D 08 JGE SHORT Game.6F2D1BF3
6F2D1BEB |. 05 D4000000 ADD EAX,0D4
6F2D1BF0 |. 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
6F2D1BF3 |> 8B99 8880706F MOV EBX,DWORD PTR DS:[ECX+6F708088]
6F2D1BF9 |. 83EA 1C SUB EDX,1C
6F2D1BFC |. 85FF TEST EDI,EDI
6F2D1BFE |. 7D 09 JGE SHORT Game.6F2D1C09
6F2D1C00 |. 81C7 EC000000 ADD EDI,0EC
6F2D1C06 |. 897D 0C MOV DWORD PTR SS:[EBP+C],EDI
6F2D1C09 |> 8BB8 8880706F MOV EDI,DWORD PTR DS:[EAX+6F708088]
6F2D1C0F |. 8BC3 MOV EAX,EBX
6F2D1C11 |. C1E8 1F SHR EAX,1F
6F2D1C14 |. 03DB ADD EBX,EBX
6F2D1C16 |. 0BC3 OR EAX,EBX
6F2D1C18 |. 85D2 TEST EDX,EDX
6F2D1C1A |. 8945 F4 MOV DWORD PTR SS:[EBP-C],EAX
6F2D1C1D |. 7D 06 JGE SHORT Game.6F2D1C25
6F2D1C1F |. 81C2 F4000000 ADD EDX,0F4
6F2D1C25 |> 8B45 0C MOV EAX,DWORD PTR SS:[EBP+C]
6F2D1C28 |. 8B80 8880706F MOV EAX,DWORD PTR DS:[EAX+6F708088]
6F2D1C2E |. 8BD8 MOV EBX,EAX
6F2D1C30 |. C1E0 03 SHL EAX,3
6F2D1C33 |. C1EB 1D SHR EBX,1D
6F2D1C36 |. 0BD8 OR EBX,EAX
6F2D1C38 |. 8BC7 MOV EAX,EDI
6F2D1C3A |. C1E8 1E SHR EAX,1E
6F2D1C3D |. C1E7 02 SHL EDI,2
6F2D1C40 |. 0BC7 OR EAX,EDI
6F2D1C42 |. 8BBA 8880706F MOV EDI,DWORD PTR DS:[EDX+6F708088]
6F2D1C48 |. 33D8 XOR EBX,EAX
6F2D1C4A |. 8B45 F4 MOV EAX,DWORD PTR SS:[EBP-C]
6F2D1C4D |. 33DF XOR EBX,EDI
6F2D1C4F |. 8B7D FC MOV EDI,DWORD PTR SS:[EBP-4]
6F2D1C52 |. C1E1 08 SHL ECX,8
6F2D1C55 |. 0BCF OR ECX,EDI
6F2D1C57 |. 8B7D 0C MOV EDI,DWORD PTR SS:[EBP+C]
6F2D1C5A |. 33D8 XOR EBX,EAX
6F2D1C5C |. 8B45 F0 MOV EAX,DWORD PTR SS:[EBP-10]
6F2D1C5F |. C1E1 08 SHL ECX,8
6F2D1C62 |. 0BCF OR ECX,EDI
6F2D1C64 |. 03C3 ADD EAX,EBX
6F2D1C66 |. C1E1 08 SHL ECX,8
6F2D1C69 |. 0BCA OR ECX,EDX
6F2D1C6B |. 8906 MOV DWORD PTR DS:[ESI],EAX
6F2D1C6D |. F765 F8 MUL DWORD PTR SS:[EBP-8]
6F2D1C70 |. 5F POP EDI
6F2D1C71 |. 894E 04 MOV DWORD PTR DS:[ESI+4],ECX
6F2D1C74 |. 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
6F2D1C77 |. 8BC2 MOV EAX,EDX
6F2D1C79 |. 5E POP ESI
6F2D1C7A |. 03C1 ADD EAX,ECX
6F2D1C7C |. 5B POP EBX
6F2D1C7D |> 8BE5 MOV ESP,EBP
6F2D1C7F |. 5D POP EBP
6F2D1C80 \. C3 RETN
是不是这一段?谢谢你了!
|