Algorithme à la renaissance

De T4C Tech
Aller à la navigation Aller à la recherche

Calcul à la renaissance

Sur cette page vous expose les algorithmes des calculs de points séraphin et statistique du personnage lors de la renaissance.

Reverse pour les points séraphin

Ici nous avons rechercher l'endroit ou le flag 30477 (0x76EF - Flag des points séraph) et calculer et modifier à la renaissance.

.text:00448B80 ; void __cdecl RemortTo(class Unit *, unsigned long, unsigned long, unsigned long)
.text:00448B80                 public ?RemortTo@@YAXPAVUnit@@KKK@Z
.text:00448B80 ?RemortTo@@YAXPAVUnit@@KKK@Z proc near
.text:00448B80
...
.text:00448C52                 mov     edx, [esi]
.text:00448C54                 lea     eax, [ebx+ebx+8] ; Le calcul ce trouve ici
.text:00448C58                 push    eax
.text:00448C59                 push    76EFh ; Flag a modifier
.text:00448C5E                 mov     ecx, esi
.text:00448C60                 call    dword ptr [edx+4] ; On appel la fonction de modification d'un flag
.text:00448C63                 xor     edi, edi
.text:00448C65

Reverse pour le calcule des statistiques

Dans cette seconde partie, nous avons rechercher les informations concernant la distribution des statistiques à la renaissance.

.text:00448DFF loc_448DFF:                             ; CODE XREF: RemortTo(Unit *,ulong,ulong,ulong)+112�j
...
.text:00448EAA                 lea     edi, [ebx+ebx*4+14h] ; Le calcul ce trouve ici
.text:00448EAE                 push    edi
.text:00448EAF                 mov     ecx, esi
.text:00448EB1                 call    ?SetINT@Unit@@QAEXG@Z ; Unit::SetINT(ushort)
.text:00448EB6                 push    edi
.text:00448EB7                 mov     ecx, esi
.text:00448EB9                 call    ?SetEND@Unit@@QAEXG@Z ; Unit::SetEND(ushort)
.text:00448EBE                 push    edi
.text:00448EBF                 mov     ecx, esi
.text:00448EC1                 call    ?SetSTR@Unit@@QAEXG@Z ; Unit::SetSTR(ushort)
.text:00448EC6                 push    edi
.text:00448EC7                 mov     ecx, esi
.text:00448EC9                 call    ?SetAGI@Unit@@QAEXG@Z ; Unit::SetAGI(ushort)
.text:00448ECE                 push    edi
.text:00448ECF                 mov     ecx, esi
.text:00448ED1                 call    ?SetWIS@Unit@@QAEXG@Z ; Unit::SetWIS(ushort)
.text:00448ED6                 push    0Fh
.text:00448ED8                 mov     ecx, esi
.text:00448EDA                 call    ?SetATTACK@Unit@@QAEXG@Z ; Unit::SetATTACK(ushort)
.text:00448EDF                 push    0Fh
.text:00448EE1                 mov     ecx, esi
.text:00448EE3                 call    ?SetDODGE@Unit@@QAEXG@Z ; Unit::SetDODGE(ushort)
...
.text:00449021                 call    ??0Objects@@QAE@XZ ; Objects::Objects(void)
.text:00449026                 mov     ebx, eax
.text:00449028

Algorithme du calcul de la renaissance

#include <cstdlib>
#include <iostream>

using namespace std;

char *RebornArray[10] = {
    "first", "second", "third" , "fourth", "fifth",
    "sixth", "seventh", "eighth", "ninth", "th"
};

int reborn(int nbreborn) {
    int stat, seraphpt;
    cout << "Congratulations to <Player> for attaining his ";
    if (nbreborn < 10) cout << RebornArray[nbreborn - 1];
    else cout << nbreborn << RebornArray[9];
    cout << " rebirth!\n";
    // Calculate the number of points for a seraphin 
    seraphpt = (nbreborn * 2) + 8;
    cout << "\tSeraph number of points : " <<seraphpt << "\n"; 
    // Calculate the number of points for the all stats
    stat = (nbreborn * 5) + 20;
    cout << "\tAll statistics contain " << stat << " points\n";
}

int main(int argc, char *argv[])
{
    for (int i = 1; i <= 10; i++) reborn(i);
    system("PAUSE");
    return EXIT_SUCCESS;
}

--Mestoph 16 mars 2008 à 19:19 (MSK)