C++ Reverse L2OFF

  • Автор темы Автор темы Envy
  • Дата начала Дата начала

Envy

Единомышленник
Участник
Сообщения
35
Розыгрыши
0
Репутация
2
Реакции
51
Баллы
102
Предоставляю услуги по обратной разработке Lineage 2.
Имею опыт с:
- IL сервер (C4 PTS up)
- GF сервер, HF сервер

Стоимость услуг договорная. Пишите либо тут в лс, либо в дискорд envydeveloper, либо в тг @envydeveloper. Согласен на работу через гаранта \ оплату по итогу работы

I provide Lineage 2 reverse engineering services.
I have experience with:
- IL server (extended C4)
- GF server, HF server

The price of services is negotiable. Contact me either here in private or on Discord envydeveloper or in Telegram @envydeveloper. I agree to work through a guarantor / payment upon completion of the work

cpp:
C++:
// 0x43B140
bool CAuctionAgit::CanAttend(int nPledgeId, User *pUser)
{
    if(nPledgeId <= 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(GetSaleState() != SALE_STATE_AUCTION)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nOwnerPledgeId = 0;
    if(pRD)
        nOwnerPledgeId = pRD->nPledgeID;

    if(nPledgeId == nOwnerPledgeId)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    CPledge *pPledge = GetPledgeByID(nPledgeId);

    if(!pPledge)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(pPledge->pAgit != NULL)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if((UINT)pPledge->pSD->nLevel < AGIT_MIN_CLAN_LEVEL)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    if(pPledge->pSD->nState != 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nAgitId = 0;
    int nAuctionid = 0;
    int nResult = 0;

    IsInAllAuctions(nPledgeId, &nAgitId, &nAuctionid, &nResult);

    if(nResult != 0)
    {
        if(nResult & 1)
        {
            pUser->SendSystemMessage(0x2A4);
        }
        else if(nResult & 2)
        {
            pUser->SendSystemMessage(0x2A8);
        }
        return false;
    }

    return true;
}

// 0x43A600
void CAuctionAgit::TimerExpired(int id)
{
    if(GetSaleState() == SALE_STATE_AUCTION)
    {
        if(bCanDoAuction == true && _time32(NULL) >= auctionEndTime)
        {
            EnterDoAuction();
            g_DB.RequestSetAgitAuction(pRD->nResidenceID, nAuctionId);
        }
    }

    if(pRD->nPledgeID > 0 && costTime == 0
       && pRD->nPrice > 0
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, -1);
    }

    if(pRD->nPledgeID > 0 && costTime > 0
       && pRD->nPrice > 0
       && _time32(NULL) >= costTime
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, pRD->nLastBid);
    }

    if(pRD->nPledgeID == 0)
    {
        if(GetSaleState() == SALE_STATE_INITIAL)
        {
            SetSaleState(SALE_STATE_AUTO_SELL);
            wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
            g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                     AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
        }
    }

    if(pRD->nPledgeID == 0
       && pRD->nCancelFlag == 1
       && _time32(NULL) >= pRD->nCancelEndTime
       && GetSaleState() == SALE_STATE_CANCEL_PENALTY)
    {
        SetSaleState(SALE_STATE_AUTO_SELL);
        wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
        g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                 AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
    }

    CAgit::TimerExpired(id);
}

Header:
C++:
#define SECONDS_PER_DAY                86400
#define SECONDS_PER_HOUR            3600
#define SECONDS_PER_MINUTE            60
#define SECONDS_PER_WEEK            604800
#define AGIT_AUCTION_DATE_OFFSET    0x10F950
#define AGIT_COMMENT_SIZE            255
#define AGIT_AUTO_SELL_PRICE        10
#define AGIT_AUTO_SELL_DAYS            7
#define AGIT_MAX_AUCTION_PRICE        2000000000
#define AGIT_MIN_CLAN_LEVEL            2

enum SaleState
{
    SALE_STATE_NONE = 0,
    SALE_STATE_INITIAL = 1,
    SALE_STATE_AUTO_SELL = 2,
    SALE_STATE_ACTIVE = 3,
    SALE_STATE_CANCEL_PENALTY = 4,
    SALE_STATE_AUCTION = 8
};

