Results 1 to 1 of 1
  1. #1
    King-Orgy's Avatar
    Join Date
    Dec 2010
    Gender
    female
    Posts
    119
    Reputation
    15
    Thanks
    628
    My Mood
    Angelic

    Simple way how to get Weapon Infos

    Note:This tutorial is based using IDA/hex-rays, i do not care if you can't find my way in OllyDbg

    Credits:Crx, Tamimego, learn_more, G-D

    Tools you need:IDA Pro with hex-rays use google dont ask me how to get it

    now to my post.

    a quick how to get current weapon names, spread, Angles ( and more )
    one of the ways i found after a while reversing the engine.

    first search for this string in IDA ( BlackOpsMp.exe )

    [PHP]Weapon %s: Could not translate display name \"%s\[/PHP]step two decompile the function you found the string.

    [PHP] sub_517980(6, "Weapon %s: Could not translate display name \"%s\"", *(_DWORD *)v3);[/PHP]dit you notice the "v3"? search the reference in the decompiled function

    you will find

    [PHP]
    int v3;
    v3 = sub_49F800(a2);
    [/PHP]translated

    Code:
    weapon_t* weapon;
    weapon = GetWeapon(CurrentWeapon);
    now we only need to find CurrentWeapon to get it done.
    clientInfo its the best way to do it.

    Code:
    struct ClientInfo{
            __int32 Weapon; //0x0538  
    //...    
    };//Size 0x5C8
    now to the code, i done for you.

    Code:
    weapon_t*  (__cdecl *GetWeapon)(int num) = (weapon_t* (__cdecl *)(int))Remembered?;
    Code:
    struct weapon_t
    {
        char *NonTranslateWeaponName;
        char z_crap[8];
        char *TranslateWeaponName;
        //...
    };
    Code:
        char info[128];
        char info2[128];
    
        weapon_t* weapon = (weapon_t*)GetWeapon( ClientInfo[PlayerSnap->clientNum].Weapon  );
    
        if( weapon )
        {
            sprintf(info,"^1NonTranslateWeaponName: ^7[^1%s^7]", weapon->NonTranslateWeaponName );
            sprintf(info2,"TranslateWeaponName: ^7[^1%s^7]", weapon->TranslateWeaponName );
    
            CEngineDrawing.CG_DrawEngineString( 1.2f, 200, 200, colorWhite, 1.0, info );
        
            CEngineDrawing.CG_DrawEngineString( 1.2f, 200, 220, colorWhite, 1.0, info2
        
        }
    result.
    https://img200.imageshack.us/img200/3622/shot0021i.jpg
    https://img535.imageshack.us/img535/1421/shot00220.jpg
    https://img408.imageshack.us/img408/3177/shot0024x.jpg

  2. The Following 3 Users Say Thank You to King-Orgy For This Useful Post:

    Blubb1337 (12-08-2010),House (12-02-2010),jvortex24 (12-04-2010)