Results 1 to 7 of 7
  1. #1
    Mikilox's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    81
    Reputation
    10
    Thanks
    360
    My Mood
    Grumpy

    Thumbs up Phantom DogTag boxFinder

    Hey,

    this is a source code release for finding the Phantom Dogtag Boxes in the Final Stand DLC. It uses hacklib.

    Notes:

    - It always shows the position, also if someone else already took the box. Wait (up to 10 minutes I think) until it changes position.
    - Using an overlay, so don't play in fullscreen.
    - Close the tool with "Home" key.

    Pictures: https://imgur.com/a/K0Qnn

    Code:
    #include "hacklib/Main.h"
    #include "hacklib/Drawer.h"
    #include "hacklib/WindowOverlay.h"
    #include "hacklib/ImplementMember.h"
    #include "hacklib/PatternScanner.h"
    
    
    namespace BF4
    {
        class Cam
        {
            IMPLMEMBER(D3DXMATRIX, Transform, 0x40);
            IMPLMEMBER(D3DXVECTOR3, ViewVec, 0x60);
            IMPLMEMBER(D3DXVECTOR3, Pos, 0x70);
            IMPLMEMBER(float, Fovy, 0xb4);
            IMPLMEMBER(D3DXMATRIX, ViewMat, 0x260);
        };
        class CamHolder
        {
            IMPLMEMBER(Cam*, CamData, 0x60);
        };
        class MeshAsset
        {
            IMPLMEMBER(char*, Name, 0x10);
        };
        class StaticModelEntityData
        {
            IMPLMEMBER(MeshAsset*, Asset, 0x98);
        };
        class ClientStaticModelEntity
        {
            IMPLMEMBER(StaticModelEntityData*, Data, 0x30);
            IMPLMEMBER(ClientStaticModelEntity*, Next, 0x40);
            IMPLMEMBER(D3DXVECTOR3, Pos, 0x240);
        };
    }
    
    class BF4BoxMain : public hl::Main
    {
    public:
        bool init() override;
        bool step() override;
    
    private:
        hl::Drawer m_drawer;
        hl::WindowOverlay m_overlay;
    
        struct Mems {
            BF4::CamHolder *pCamHolder;
        } m_mems;
    
        static const uintptr_t m_typeInfoStaticModel = 0x1427f8850;
    };
    
    hl::StaticInit<BF4BoxMain> g_initObj;
    
    
    bool BF4BoxMain::init()
    {
        uintptr_t sigCam = hl::FindPattern("\x84\xc0\x75\x00\x48\x8b\x0d\x00\x00\x00\x00\x48\x8b\x01\xff\x50\x00\xf3\x0f\x10\x0d", "xxx?xxx????xxxxx?xxxx");
    
        if (!sigCam) {
            hl::MsgBox("Error", "Invalid patterns");
            return false;
        }
    
        auto camAdr = *(std::uint32_t*)(sigCam + 0x7);
        m_mems.pCamHolder = *(BF4::CamHolder**)(camAdr + sigCam + 0x7 + 0x4);
    
        if (m_overlay.create() != hl::WindowOverlay::Error::Success)
            return false;
    
        m_overlay.registerResetHandlers(std::bind(&hl::Drawer::OnLostDevice, &m_drawer), std::bind(&hl::Drawer::OnResetDevice, &m_drawer));
        m_drawer.SetDevice(m_overlay.getDev());
    
        return true;
    }
    
    bool BF4BoxMain::step()
    {
        if (GetAsyncKeyState(VK_HOME) < 0)
            return false;
    
        D3DXMATRIX viewMat, projMat;
        D3DXVECTOR3 camPos;
        auto pCamHolder = m_mems.pCamHolder;
        if (pCamHolder)
        {
            auto pCam = pCamHolder->getCamData();
            if (pCam)
            {
                viewMat = pCam->getViewMat();
                viewMat._11 = -viewMat._11; // negate x
                viewMat._12 = -viewMat._12;
                viewMat._13 = -viewMat._13;
                std::swap(viewMat._21, viewMat._31); // swap y and z
                std::swap(viewMat._22, viewMat._32);
                std::swap(viewMat._23, viewMat._33);
    
                camPos = D3DXVECTOR3(-pCam->getPos().x, pCam->getPos().z, pCam->getPos().y);
    
                D3DXMatrixPerspectiveFovRH(&projMat, pCam->getFovy(), (float)m_overlay.getWidth()/m_overlay.getHeight(), 0.1f, 100000.0f);
    
                m_drawer.Update(viewMat, projMat);
            }
        } else {
            return true;
        }
    
        auto pDevice = m_overlay.getDev();
        if (pDevice->BeginScene() == D3D_OK)
        {
            m_overlay.clearRenderTarget();
    
            uintptr_t itEntity = m_typeInfoStaticModel + 0x60;
            auto pEntity = (BF4::ClientStaticModelEntity*)(itEntity - 0x40);
    
            while (itEntity)
            {
                std::string name = pEntity->getData()->getAsset()->getName();
    
                if (name.find("glasswin") != std::string::npos ||
                    name.find("ammobox") != std::string::npos ||
                    name.find("rubble_01_large_snow") != std::string::npos ||
                    name.find("officedivider") != std::string::npos)
                {
                    D3DXVECTOR3 worldPos = pEntity->getPos();
                    worldPos = D3DXVECTOR3(-worldPos.x, worldPos.z, worldPos.y);
                    D3DXVECTOR3 screenPos;
                    m_drawer.Project(worldPos, screenPos);
                    if (m_drawer.IsInfrontCam(screenPos))
                    {
                        float dist = D3DXVec3Length(&(camPos - worldPos));
                        m_drawer.DrawCircle(screenPos.x, screenPos.y, 2000*(1/dist), 0xff00ff00);
                        m_drawer.DrawCircle(screenPos.x, screenPos.y, 1500*(1/dist), 0xffff0000);
                    }
                }
    
                itEntity = *(uintptr_t*)itEntity;
                pEntity = (BF4::ClientStaticModelEntity*)(itEntity - 0x40);
            }
    
            pDevice->EndScene();
            pDevice->Present(NULL, NULL, NULL, NULL);
        }
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
    
        return true;
    }

  2. The Following 3 Users Say Thank You to Mikilox For This Useful Post:

    EL Surenzo dA KK Caponeiyl (11-30-2014),[MPGH]Flengo (12-02-2014),[MPGH]Mayion (12-02-2014)

  3. #2
    le_rAYY's Avatar
    Join Date
    Sep 2014
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Can someone explain me what i have to do with this source code ?

  4. #3
    Meeeeeeeow's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    Hamburg, Germany
    Posts
    26
    Reputation
    10
    Thanks
    4
    My Mood
    Devilish
    Quote Originally Posted by le_rAYY View Post
    Can someone explain me what i have to do with this source code ?
    You can develop a "hack" overlay whatever but he posted just some parts of his code and not everything so you have to work on it a little bit

  5. #4
    zPow3R's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Location
    Milan, Italy
    Posts
    7
    Reputation
    10
    Thanks
    0
    can someone tell me a program to made this tool? o someone can make a tool and post the link?

  6. #5
    Mikilox's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    81
    Reputation
    10
    Thanks
    360
    My Mood
    Grumpy
    C++ Compiler should work on this. The source code is the full part of it. It'll work.

  7. #6
    Cyb3rShad0w's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    My Mood
    Confused
    Would love to try this but i have no idea how to do it

  8. #7
    salido7's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    0
    Will try to compile it out.. lets see..

Similar Threads

  1. Phantom Chams & Ghost Chams
    By J in forum Combat Arms Discussions
    Replies: 29
    Last Post: 06-15-2010, 12:02 AM
  2. [Discussion] Chapter 3 Code Name Phantom Episode 3 Warrock Korea
    By mertos2100 in forum WarRock Discussions
    Replies: 4
    Last Post: 06-10-2010, 07:51 PM
  3. Phantom:Requiem For The Phantom
    By tytania in forum Anime
    Replies: 1
    Last Post: 08-28-2009, 01:20 AM
  4. New Hacking Clan - Phantom
    By brainchiller in forum CrossFire Clan Recruitment & Advertising
    Replies: 0
    Last Post: 08-08-2009, 07:00 PM
  5. phantom v2
    By kmphantom in forum WarRock - International Hacks
    Replies: 16
    Last Post: 10-11-2007, 08:41 PM