struct AuctionBidInfo
{
    int nPledgeId;
    int nPrice;
    int _unk;
};

class CAuctionAgit : public CAgit
{
public:
    /* 04F0 */ LPCIOCriticalSection pAuctionLock;
    /* 0520 */ int _n0520;
    /* 0524 */ __time32_t auctionEndTime;
    /* 0528 */ __time32_t cancelTimestamp;
    /* 052C */ __time32_t costTime;
    /* 0530 */ int _n0530;
    /* 0534 */ int _pad0534;
    /* 0538 */ int _n0538;
    /* 053C */ int _n053C;
    /* 0540 */ WCHAR wszComment[AGIT_COMMENT_SIZE];
    /* 0740 */ vector<AuctionBidInfo> bidList;
    /* 0760 */ int nSaleState;
    /* 0764 */ int nAuctionId;
    /* 0768 */ int _n0768;
    /* 076C */ bool bCanDoAuction;

    bool InCancelPenalty()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x439AB0L)(this);
    }

    void StartAuctionTimer()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x439BE0L)(this);
    }

    bool CheckSendable(int nFlag)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x439CD0L)(this, nFlag);
    }

    void UnCheckSendable(int nFlag)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439E50L)(this, nFlag);
    }

    void SetSaleState(SaleState state)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439FD0L)(this, (int)state);
    }

    SaleState GetSaleState()
    {
        typedef int (*f)(CAuctionAgit*);
        return (SaleState)f(0x43A0C0L)(this);
    }

    int GetAuctionCount()
    {
        typedef int (*f)(CAuctionAgit*);
        return f(0x43A190L)(this);
    }

    bool CanDoAuction()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x43A290L)(this);
    }

    void EnterDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A360L)(this);
    }

    void LeaveDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A4B0L)(this);
    }

    bool IsInAuction(int nPledgeId)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x43AC40L)(this, nPledgeId);
    }

    int GetAuctionPrice(int nPledgeId)
    {
        typedef int (*f)(CAuctionAgit*, int);
        return f(0x43AE90L)(this, nPledgeId);
    }

    bool CanAttend(int nPledgeId, User *pUser);

    void DelAuction(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B680L)(this, nPledgeId);
    }

    void SetNextCost(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B950L)(this, nPledgeId);
    }

    void ResetAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43BE70L)(this);
    }

    void AddAuction(int nPledgeId, int nPrice)
    {
        typedef void (*f)(CAuctionAgit*, int, int);
        f(0x43CCA0L)(this, nPledgeId, nPrice);
    }

    void TimerExpired(int id);
};

Packet adapter for HF server and main 166 protocol client
1778511978508.webp 1778512065804.webp
 
Последнее редактирование:
Предоставляю услуги по обратной разработке Lineage 2.
Имею опыт с:
- IL сервер (апнутый с C4) & клиент, но основной упор был на сервер.
- GF сервер, HF сервер.

Стоимость услуг договорная. Пишите либо тут в лс, либо в дискорд из профиля. Согласен на работу через гаранта \ оплату по итогу работы

I provide Lineage 2 reverse engineering services.
I have experience with:
- IL server (extended C4) and client, but my main focus was on the server.
- GF server, HF server.

The price of services is negotiable. Contact me either here in private or on Discord from my profile. I agree to work through a guarantor / payment upon completion of the work

