Okay, neuer Versuch: Code: 4B0C50 <>StopLoop[+] 4B0C50 push ebx 4B0C51 mov ebx,edx //memorize Ptr on EventScriptData(?) 4B0C53 mov edi,[edx+18] //memorize Line# of the used BreakLoop __________CheckForLoopEnd__________ 4B0C56 ->mov edx,[ebx+18]/get the current line in the script 4B0C59 | mov eax,[ebx+14]/get Ptr on listed EventCommands 4B0C5C | c.sub_479710 //get ScriptLine 4B0C61 | mov ecx,eax //get Ptr on ScriptLineData 4B0C63 | mov eax,[ecx+4]//get ScriptLine's Command_ID 4B0C66 | test eax,eax //Was the end of the script reached already? 4B0C68 < jz loc_4B0C84 //jump if it was 4B0C6A | cmp eax,56C2 //Is the ScriptLine = : EndLoop? 4B0C6F <<jnz loc_4B0C86 //jump if not 4B0C71 | mov edx,[ecx+08]/get TreeDepth of the : EndLoop 4B0C74 | mov ecx,ebx //get Ptr on EventScriptData(?) 4B0C76 | mov eax,edi //get Line# of the used BreakLoop 4B0C78 | c.sub_4963F1 //call CheckLoopEnd[+] | 4963F1 <>CheckLoopEnd[+] | 4963F1 push ebx | 4963F2 push edi | 4963F3 push esi | 4963F4 push ebp | 4963F5 mov ebp,[ecx+14] //get Ptr on listed EventCommands | 4963F8 mov ebx,eax //get Line# of the used BreakLoop | 4963FA mov edi,edx //memorize TreeDepth of the : EndLoop | 4963FC xor esi,esi //initialize Counter |__________GetLoopStart__________ | 4963FE ->dec ebx //previous line | 4963FF | cmp ebx,0 //was the start of the script reached? | 496402 < jl loc_49642A //jump on invalid ScriptLine | 496404 | mov edx,ebx //get current line | 496406 | mov eax,ebp //get Ptr on listed EventCommands | 496408 | c.sub_479710 //get ScriptLine | 49640D | cmp //Is this line = <>Loop? | 496414 < jnz loc_496419 //jump if not | 496416 | dec esi //Counter -1 | 496417 <<jmp loc_496423 | 496419 > cmp //Is this line = : EndLoop? | 496420 <<jnz loc_496423 //jump if not | 496422 | inc esi //Counter +1 | 496423 >>cmp esi,0 //Is this a lone <>Loop? | 496426 --jge //jump if not |________________________________ | 496428 jmp loc_496431 | 49642A xor eax,eax //output = WrongEndLoop | 49642C pop ebp | 49642D pop esi | 49642E pop edi | 49642F pop ebx | 496430 ret | 496431 cmp edi,[eax+8] //Are the <>Loop and the : EndLoop at the same Depth? | 496434 jnz loc_49642A //jump if not | 496436 xor eax,eax | 496438 inc eax //output = RightEndLoop | 496439 jmp loc_49642C //ret 4B0C7D | test eax,eax //Is this the right : EndLoop? 4B0C7D <<jz loc_4B0C86 //jump if not 4B0C81 | inc [ebx+18] //output Line# to jump to after the BreakLoop 4B0C84 | pop ebx 4B0C85 ..ret 4B0C86 >>inc [ebx+18] //next line 4B0C89 | 4B0C8A --jmp
4B0C50 <>StopLoop[+] 4B0C50 push ebx 4B0C51 mov ebx,edx //memorize Ptr on EventScriptData(?) 4B0C53 mov edi,[edx+18] //memorize Line# of the used BreakLoop __________CheckForLoopEnd__________ 4B0C56 ->mov edx,[ebx+18]/get the current line in the script 4B0C59 | mov eax,[ebx+14]/get Ptr on listed EventCommands 4B0C5C | c.sub_479710 //get ScriptLine 4B0C61 | mov ecx,eax //get Ptr on ScriptLineData 4B0C63 | mov eax,[ecx+4]//get ScriptLine's Command_ID 4B0C66 | test eax,eax //Was the end of the script reached already? 4B0C68 < jz loc_4B0C84 //jump if it was 4B0C6A | cmp eax,56C2 //Is the ScriptLine = : EndLoop? 4B0C6F <<jnz loc_4B0C86 //jump if not 4B0C71 | mov edx,[ecx+08]/get TreeDepth of the : EndLoop 4B0C74 | mov ecx,ebx //get Ptr on EventScriptData(?) 4B0C76 | mov eax,edi //get Line# of the used BreakLoop 4B0C78 | c.sub_4963F1 //call CheckLoopEnd[+] | 4963F1 <>CheckLoopEnd[+] | 4963F1 push ebx | 4963F2 push edi | 4963F3 push esi | 4963F4 push ebp | 4963F5 mov ebp,[ecx+14] //get Ptr on listed EventCommands | 4963F8 mov ebx,eax //get Line# of the used BreakLoop | 4963FA mov edi,edx //memorize TreeDepth of the : EndLoop | 4963FC xor esi,esi //initialize Counter |__________GetLoopStart__________ | 4963FE ->dec ebx //previous line | 4963FF | cmp ebx,0 //was the start of the script reached? | 496402 < jl loc_49642A //jump on invalid ScriptLine | 496404 | mov edx,ebx //get current line | 496406 | mov eax,ebp //get Ptr on listed EventCommands | 496408 | c.sub_479710 //get ScriptLine | 49640D | cmp //Is this line = <>Loop? | 496414 < jnz loc_496419 //jump if not | 496416 | dec esi //Counter -1 | 496417 <<jmp loc_496423 | 496419 > cmp //Is this line = : EndLoop? | 496420 <<jnz loc_496423 //jump if not | 496422 | inc esi //Counter +1 | 496423 >>cmp esi,0 //Is this a lone <>Loop? | 496426 --jge //jump if not |________________________________ | 496428 jmp loc_496431 | 49642A xor eax,eax //output = WrongEndLoop | 49642C pop ebp | 49642D pop esi | 49642E pop edi | 49642F pop ebx | 496430 ret | 496431 cmp edi,[eax+8] //Are the <>Loop and the : EndLoop at the same Depth? | 496434 jnz loc_49642A //jump if not | 496436 xor eax,eax | 496438 inc eax //output = RightEndLoop | 496439 jmp loc_49642C //ret 4B0C7D | test eax,eax //Is this the right : EndLoop? 4B0C7D <<jz loc_4B0C86 //jump if not 4B0C81 | inc [ebx+18] //output Line# to jump to after the BreakLoop 4B0C84 | pop ebx 4B0C85 ..ret 4B0C86 >>inc [ebx+18] //next line 4B0C89 | 4B0C8A --jmp
Geändert von bugmenot (24.04.2014 um 20:54 Uhr)
Foren-Regeln