cpp:
C++:
// 0x43B140
bool CAuctionAgit::CanAttend(int nPledgeId, User *pUser)
{
    if(nPledgeId <= 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(GetSaleState() != SALE_STATE_AUCTION)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nOwnerPledgeId = 0;
    if(pRD)
        nOwnerPledgeId = pRD->nPledgeID;

    if(nPledgeId == nOwnerPledgeId)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    CPledge *pPledge = GetPledgeByID(nPledgeId);

    if(!pPledge)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(pPledge->pAgit != NULL)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if((UINT)pPledge->pSD->nLevel < AGIT_MIN_CLAN_LEVEL)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    if(pPledge->pSD->nState != 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nAgitId = 0;
    int nAuctionid = 0;
    int nResult = 0;

    IsInAllAuctions(nPledgeId, &nAgitId, &nAuctionid, &nResult);

    if(nResult != 0)
    {
        if(nResult & 1)
        {
            pUser->SendSystemMessage(0x2A4);
        }
        else if(nResult & 2)
        {
            pUser->SendSystemMessage(0x2A8);
        }
        return false;
    }

    return true;
}

// 0x43A600
void CAuctionAgit::TimerExpired(int id)
{
    if(GetSaleState() == SALE_STATE_AUCTION)
    {
        if(bCanDoAuction == true && _time32(NULL) >= auctionEndTime)
        {
            EnterDoAuction();
            g_DB.RequestSetAgitAuction(pRD->nResidenceID, nAuctionId);
        }
    }

    if(pRD->nPledgeID > 0 && costTime == 0
       && pRD->nPrice > 0
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, -1);
    }

    if(pRD->nPledgeID > 0 && costTime > 0
       && pRD->nPrice > 0
       && _time32(NULL) >= costTime
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, pRD->nLastBid);
    }

    if(pRD->nPledgeID == 0)
    {
        if(GetSaleState() == SALE_STATE_INITIAL)
        {
            SetSaleState(SALE_STATE_AUTO_SELL);
            wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
            g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                     AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
        }
    }

    if(pRD->nPledgeID == 0
       && pRD->nCancelFlag == 1
       && _time32(NULL) >= pRD->nCancelEndTime
       && GetSaleState() == SALE_STATE_CANCEL_PENALTY)
    {
        SetSaleState(SALE_STATE_AUTO_SELL);
        wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
        g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                 AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
    }

    CAgit::TimerExpired(id);
}

Header:
C++:
#define SECONDS_PER_DAY                86400
#define SECONDS_PER_HOUR            3600
#define SECONDS_PER_MINUTE            60
#define SECONDS_PER_WEEK            604800
#define AGIT_AUCTION_DATE_OFFSET    0x10F950
#define AGIT_COMMENT_SIZE            255
#define AGIT_AUTO_SELL_PRICE        10
#define AGIT_AUTO_SELL_DAYS            7
#define AGIT_MAX_AUCTION_PRICE        2000000000
#define AGIT_MIN_CLAN_LEVEL            2

enum SaleState
{
    SALE_STATE_NONE = 0,
    SALE_STATE_INITIAL = 1,
    SALE_STATE_AUTO_SELL = 2,
    SALE_STATE_ACTIVE = 3,
    SALE_STATE_CANCEL_PENALTY = 4,
    SALE_STATE_AUCTION = 8
};

struct AuctionBidInfo
{
    int nPledgeId;
    int nPrice;
    int _unk;
};

class CAuctionAgit : public CAgit
{
public:
    /* 04F0 */ LPCIOCriticalSection pAuctionLock;
    /* 0520 */ int _n0520;
    /* 0524 */ __time32_t auctionEndTime;
    /* 0528 */ __time32_t cancelTimestamp;
    /* 052C */ __time32_t costTime;
    /* 0530 */ int _n0530;
    /* 0534 */ int _pad0534;
    /* 0538 */ int _n0538;
    /* 053C */ int _n053C;
    /* 0540 */ WCHAR wszComment[AGIT_COMMENT_SIZE];
    /* 0740 */ vector<AuctionBidInfo> bidList;
    /* 0760 */ int nSaleState;
    /* 0764 */ int nAuctionId;
    /* 0768 */ int _n0768;
    /* 076C */ bool bCanDoAuction;

    bool InCancelPenalty()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x439AB0L)(this);
    }

    void StartAuctionTimer()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x439BE0L)(this);
    }

    bool CheckSendable(int nFlag)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x439CD0L)(this, nFlag);
    }

    void UnCheckSendable(int nFlag)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439E50L)(this, nFlag);
    }

    void SetSaleState(SaleState state)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439FD0L)(this, (int)state);
    }

    SaleState GetSaleState()
    {
        typedef int (*f)(CAuctionAgit*);
        return (SaleState)f(0x43A0C0L)(this);
    }

    int GetAuctionCount()
    {
        typedef int (*f)(CAuctionAgit*);
        return f(0x43A190L)(this);
    }

    bool CanDoAuction()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x43A290L)(this);
    }

    void EnterDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A360L)(this);
    }

    void LeaveDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A4B0L)(this);
    }

    bool IsInAuction(int nPledgeId)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x43AC40L)(this, nPledgeId);
    }

    int GetAuctionPrice(int nPledgeId)
    {
        typedef int (*f)(CAuctionAgit*, int);
        return f(0x43AE90L)(this, nPledgeId);
    }

    bool CanAttend(int nPledgeId, User *pUser);

    void DelAuction(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B680L)(this, nPledgeId);
    }

    void SetNextCost(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B950L)(this, nPledgeId);
    }

    void ResetAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43BE70L)(this);
    }

    void AddAuction(int nPledgeId, int nPrice)
    {
        typedef void (*f)(CAuctionAgit*, int, int);
        f(0x43CCA0L)(this, nPledgeId, nPrice);
    }

    void TimerExpired(int id);
};
Т.е. клиент тоже ревесите?
 
Предоставляю услуги по обратной разработке Lineage 2.
Имею опыт с:
- IL сервер (апнутый с C4) & клиент, но основной упор был на сервер.
- GF сервер, HF сервер.

Стоимость услуг договорная. Пишите либо тут в лс, либо в дискорд envydeveloper. Согласен на работу через гаранта \ оплату по итогу работы

I provide Lineage 2 reverse engineering services.
I have experience with:
- IL server (extended C4) and client, but my main focus was on the server.
- GF server, HF server.

The price of services is negotiable. Contact me either here in private or on Discord envydeveloper. I agree to work through a guarantor / payment upon completion of the work

cpp:
C++:
// 0x43B140
bool CAuctionAgit::CanAttend(int nPledgeId, User *pUser)
{
    if(nPledgeId <= 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(GetSaleState() != SALE_STATE_AUCTION)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nOwnerPledgeId = 0;
    if(pRD)
        nOwnerPledgeId = pRD->nPledgeID;

    if(nPledgeId == nOwnerPledgeId)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    CPledge *pPledge = GetPledgeByID(nPledgeId);

    if(!pPledge)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(pPledge->pAgit != NULL)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if((UINT)pPledge->pSD->nLevel < AGIT_MIN_CLAN_LEVEL)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    if(pPledge->pSD->nState != 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nAgitId = 0;
    int nAuctionid = 0;
    int nResult = 0;

    IsInAllAuctions(nPledgeId, &nAgitId, &nAuctionid, &nResult);

    if(nResult != 0)
    {
        if(nResult & 1)
        {
            pUser->SendSystemMessage(0x2A4);
        }
        else if(nResult & 2)
        {
            pUser->SendSystemMessage(0x2A8);
        }
        return false;
    }

    return true;
}

// 0x43A600
void CAuctionAgit::TimerExpired(int id)
{
    if(GetSaleState() == SALE_STATE_AUCTION)
    {
        if(bCanDoAuction == true && _time32(NULL) >= auctionEndTime)
        {
            EnterDoAuction();
            g_DB.RequestSetAgitAuction(pRD->nResidenceID, nAuctionId);
        }
    }

    if(pRD->nPledgeID > 0 && costTime == 0
       && pRD->nPrice > 0
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, -1);
    }

    if(pRD->nPledgeID > 0 && costTime > 0
       && pRD->nPrice > 0
       && _time32(NULL) >= costTime
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, pRD->nLastBid);
    }

    if(pRD->nPledgeID == 0)
    {
        if(GetSaleState() == SALE_STATE_INITIAL)
        {
            SetSaleState(SALE_STATE_AUTO_SELL);
            wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
            g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                     AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
        }
    }

    if(pRD->nPledgeID == 0
       && pRD->nCancelFlag == 1
       && _time32(NULL) >= pRD->nCancelEndTime
       && GetSaleState() == SALE_STATE_CANCEL_PENALTY)
    {
        SetSaleState(SALE_STATE_AUTO_SELL);
        wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
        g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                 AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
    }

    CAgit::TimerExpired(id);
}

Header:
C++:
#define SECONDS_PER_DAY                86400
#define SECONDS_PER_HOUR            3600
#define SECONDS_PER_MINUTE            60
#define SECONDS_PER_WEEK            604800
#define AGIT_AUCTION_DATE_OFFSET    0x10F950
#define AGIT_COMMENT_SIZE            255
#define AGIT_AUTO_SELL_PRICE        10
#define AGIT_AUTO_SELL_DAYS            7
#define AGIT_MAX_AUCTION_PRICE        2000000000
#define AGIT_MIN_CLAN_LEVEL            2

enum SaleState
{
    SALE_STATE_NONE = 0,
    SALE_STATE_INITIAL = 1,
    SALE_STATE_AUTO_SELL = 2,
    SALE_STATE_ACTIVE = 3,
    SALE_STATE_CANCEL_PENALTY = 4,
    SALE_STATE_AUCTION = 8
};

struct AuctionBidInfo
{
    int nPledgeId;
    int nPrice;
    int _unk;
};

class CAuctionAgit : public CAgit
{
public:
    /* 04F0 */ LPCIOCriticalSection pAuctionLock;
    /* 0520 */ int _n0520;
    /* 0524 */ __time32_t auctionEndTime;
    /* 0528 */ __time32_t cancelTimestamp;
    /* 052C */ __time32_t costTime;
    /* 0530 */ int _n0530;
    /* 0534 */ int _pad0534;
    /* 0538 */ int _n0538;
    /* 053C */ int _n053C;
    /* 0540 */ WCHAR wszComment[AGIT_COMMENT_SIZE];
    /* 0740 */ vector<AuctionBidInfo> bidList;
    /* 0760 */ int nSaleState;
    /* 0764 */ int nAuctionId;
    /* 0768 */ int _n0768;
    /* 076C */ bool bCanDoAuction;

    bool InCancelPenalty()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x439AB0L)(this);
    }

    void StartAuctionTimer()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x439BE0L)(this);
    }

    bool CheckSendable(int nFlag)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x439CD0L)(this, nFlag);
    }

    void UnCheckSendable(int nFlag)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439E50L)(this, nFlag);
    }

    void SetSaleState(SaleState state)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439FD0L)(this, (int)state);
    }

    SaleState GetSaleState()
    {
        typedef int (*f)(CAuctionAgit*);
        return (SaleState)f(0x43A0C0L)(this);
    }

    int GetAuctionCount()
    {
        typedef int (*f)(CAuctionAgit*);
        return f(0x43A190L)(this);
    }

    bool CanDoAuction()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x43A290L)(this);
    }

    void EnterDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A360L)(this);
    }

    void LeaveDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A4B0L)(this);
    }

    bool IsInAuction(int nPledgeId)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x43AC40L)(this, nPledgeId);
    }

    int GetAuctionPrice(int nPledgeId)
    {
        typedef int (*f)(CAuctionAgit*, int);
        return f(0x43AE90L)(this, nPledgeId);
    }

    bool CanAttend(int nPledgeId, User *pUser);

    void DelAuction(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B680L)(this, nPledgeId);
    }

    void SetNextCost(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B950L)(this, nPledgeId);
    }

    void ResetAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43BE70L)(this);
    }

    void AddAuction(int nPledgeId, int nPrice)
    {
        typedef void (*f)(CAuctionAgit*, int, int);
        f(0x43CCA0L)(this, nPledgeId, nPrice);
    }

    void TimerExpired(int id);
};
зачем в PTS ядре для аукциона агитов используется именно IOCPлок, а не стандартный EnterCriticalSection? Что будет, если заменить его на обычный std::mutex в своём инжекте?
 
зачем в PTS ядре для аукциона агитов используется именно IOCPлок, а не стандартный EnterCriticalSection? Что будет, если заменить его на обычный std::mutex в своём инжекте?
Восстановлено все ровно так же, как в бинарнике. Но на деле, это просто обертка над EnterCriticalSection, чтобы в случае падения можно было в linerror.txt увидеть потоки, и кто кого залочил
std::mutex, насколько мне известно, не рекурсивен, а в корейском коде есть места, где идет рекурсивный захват в одном потоке. Ну и поехать структуры могут, надо будет сверять различия размера std::mutex и CIOCriticalSection
 
Предоставляю услуги по обратной разработке Lineage 2.
Имею опыт с:
- IL сервер (апнутый с C4) & клиент, но основной упор был на сервер.
- GF сервер, HF сервер.

Стоимость услуг договорная. Пишите либо тут в лс, либо в дискорд envydeveloper. Согласен на работу через гаранта \ оплату по итогу работы

I provide Lineage 2 reverse engineering services.
I have experience with:
- IL server (extended C4) and client, but my main focus was on the server.
- GF server, HF server.

The price of services is negotiable. Contact me either here in private or on Discord envydeveloper. I agree to work through a guarantor / payment upon completion of the work

cpp:
C++:
// 0x43B140
bool CAuctionAgit::CanAttend(int nPledgeId, User *pUser)
{
    if(nPledgeId <= 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(GetSaleState() != SALE_STATE_AUCTION)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nOwnerPledgeId = 0;
    if(pRD)
        nOwnerPledgeId = pRD->nPledgeID;

    if(nPledgeId == nOwnerPledgeId)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    CPledge *pPledge = GetPledgeByID(nPledgeId);

    if(!pPledge)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if(pPledge->pAgit != NULL)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    if((UINT)pPledge->pSD->nLevel < AGIT_MIN_CLAN_LEVEL)
    {
        pUser->SendSystemMessage(0x2A1);
        return false;
    }

    if(pPledge->pSD->nState != 0)
    {
        pUser->SendSystemMessage(0x2A8);
        return false;
    }

    int nAgitId = 0;
    int nAuctionid = 0;
    int nResult = 0;

    IsInAllAuctions(nPledgeId, &nAgitId, &nAuctionid, &nResult);

    if(nResult != 0)
    {
        if(nResult & 1)
        {
            pUser->SendSystemMessage(0x2A4);
        }
        else if(nResult & 2)
        {
            pUser->SendSystemMessage(0x2A8);
        }
        return false;
    }

    return true;
}

// 0x43A600
void CAuctionAgit::TimerExpired(int id)
{
    if(GetSaleState() == SALE_STATE_AUCTION)
    {
        if(bCanDoAuction == true && _time32(NULL) >= auctionEndTime)
        {
            EnterDoAuction();
            g_DB.RequestSetAgitAuction(pRD->nResidenceID, nAuctionId);
        }
    }

    if(pRD->nPledgeID > 0 && costTime == 0
       && pRD->nPrice > 0
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, -1);
    }

    if(pRD->nPledgeID > 0 && costTime > 0
       && pRD->nPrice > 0
       && _time32(NULL) >= costTime
       && GetSaleState() == SALE_STATE_ACTIVE)
    {
        costTime = -1;
        g_DB.RequestAgitCost(pRD->nResidenceID, pRD->nPledgeID, pRD->nPrice, pRD->nLastBid);
    }

    if(pRD->nPledgeID == 0)
    {
        if(GetSaleState() == SALE_STATE_INITIAL)
        {
            SetSaleState(SALE_STATE_AUTO_SELL);
            wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
            g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                     AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
        }
    }

    if(pRD->nPledgeID == 0
       && pRD->nCancelFlag == 1
       && _time32(NULL) >= pRD->nCancelEndTime
       && GetSaleState() == SALE_STATE_CANCEL_PENALTY)
    {
        SetSaleState(SALE_STATE_AUTO_SELL);
        wcscpy_s(wszComment, AGIT_COMMENT_SIZE, L"");
        g_DB.RequestAgitAutoSell(pRD->nResidenceID, pRD->nAcquireId,
                                 AGIT_AUTO_SELL_PRICE, AGIT_AUTO_SELL_DAYS, 0);
    }

    CAgit::TimerExpired(id);
}

Header:
C++:
#define SECONDS_PER_DAY                86400
#define SECONDS_PER_HOUR            3600
#define SECONDS_PER_MINUTE            60
#define SECONDS_PER_WEEK            604800
#define AGIT_AUCTION_DATE_OFFSET    0x10F950
#define AGIT_COMMENT_SIZE            255
#define AGIT_AUTO_SELL_PRICE        10
#define AGIT_AUTO_SELL_DAYS            7
#define AGIT_MAX_AUCTION_PRICE        2000000000
#define AGIT_MIN_CLAN_LEVEL            2

enum SaleState
{
    SALE_STATE_NONE = 0,
    SALE_STATE_INITIAL = 1,
    SALE_STATE_AUTO_SELL = 2,
    SALE_STATE_ACTIVE = 3,
    SALE_STATE_CANCEL_PENALTY = 4,
    SALE_STATE_AUCTION = 8
};

struct AuctionBidInfo
{
    int nPledgeId;
    int nPrice;
    int _unk;
};

class CAuctionAgit : public CAgit
{
public:
    /* 04F0 */ LPCIOCriticalSection pAuctionLock;
    /* 0520 */ int _n0520;
    /* 0524 */ __time32_t auctionEndTime;
    /* 0528 */ __time32_t cancelTimestamp;
    /* 052C */ __time32_t costTime;
    /* 0530 */ int _n0530;
    /* 0534 */ int _pad0534;
    /* 0538 */ int _n0538;
    /* 053C */ int _n053C;
    /* 0540 */ WCHAR wszComment[AGIT_COMMENT_SIZE];
    /* 0740 */ vector<AuctionBidInfo> bidList;
    /* 0760 */ int nSaleState;
    /* 0764 */ int nAuctionId;
    /* 0768 */ int _n0768;
    /* 076C */ bool bCanDoAuction;

    bool InCancelPenalty()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x439AB0L)(this);
    }

    void StartAuctionTimer()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x439BE0L)(this);
    }

    bool CheckSendable(int nFlag)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x439CD0L)(this, nFlag);
    }

    void UnCheckSendable(int nFlag)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439E50L)(this, nFlag);
    }

    void SetSaleState(SaleState state)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x439FD0L)(this, (int)state);
    }

    SaleState GetSaleState()
    {
        typedef int (*f)(CAuctionAgit*);
        return (SaleState)f(0x43A0C0L)(this);
    }

    int GetAuctionCount()
    {
        typedef int (*f)(CAuctionAgit*);
        return f(0x43A190L)(this);
    }

    bool CanDoAuction()
    {
        typedef bool (*f)(CAuctionAgit*);
        return f(0x43A290L)(this);
    }

    void EnterDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A360L)(this);
    }

    void LeaveDoAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43A4B0L)(this);
    }

    bool IsInAuction(int nPledgeId)
    {
        typedef bool (*f)(CAuctionAgit*, int);
        return f(0x43AC40L)(this, nPledgeId);
    }

    int GetAuctionPrice(int nPledgeId)
    {
        typedef int (*f)(CAuctionAgit*, int);
        return f(0x43AE90L)(this, nPledgeId);
    }

    bool CanAttend(int nPledgeId, User *pUser);

    void DelAuction(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B680L)(this, nPledgeId);
    }

    void SetNextCost(int nPledgeId)
    {
        typedef void (*f)(CAuctionAgit*, int);
        f(0x43B950L)(this, nPledgeId);
    }

    void ResetAuction()
    {
        typedef void (*f)(CAuctionAgit*);
        f(0x43BE70L)(this);
    }

    void AddAuction(int nPledgeId, int nPrice)
    {
        typedef void (*f)(CAuctionAgit*, int, int);
        f(0x43CCA0L)(this, nPledgeId, nPrice);
    }

    void TimerExpired(int id);
};
Респект парню!
 
Последнее редактирование:
Ну как бы этим все сказано о скиле автора😂
Чтобы получить качественный реверс и не наплодить новых багов нужно пройти через несколько этапов. Таких как реверс, компиляцию с использованием того же компилятора, что и оригинальный бинарник, сверку двух дизассемблированных кодов. И только после этого можно приступать к кастомизации. В кач-ве примера работы был предоставлен сверенный отрывок нескольких методов, без кастомизации, либо исправления оригинальных багов
 
Последнее редактирование:
1ое правило реверсера, не когда не верь псевдакоду:)
2ое не верь ии:)
 
Последнее редактирование:
Большое спасибо за помощь! Благодаря вам я смог решить первую проблему — теперь регистрация аккаунта работает. Очень ценю вашу помощь!
 
I’ve been communicating with this person for about a month now, and he helps with everything I ask for.
I would definitely recommend working with someone like him.
 
Назад
Сверху Снизу