ida查找遇到的问题,大家帮忙看看
IDA6.6版本,我想查找这 代码 if ((cur_time - charbase.levelsept) < 24*60*60)
我搜索这个 charbase.levelsept 转成16进制 63686172626173652E6C6576656C73657074
链接: https://pan.baidu.com/s/1cy7QU-0sQyjuDPdoi8xMLA?pwd=5qva 提取码: 5qva 复制这段内容后打开百度网盘手机App,操作更方便哦
就是无法找到 求解答
想吧 < 24*60*60 这个时间改成1秒 ,大神帮忙解答下谢谢!!
BlueTears 发表于 2023-4-23 15:34
已经定位到具体的函数了,就根据源码和ida的f5伪代码进行匹配对比就行了
/**
* \file
* \version $Id: RebuildObject.h$
* \author
* \date 2005-04-18
* \brief 新物品合成,打造,升级,打孔,镶嵌系统
*
*/
#ifndef __REBUILD_OBJECT__
#define __REBUILD_OBJECT__
#include <map>
#include "zType.h"
#include "zMisc.h"
#include "zDatabase.h"
#include "zObject.h"
#include "SceneUser.h"
namespace Cmd{
struct stPropertyUserCmd;
struct stFoundItemPropertyUserCmd;
}
class zObjectB;
/**
* \brief 物品改造基类
*
* 封装了几个常用的操作
*
*/
class Base
{
public:
enum RebuildType
{
COMPOSE = 1,
MAKE = 2,
UPGRADE = 3,
HOLE = 4,
ENCHANCE = 5,
DECOMPOSE = 6,
EQUIP_COMPOSE = 7, //ZHULU 新增
EQUIP_UPSTAR = 8, //ZHULU 新增
EQUIP_SIGN = 9, //ZHULU 新增
EQUIP_BIND = 10, //ZHULU 新增
EQUIP_ENCHASE = 11, //ZHULU 新增
};
static bool check_npc(SceneUser& user, zObjectB* base, int action);
static bool check_space(SceneUser& user, DWORD w, DWORD h);
static bool remove_object(SceneUser& user, zObject* ob);
///删除物品加日志
static bool removeObject(SceneUser& user, zObject* ob, const char *info);
static bool add_object(SceneUser& user, zObject* ob, bool add = true);
static bool response(SceneUser& user, int status, RebuildType type);
static void refresh_pack(SceneUser& user, ObjectPack* pack);
//回复合成等操作的结果
static bool reply(SceneUser& user, int status, RebuildType type, const char *pattern, ...);
};
/**
* \brief 孔
*
* 封装了对与孔相关的处理函数
*
*/
class Hole
{
public:
enum {
INVALID_INDEX = 6,
INVALID_NUM = 7,
};
static bool can_hole(zObject * ob);
static int get_empty_hole(zObject* ob);
static int get_hole_num(zObject* ob);
static int add_hole_num(zObject* ob, int num);
static bool add_hole(zObject* ob, int index);
static bool put_hole(zObject* ob, int index, int id);
};
/**
* \brief 魂魄石
*
* 封装了对魂魄石的处理函数,包括镶嵌及合成等
*
*/
class SoulStone
{
public:
static zObject* compose(SceneUser& user, zObject* first, zObject* second, int odds);
static bool enchance(SceneUser& user, zObject* dest, zObject* src);
static int id(DWORD trait);
static bool assign(zObject* ob, int monster);
private:
static bool do_enchance(zObject* dest, zObject* src);
static bool do_compose(zObject* first, zObject* second, zObject* dest);
/**
* \brief 魂魄属性计算
*
* \param first: 第一块魂魄石属性
* \param second: 第二块魂魄石属性
* \param result: 计算结果
* \param level:魂魄石等级
* \return 无
*/
template<typename T>
static void additive(T first, T second, T& result, int level)
{
if (first && second) {
//result = std::max(first, second) + 0.1*std::min(first, second)
T max = first, min = second, grade = level & 0xff;
if (max < min) {
max = second;
min = first;
grade = level >> 8;
}
result =max + static_cast<T>(min*0.1*grade);
}else {
result = first + second;
}
}
static const int _ids[];
};
/**
* \brief 升级
*
* 实现了物品升级功能
*
*/
class Upgrade
{
public:
static bool upgrade(SceneUser& user, zObject* ob, int extra_odds);
private:
static bool do_upgrade(zObject* ob, zUpgradeObjectB* base);
static bool do_downgrade(zObject* ob, zUpgradeObjectB* base);
};
/**
* \brief 物品分解
*
* 实现物品分解功能
*
*/
class Decompose
{
public:
/**
* \brief 构造函数
*
* 初始化相关变量
*
* param ob : 待分解物品
*
*/
Decompose(zObject* ob) : _ob(ob)
{ }
bool bonus_items(SceneUser& user);
bool bonus_exp(SceneUser& user);
bool remove_from(SceneUser& user);
int gold() const;
private:
int chance() const;
int index() const;
zObject* _ob;
const static int _odds[];
const static int _items[];
};
#define COMPUTE_R(x) additive(ob->data.x, bob->x);
#define COMPUTE_L(x) additive(ob->data.x, bob->x, property);
//暂时屏蔽 装备中的技能加成 BONUS_SKILL BONUS_SKILLS BONUS_SKILL_RING 2010年7月1日
//#define BONUS_SKILL
//#define BONUS_SKILLS
//#define BONUS_SKILL_RING
#define BONUS_SKILL std::vector<skillbonus>::iterator it = bob->skill.begin();\
bool must = false; \
for ( ; it!=bob->skill.end(); ++it) { \
int odds = odds_of_property(it->odds, property); \
if (zMisc::selectByTenTh(odds) || must) { \
int i = 0; \
while ( i <3) {\
if (ob->data.skill.id == 0 || ob->data.skill.id==it->id) {\
ob->data.skill.id = it->id; \
ob->data.skill.point += it->level; \
break;\
}else {\
++i;\
}\
if (i>2 &&must) break;\
}\
} \
}
//戒指,项链
#define BONUS_SKILL_RING {\
if(!bob->skill.empty())\
{\
int index = zMisc::randBetween(0, bob->skill.size()-1 );\
int i = 0; \
while ( i <3) {\
if (ob->data.skill.id == 0 || ob->data.skill.id==bob->skill.id) {\
ob->data.skill.id = bob->skill.id; \
ob->data.skill.point += bob->skill.level; \
break;\
}else {\
++i;\
}\
}\
}\
}
#define BONUS_SKILLS int odds = odds_of_property(bob->skills.odds, property); \
if (zMisc::selectByTenTh(odds)) { \
ob->data.skills.id = bob->skills.id; \
ob->data.skills.point = bob->skills.level; \
}
/**
* \brief 打造
*
* 实现了物品打造功能
*
*/
class EquipMaker
{
public:
EquipMaker(SceneUser* user);
/**
* \brief 析构函数
*
*/
~EquipMaker() { }
bool check_skill(SceneUser& user, zObjectB* ob);
bool add_skill(SceneUser& user, zObjectB* ob);
bool add_exp(SceneUser& user, DWORD exp);
bool check_material(zObjectB* ob, const std::map<DWORD, DWORD>& list, bool is_resource = false);
// void pre_level_of_material(zObjectB* base);
void pre_level_of_material(int id, int level);
bool level_of_material(DWORD id, DWORD num, DWORD level, zObjectB* base);
bool is_odds_gem(DWORD kind, DWORD id);
zObject* make_material(zObjectB* base);
zObject* make(SceneUser* user, zObjectB* base, int flag = 0);
void assign(SceneUser* user, zObject* ob, zObjectB* base, bool drop =false , int flag = 0);
void fix(zObject* ob);
void bonus_hole(zObject* ob);
/**
* \brief 生成特殊装备
*
* \param bob: 对应装备基本表
* \param ob: 打造物品
* \param kind: 装备类型
* \return 当前总是返回true
*/
template <typename T>
bool assign_color(T* bob, zObject* ob, int kind, int props = 0,zObjectB *base=NULL ,bool drop=false)
{
char tmp;
snprintf(tmp, MAX_NAMESIZE, "%s%s%s", bob->prefix, bob->joint, ob->data.strName);
strncpy(ob->data.strName, tmp, MAX_NAMESIZE);
int property = 1;
if(props >= 17)
{
++property;
//ob->data.fivepoint += zMisc::randBetween(bob->five.data.min, bob->five.data.max);
if (/*ob->data.fivepoint &&// */ ob->data.fivetype == FIVE_NONE)
{
ob->data.fivetype = zMisc::randBetween(0, 4);
}
}
else //if (additive(ob->data.fivepoint, bob->five, property))
{
//ob->data.fivepoint -= bob->five.sleightValue;
if (/*ob->data.fivepoint && // */ob->data.fivetype == FIVE_NONE && zMisc::selectByTenTh(bob->five.per))
{
ob->data.fivetype = zMisc::randBetween(0, 4);
}
}
COMPUTE_R( pdamage ) // 最小物攻
COMPUTE_R( maxpdamage ) // 最大物攻
COMPUTE_R( mdamage ) // 最小魔攻
COMPUTE_R( maxmdamage ) // 最大魔攻
COMPUTE_R( pdefence ) // 物防
COMPUTE_R( mdefence ) // 魔防
if (props)
{
int index = zMisc::randBetween(0, 4);
if (index!=5)
{
//现在不用随机了,直接取值
additivePercent(*ob->_p1, bob->_p1);
}
else
{
fix_kind(bob, ob);
}
}
else
{
COMPUTE_L( str ) // 力量
COMPUTE_L( inte ) // 智力
COMPUTE_L( dex ) // 敏捷
COMPUTE_L( spi ) // 精神
COMPUTE_L( con ) // 体质
}
COMPUTE_L( maxhp ) // 最大生命值
COMPUTE_L( maxmp ) // 最大法术值
//COMPUTE_L( maxsp ) // 最大体力值
COMPUTE_L( mvspeed ) // 移动速度
COMPUTE_L( hpr ) // 生命值恢复
COMPUTE_L( mpr ) // 法术值恢复
COMPUTE_L( spr ) // 体力值恢复
COMPUTE_L( akspeed ) // 攻击速度
if (props)
{
for (int i=0; i<=17; ++i)
{
if(props == 17)
{
if( i == 0 || i == 2)
{
if(bob->_p2.per)
*ob->_p2 += bob->_p2.data.max;
}
else if (i == 1 || i == 3)
{
if(bob->_p2.per)
{
int temp = zMisc::randBetween(((bob->_p2.data.max - bob->_p2.data.min)/2 + bob->_p2.data.min + 1),bob->_p2.data.max);
*ob->_p2 += temp;
}
}
else
{
max(*ob->_p2, bob->_p2);
}
}
else if(props == 18)
{
if( i == 0 || i == 2)
{
if(bob->_p2.per)
*ob->_p2 += 10;
}
else if (i == 1 || i == 3)
{
if(bob->_p2.per)
*ob->_p2 += bob->_p2.data.max;
}
else
{
max(*ob->_p2, bob->_p2);
}
}
else
{
additive(*ob->_p2, bob->_p2);
}
}
/*
std::vector<int> list;
for (int i=0; i<=17; ++i) list.push_back(i);
//每个都需要随机
//int geted = props;
// */
/*
if(props == 5){
if(list.size() >=4){
additive(*ob->_p2], bob->_p2]);
}
if(list.size() >=8){
additive(*ob->_p2], bob->_p2]);
}
}else{
// */
//while (/*geted -- > 0 && */list.size() > 0) {
/*
int index = zMisc::randBetween(0, list.size()-1 );
int p = list;
//取最大值
if(props == 17){
max(*ob->_p2, bob->_p2);
}else{
additive(*ob->_p2, bob->_p2);
}
std::vector<int>::iterator it = list.begin();
list.erase(it+index);
// */
//}
//}
}
else
{
COMPUTE_L( pdam ) // 增加物理攻击力
COMPUTE_L( mdam ) // 增加魔法攻击力
COMPUTE_L( pdef ) // 增加物理防御力
COMPUTE_L( mdef ) // 增加魔法防御力
COMPUTE_L( atrating ) // 命中率
COMPUTE_L( akdodge ) // 闪避率
COMPUTE_L( poisondef ) // 抗毒增加
COMPUTE_L( lulldef ) // 抗麻痹增加
COMPUTE_L( reeldef ) // 抗眩晕增加
COMPUTE_L( evildef ) // 抗噬魔增加
COMPUTE_L( bitedef ) // 抗噬力增加
COMPUTE_L( chaosdef ) // 抗混乱增加
COMPUTE_L( colddef ) // 抗冰冻增加
COMPUTE_L( petrifydef ) // 抗石化增加
COMPUTE_L( blinddef ) // 抗失明增加
COMPUTE_L( stabledef ) // 抗定身增加
COMPUTE_L( slowdef ) // 抗减速增加
COMPUTE_L( luredef ) // 抗诱惑增加
}
if (!ob->data.durpoint)
{
if (additive(ob->data.durpoint, bob->resumedur, property))
{
ob->data.durpoint -= bob->resumedur.sleightValue;
}
if (ob->data.durpoint) ob->data.dursecond = bob->resumedur.sleightValue;
}
COMPUTE_L( bang ) //重击
//ob->data.bang += bob->bang;
//戒指项链至少一个
if(ob->base->kind == ItemType_Fing || ob->base->kind == ItemType_Necklace)
{
BONUS_SKILL_RING
}
BONUS_SKILL
BONUS_SKILLS
if (props)
ob->data.kind |= 2;//有色装备
else
ob->data.kind |= kind;//有色装备
return true;
}
bool assign_holy(zObject* ob, int holy,bool bDrop =false);//ZH 增加生成绿装的落掉与打造区别
private:
struct Odds
{
int per;
int luck;
double material_level;
int skill_level;
int odds;
int sleight;
int odds_gem;
Odds() : per(0), luck(0), material_level(0), skill_level(0), odds(0), sleight(0), odds_gem(0)
{ }
};
Odds _odds;
double _current;
double _base;
bool _make;
int _need;
int _1_id;
int _1_level;
int _2_id;
int _2_level;
int odds_of_white(const zObjectB* ob);
int odds_of_blue(const zObjectB* ob);
int odds_of_gold(const zObjectB* ob);
int odds_of_holy(int object);
int odds_of_property(int object, int property);
template <typename T>
void fix_kind(T* bob, zObject* ob)
{
switch (ob->base->kind)
{
case ItemType_ClothBody ://101代表布质加生命类服装
additivePercent(ob->data.maxhp, bob->maxsp);
break;
case ItemType_FellBody : //102代表皮甲加魔防类服装
additivePercent(ob->data.mdefence, bob->maxsp);
break;
case ItemType_MetalBody: //103代表金属铠甲加物防类服装
case ItemType_Shield: //112代表盾牌类
// add by snip3r
case ItemType_MagicFigure:
case ItemType_MagicBall:
// end add by snip3r
additivePercent(ob->data.pdefence, bob->maxsp);
break;
case ItemType_Blade: //104代表武术刀类武器
case ItemType_Sword: //105代表武术剑类武器
case ItemType_Axe: //106代表武术斧类武器
case ItemType_Hammer: //107代表武术斧类武器
case ItemType_Crossbow: //109代表箭术弓类武器
additivePercent(ob->data.pdamage, bob->maxsp);
additivePercent(ob->data.maxpdamage, bob->maxsp);
break;
case ItemType_Staff: //108代表法术杖类武器
case ItemType_Stick: //111代表召唤棍类武器
case ItemType_Fan: //110代表美女扇类
additivePercent(ob->data.mdamage, bob->maxsp);
additivePercent(ob->data.maxmdamage, bob->maxsp);
break;
case ItemType_Helm: //113代表角色头盔类
case ItemType_Caestus: //114代表角色腰带类
case ItemType_Cuff: //115代表角色护腕类
case ItemType_Shoes: //116代表角色鞋子类
if (zMisc::randBetween(0, 1)) {
additivePercent(ob->data.pdefence, bob->maxsp);
}else {
additivePercent(ob->data.mdefence, bob->maxsp);
}
break;
case ItemType_Necklace: //117代表角色项链类
case ItemType_Fing: //118代表角色戒指类
if (ob->data.pdamage || ob->data.maxpdamage) {
additivePercent(ob->data.pdamage, bob->maxsp);
additivePercent(ob->data.maxpdamage, bob->maxsp);
}
if (ob->data.mdamage || ob->data.maxmdamage) {
additivePercent(ob->data.mdamage, bob->maxsp);
additivePercent(ob->data.maxmdamage, bob->maxsp);
}
break;
}
}
/**
* \brief 属性取最大值
*
* \param ret: 计算结果
* \param lv: 属性取值范围
* \return 无
*/
template <typename T>
bool max(T& ret, const luckRangeValue &rv)
{
if( zMisc::selectByTenTh(rv.per) ) {
ret += rv.data.max;
}
/*
if ( zMisc::selectByPercent(_odds.sleight) ) {
ret += rv.sleightValue;
return true;
}
// */
return false;
}
bool assign_set(zObject* ob);
/**
* \brief 属性计算
*
* \param ret: 计算结果
* \param lv: 属性取值范围
* \return 无
*/
template <typename T>
void additive(T& ret, const rangeValue &rv)
{
ret += zMisc::randBetween(rv.min,rv.max);
}
/**
* \brief 神圣属性计算
*
* \param ret: 计算结果
* \param lv: 属性取值范围
* \param property: 物品当前属性数目
* \return 无
*/
template <typename T>
bool additive(T& ret, const luckRangeValue & lv, int& property)
{
int odds = lv.per;
// int odds = odds_of_property(lv.per, property);
// Zebra::logger->debug("属性产生概率%f, %f", lv.per*1.0, odds*1.0);
if( zMisc::selectByTenTh(odds) ) {
++property;
ret += zMisc::randBetween(lv.data.min, lv.data.max);
/*
if ( zMisc::selectByPercent(_odds.sleight) ) {
ret += lv.sleightValue;
return true;
}
// */
}
return false;
}
template <typename T>
bool additive(T& ret, const luckRangeValue & lv)
{
if( zMisc::selectByTenTh(lv.per) ) {
ret += zMisc::randBetween(lv.data.min, lv.data.max);
}
/*
if ( zMisc::selectByPercent(_odds.sleight) ) {
ret += lv.sleightValue;
return true;
}
// */
return false;
}
template <typename T>
bool additivePercent(T& ret, const luckRangeValue & lv)
{
ret += zMisc::randBetween(lv.data.min, lv.data.max);
/*
if ( zMisc::selectByPercent(_odds.sleight) ) {
ret += lv.sleightValue;
return true;
}
// */
return false;
}
};
#include "zDatabaseManager.h"
/**
* \brief 物品改造
*
* 实现各种物品改造功能,提供一个统一入口
*
*/
class RebuildObject : public Base
{
public:
enum
{
MAX_NUMBER = 50,
HOLE_MONEY = 1000,
ENCHANSE_MONEY = 500, //镶嵌费用,单位:文
COMP_SOUL_STONE_ID = 677,
ENCHANSE_AUXSONTE_ID = 678, //魂魄镶嵌的辅助宝石ID
HOLE_SONTE_ID = 679,
ENCHANSE_SONTE_ID0 = 680, //储存有怪物精华的神石,
LVUP_GEM_ID = 681, //45级以下升级宝石
ENCHANSE_SONTE_ID1 = 748, //储存有怪物精华的神石,可镶嵌在带孔的衣服和武器上
ENCHANSE_SONTE_ID2 = 749, //储存有怪物精华的神石,可镶嵌在带孔的头盔和鞋子上
ENCHANSE_SONTE_ID3 = 750, //储存有怪物精华的神石,可镶嵌在带孔的腰带和护腕上
ENCHANSE_SONTE_ID4 = 751, //储存有怪物精华的神石,可镶嵌在带孔的项链和戒指上
BIND_SOUL_STONE_ID = 794, //绑定装备用的灵魂宝石
SENIOR_LVUP_GEM_ID = 795, //45级以上升星宝石
};
static RebuildObject& instance();
bool compose(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool compose_soul_stone(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool upgrade(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool make(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool hole(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool enchance(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
bool decompose(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
//yikey
zObject* tempEquip;
bool checkUpGrade(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
bool upGradeReduce(SceneUser &user, zUpgradeObjectB* upGradeObj);
bool equipUpGrade(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
//
///新的装备改造 2010年8月23日
bool recast(SceneUser& user, const Cmd::stPropertyUserCmd* cmd);
///装备升星
bool equipUpStar(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///装备绑定
bool bindSoulStone(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///装备镶嵌魂魄石
bool enchaseSoulStone(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///原料material合成
bool matrlCompose(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///装备合成
bool equipCompose(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///装备签名
bool equipSign(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
///装备重新绑定属性
bool equipRebindProp(SceneUser &user, const Cmd::ItemRecastPropertyUserCmd *rev);
private:
/**
* \brief 构造函数
*
*/
RebuildObject() { }
/**
* \brief 析构函数
*
*/
~RebuildObject() { }
static RebuildObject* _instance;
};
#endif
还有一个问题,上面的是源码,我需要搜索到 SENIOR_LVUP_GEM_ID = 795, //45级以上升星宝石把795修改城799 ,这个函数不知道是哪个?
搜索代码有什么技巧吗,我直接搜 = 795 转成16进制搜索搜索不到,源码和二进制运行文件出入不会太多
SENIOR_LVUP_GEM_ID = 795, //45级以上升星宝石
SENIOR_LVUP_GEM_ID
//45级以上升星宝石
转16进制都尝试搜索了找不到,求解答,这位置在哪?怎么才能快速的找到呢!
/**
* \file
* \version $
* \author
* \date
* \brief 实现家族命令的处理
*
*/
#include "SceneUser.h"
#include "Scene.h"
#include "RecordClient.h"
#include "Sept.h"
#include "Chat.h"
#include "SessionCommand.h"
#include "SessionClient.h"
using namespace SeptDef;
/**
* \brief 一个比较器
*
*用于查找建立家族所需要的道具是否存在
*
*
*/
class SeptObjectCompare:public UserObjectCompare
{
public:
DWORDdwObjectID;
bool isIt(zObject *object)
{
if (object->data.dwObjectID == dwObjectID) return true;
return false;
}
};
/**
* \brief 处理用户家族命令
*
* 处理的关系命令如下:
*
* Cmd::SEPT_STATUS_CHECK_PARA
*
* Cmd::CREATE_SEPT_PARA
*
* Cmd::ADD_MEMBER_TO_SEPT_PARA
*
* \param rev: 家族命令
* \param cmdLen: 命令长度
*
* \return 命令被处理返回TRUE,否则为FALSE
*
*
*/
bool SceneUser::doSeptCmd(const Cmd::stSeptUserCmd *rev,unsigned int cmdLen)
{
switch(rev->byParam)
{
case Cmd::DONATE_HONOR_PARA:
{
Cmd::stDonateHonor* ptCmd = (Cmd::stDonateHonor*)rev;
if (ptCmd->dwHonor>this->charbase.honor)
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "您的荣誉点不够!");
}
if (ptCmd->dwHonor%10!=0)
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "您的荣誉点不是5的倍数");
}
if (this->charbase.honor>ptCmd->dwHonor)
{
this->charbase.honor = this->charbase.honor - ptCmd->dwHonor;
}
else
{
this->charbase.honor = 0;
}
//通知客户端
Cmd::stMainUserDataUserCmd send;
this->full_t_MainUserData(send.data);
this->sendCmdToMe(&send,sizeof(send));
Cmd::Session::t_OpRepute_SceneSession sendSession;
sendSession.dwSeptID = this->charbase.septid;
sendSession.dwRepute = ptCmd->dwHonor/10;
sessionClient->sendCmd(&send, sizeof(send));
return true;
}
break;
case Cmd::SEPT_STATUS_CHECK_PARA:
case Cmd::CREATE_SEPT_PARA:
{
BYTE bState = 1; //先初始化成成功状态
if (charbase.septid == 0)// 家族ID大于0表示加入家族
{
time_t cur_time = time(NULL);
if ((cur_time - charbase.levelsept) < 24*60*60)
{
//离开时间不足24小时
bState = 0;
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL,
"离开家族后24小时, 才能再建立家族");
}
else {
if (charbase.level >= CREATE_SEPT_NEED_LEVEL)
{
#ifdef CREATE_SEPT_NEED_ITEM_ID
SeptObjectCompare found;
found.dwObjectID = CREATE_SEPT_NEED_ITEM_ID;
zObject *itemobj = packs.uom.getObject(found);// 查找道具
if (itemobj)
{
#endif
/*
zObject *gold=packs.getGold();
if (gold&&gold->data.dwNum >= CREATE_SEPT_NEED_PRICE_GOLD)// 建立家族需要金钱100万
{
//报告成功状态
bState = 1;
}
*/
if (packs.checkMoney(CREATE_SEPT_NEED_PRICE_GOLD) /*&& packs.removeMoney(CREATE_SEPT_NEED_PRICE_GOLD)*/) {
//报告成功状态
bState = 1;
}
else
{
//报告没有足够的钱
bState = 0;
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "你需要%u文钱来创建家族,你没有足够的钱",CREATE_SEPT_NEED_PRICE_GOLD);
}//dwItemID = itemobj->data.qwThisID;// test
#ifdef CREATE_SEPT_NEED_ITEM_ID
}
else
{
//报告没有道具
bState = 0;
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "缺少任务道具无法创建家族");
}
#endif
}
else
{
//报告等级不够
bState = 0;
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "等级没有达到%u级无法创建家族",CREATE_SEPT_NEED_LEVEL);
}
}
}
else
{
bState = 0;
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "已经加入家族无法再创建家族");
}
//返回家族建立状态
if (Cmd::CREATE_SEPT_PARA == rev->byParam)
{
Cmd::stCreateSeptCmd *ptCmd=(Cmd::stCreateSeptCmd *)rev;
if (1 == bState)
{
Cmd::Session::t_addSept_SceneSession send;
send.dwMapTempID = scene->tempid;
send.info.dwSeptID = 0; // 家族的ID
strncpy(send.info.name,ptCmd->SeptName,MAX_NAMESIZE); // 家族名称
send.info.dwCharID = charbase.id; // 会长的角色ID
send.info.byVote = 0; // 默认不进入投票期间
send.info.dwRepute = 0;
send.info.dwUnionID = 0;
send.info.dwLevel = 1;
send.info.dwSpendGold = 0;
send.info.dwIsExp = 0;
send.info.calltimes = 0;
send.info.calldaytime = 0;
send.info.normalexptime = 0;
strncpy(send.info.masterName,charbase.name,MAX_NAMESIZE); // 会长的名字
bzero(send.info.note, sizeof(send.info.note));
sessionClient->sendCmd(&send, sizeof(send));
return true;
}
}
////////////////////////////////////////
if (1 == bState)
{
Cmd::stSeptStatusCheckCmd retCmd;
sendCmdToMe(&retCmd,sizeof(retCmd));
}
///////////////////////////////////////
return true;
}
break;
case Cmd::ADD_MEMBER_TO_SEPT_PARA:
{
Cmd::stAddMemberToSeptCmd *ptCmd=(Cmd::stAddMemberToSeptCmd *)rev;
switch(ptCmd->byState)
{
case Cmd::QUESTION:
{
if (0 == charbase.septid)
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "你必须先创立家族才能招收成员");
return true;
}
SceneUser *pUser=scene->getUserByName(ptCmd->memberName);
if (NULL != pUser)
{
//if (scene->checkUserInNine(this,pUser))
//{
if (!isset_state(pUser->sysSetting , Cmd::USER_SETTING_FAMILY))
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "玩家 %s加入家族未开启", pUser->name);
return true;
}
if (pUser->charbase.level >=JOIN_SEPT_NEED_LEVEL)
{
// 为0表示未加入家族
if (0==pUser->charbase.septid
&& pUser->charbase.unionid==0)
{
time_t cur_time = time(NULL);
if ((cur_time - pUser->charbase.levelsept) < 24*60*60)
{
Channel::sendSys(this,
Cmd::INFO_TYPE_FAIL, "现在还不能邀请该玩家, 该玩家还剩 %d 秒才能再次加入家族",
24*60*60-(cur_time-pUser->charbase.levelsept));
return true;
}
if ((cur_time - (int)pUser->charbase.levelsept) < 24*60*60)
{
Channel::sendSys(this,
Cmd::INFO_TYPE_FAIL, "现在还不能邀请该玩家");
return true;
}
if(pUser->charbase.country == charbase.country)
{
strncpy(ptCmd->memberName,name,MAX_NAMESIZE);
ptCmd->memberID = id;
pUser->sendCmdToMe(ptCmd,sizeof(Cmd::stAddMemberToSeptCmd));
return true;
}
else
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "他跟你不是一个国家不能邀请他");
}
}
else
{
if (pUser->charbase.septid == charbase.septid)
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "他已经加入本族了,无需再次邀请");
else
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "他已经入会需要他退会才能加入你的家族");
}
}
else
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "等级不够%d不能邀请他进入家族!",JOIN_SEPT_NEED_LEVEL);
}
//}
//else
//{
// Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "距离太远无法邀请");
//}
}
else
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "玩家不在跟前,无法回应邀请");
}
return true;
}
break;
case Cmd::ANSWER_YES:
{
SceneUser *pUser=scene->getUserByID(ptCmd->memberID);
if (pUser)
{
//charbase.septid = pUser->charbase.septid;
//Channel::sendSys(pUser, Cmd::INFO_TYPE_GAME, "%s接受了你的邀请加入了家族",name);
pUser->removeWarRecord(Cmd::SEPT_DARE);
pUser->removeWarRecord(Cmd::SEPT_NPC_DARE);
//pUser->sendNineToMe();
pUser->sendMeToNine();
Cmd::Session::t_addSeptMember_SceneSession send;
send.dwSeptID = pUser->charbase.septid;
send.member.dwCharID = charbase.id; // 会员角色ID
send.member.wdOccupation = charbase.face;
bzero(send.member.aliasname, sizeof(send.member.aliasname));
strncpy(send.member.name,charbase.name,MAX_NAMESIZE); // 会员角色名称
sessionClient->sendCmd(&send, sizeof(send));
}
else
{
Channel::sendSys(this, Cmd::INFO_TYPE_FAIL, "对方已经离开,他放弃了这次邀请");
}
return true;
}
break;
case Cmd::ANSWER_NO:
{
SceneUser *pUser=scene->getUserByID(ptCmd->memberID);
if (pUser)
{
Channel::sendSys(pUser, Cmd::INFO_TYPE_FAIL, "%s不愿意加入家族, 拒绝了你的邀请",name);
}
return true;
}
break;
default:
break;
}
return true;
}
break;
default:
break;
}
return false;
}
源码和C生成liunx文件不一定完全一直但是大致相同!
我不懂,我就来围观的 新手求帮助 搜索16进制搜索不到,求解惑~~~~~~~~~~ 那段源码所在的函数是哪个呢? 没看懂。。。我再仔细瞅瞅{:301_997:} BlueTears 发表于 2023-4-23 09:15
那段源码所在的函数是哪个呢?
SceneUser::doSeptCmd(Cmd::stSeptUserCmd const*,uint) 000000000088713C
在这个函数找到了 奋斗蜗牛 发表于 2023-4-23 10:08
SceneUser::doSeptCmd(Cmd::stSeptUserCmd const*,uint) 000000000088713C
在这个函数找到了
__int64 __fastcall SceneUser::doSeptCmd(SceneUser *this, const Cmd::stSeptUserCmd *a2, int a3, const char *a4)
{
const char *v4; // rcx@8
const char *v5; // rcx@15
const char *v6; // rcx@37
const char *v7; // rcx@38
const char *v8; // rcx@43
const char *v9; // rcx@56
signed int v11; // @1
signed int v12; // @29
signed int v13; // @13
time_t v14; // @43
SceneUser *v15; // @56
Channel *v16; // @60
SceneUser *v17; // @37
char v18; // @25
int v19; // @25
int v20; // @25
__int16 v21; // @25
int v22; // @25
_BYTE v23; // @25
char v24; // @25
int v25; // @25
int v26; // @25
int v27; // @25
int v28; // @25
int v29; // @25
_BYTE v30; // @25
int v31; // @25
int v32; // @25
int v33; // @25
char v34; // @14
char v35; // @13
int v36; // @13
unsigned int v37; // @13
_BYTE v38; // @57
char v39; // @13
__int16 v40; // @13
_BYTE v41; // @57
__int16 v42; // @57
void *v43; // @6
int v44; // @1
const Cmd::stSeptUserCmd *v45; // @1
SceneUser *v46; // @1
v46 = this;
v45 = a2;
v44 = a3;
v11 = *((_BYTE *)a2 + 1);
if ( v11 == 7 )
{
v43 = (void *)v45;
v12 = *((_BYTE *)v45 + 74);
if ( v12 == 1 )
{
v15 = (SceneUser *)Scene::getUserByID(*((Scene **)v46 + 642), *(_DWORD *)((char *)v43 + 38));
if ( v15 )
{
SceneUser::removeWarRecord(v15, 2u, 0);
SceneUser::removeWarRecord(v15, 3u, 0);
SceneUser::sendMeToNine(v15);
Cmd::Session::t_addSeptMember_SceneSession::t_addSeptMember_SceneSession((Cmd::Session::t_addSeptMember_SceneSession *)&v35);
v36 = *((_DWORD *)v15 + 1740);
v37 = *((_DWORD *)v46 + 1713);
v42 = *(_WORD *)((char *)v46 + 6893);
bzero(v41, 0x21uLL);
strncpy(v38, (const char *)v46 + 6856, 0x20uLL);
(*(void (__fastcall **)(zThread *, char *, signed __int64))(*(_QWORD *)sessionClient + 32LL))(
sessionClient,
&v35,
78LL);
}
else
{
Channel::sendSys(v46, (SceneUser *)9, 10005656, v9);
}
v13 = 1;
return (unsigned int)v13;
}
if ( v12 > 1 )
{
if ( v12 == 2 )
{
v16 = (Channel *)Scene::getUserByID(*((Scene **)v46 - 0xFFFFFD7D), *(_DWORD *)((char *)v43 + 38));
if ( v16 )
Channel::sendSys(v16, (SceneUser *)9, 10005688, (const char *)v46 + 16);
v13 = 1;
return (unsigned int)v13;
}
}
else if ( !*((_BYTE *)v45 + 74) )
{
if ( *((_DWORD *)v46 + 1740) )
{
v17 = (SceneUser *)Scene::getUserByName(*((Scene **)v46 + 642), (const char *)v43 + 6);
if ( v17 )
{
if ( !(unsigned __int8)Cmd::isset_state((SceneUser *)((char *)v17 + 6336), (const unsigned __int8 *)0xB) )
{
Channel::sendSys(v46, (SceneUser *)9, 10005380, (const char *)v17 + 16);
v13 = 1;
return (unsigned int)v13;
}
if ( *(_WORD *)((char *)v17 + 6891) <= 0x13u )
{
Channel::sendSys(v46, (SceneUser *)9, 10005592, (const char *)0x14);
}
else if ( *((_DWORD *)v17 + 1740) || *((_DWORD *)v17 + 1738) )
{
if ( *((_DWORD *)v17 + 1740) == *((_DWORD *)v46 + 1740) )
Channel::sendSys(v46, (SceneUser *)9, 10005520, v7);
else
Channel::sendSys(v46, (SceneUser *)9, 10005552, v7);
}
else
{
v14 = time(0LL);
if ( v14 - *(_DWORD *)((char *)v17 + 7150) <= 28799 )
{
Channel::sendSys(
v46,
(SceneUser *)9,
10005408,
(const char *)(28800 - (v14 - *(_DWORD *)((char *)v17 + 7150))));
v13 = 1;
return (unsigned int)v13;
}
if ( v14 - *(_DWORD *)((char *)v17 + 7150) <= 28799 )
{
Channel::sendSys(v46, (SceneUser *)9, 10005463, v8);
v13 = 1;
return (unsigned int)v13;
}
if ( *(_DWORD *)((char *)v17 + 6990) == *(_DWORD *)((char *)v46 + 6990) )
{
strncpy((char *)v43 + 6, (const char *)v46 + 16, 0x20uLL);
*(_DWORD *)((char *)v43 + 38) = *((_DWORD *)v46 + 2);
SceneUser::sendCmdToMe(v17, v43, 0x4Bu);
v13 = 1;
return (unsigned int)v13;
}
Channel::sendSys(v46, (SceneUser *)9, 10005484, v8);
}
}
else
{
Channel::sendSys(v46, (SceneUser *)9, 10005623, v6);
}
v13 = 1;
return (unsigned int)v13;
}
Channel::sendSys(v46, (SceneUser *)9, 10005351, a4);
v13 = 1;
return (unsigned int)v13;
}
v13 = 1;
return (unsigned int)v13;
}
if ( v11 <= 7 )
{
if ( (unsigned int)(v11 - 1) <= 1 )
{
v34 = 1;
if ( *((_DWORD *)v46 + 1740) )
{
v34 = 0;
Channel::sendSys(v46, (SceneUser *)9, 10005324, a4);
}
else
{
v43 = (void *)time(0LL);
if ( (signed __int64)((char *)v43 - *(_DWORD *)((char *)v46 + 7150)) > 28799 )
{
if ( *(_WORD *)((char *)v46 + 6891) <= 0x22u )
{
v34 = 0;
Channel::sendSys(v46, (SceneUser *)9, 10005295, (const char *)0x23);
}
else if ( (unsigned __int8)Packages::checkMoney((SceneUser *)((char *)v46 + 7608), 0x7D0u) )
{
v34 = 1;
}
else
{
v34 = 0;
Channel::sendSys(v46, (SceneUser *)9, 10005256, (const char *)0x7D0);
}
}
else
{
v34 = 0;
Channel::sendSys(v46, (SceneUser *)9, 10005224, v5);
}
}
if ( *((_BYTE *)v45 + 1) != 2 || (v43 = (void *)v45, v34 != 1) )
{
if ( v34 == 1 )
{
Cmd::stSeptStatusCheckCmd::stSeptStatusCheckCmd((Cmd::stSeptStatusCheckCmd *)&v35);
SceneUser::sendCmdToMe(v46, &v35, 6u);
}
v13 = 1;
}
else
{
Cmd::Session::t_addSept_SceneSession::t_addSept_SceneSession((Cmd::Session::t_addSept_SceneSession *)&v18);
v19 = *(_DWORD *)(*((_QWORD *)v46 + 642) + 12LL);
v20 = 0;
strncpy((char *)&v21, (const char *)v43 + 6, 0x20uLL);
v22 = *((_DWORD *)v46 + 1713);
v24 = 0;
v25 = 0;
v26 = 0;
v27 = 1;
v28 = 0;
v29 = 0;
v31 = 0;
v32 = 0;
v33 = 0;
strncpy(v23, (const char *)v46 + 6856, 0x20uLL);
bzero(v30, 0xFFuLL);
(*(void (__fastcall **)(zThread *, char *, signed __int64))(*(_QWORD *)sessionClient + 32LL))(
sessionClient,
&v18,
380LL);
v13 = 1;
}
return (unsigned int)v13;
}
LABEL_64:
v13 = 0;
return (unsigned int)v13;
}
if ( v11 != 17 )
goto LABEL_64;
v43 = (void *)v45;
if ( *(_DWORD *)((char *)v45 + 6) > *(_DWORD *)((char *)v46 + 7105) )
Channel::sendSys(v46, (SceneUser *)9, 10005184, a4);
v4 = (const char *)(*(_DWORD *)((char *)v43 + 6) % 0xAu);
if ( (_DWORD)v4 )
Channel::sendSys(v46, (SceneUser *)9, 10005200, v4);
if ( *(_DWORD *)((char *)v46 + 7105) <= *(_DWORD *)((char *)v43 + 6) )
*(_DWORD *)((char *)v46 + 7105) = 0;
else
*(_DWORD *)((char *)v46 + 7105) -= *(_DWORD *)((char *)v43 + 6);
Cmd::stMainUserDataUserCmd::stMainUserDataUserCmd((Cmd::stMainUserDataUserCmd *)&v39);
SceneUser::full_t_MainUserData(v46, &v40);
SceneUser::sendCmdToMe(v46, &v39, 0x112u);
Cmd::Session::t_OpRepute_SceneSession::t_OpRepute_SceneSession((Cmd::Session::t_OpRepute_SceneSession *)&v35);
v36 = *((_DWORD *)v46 + 1740);
v37 = *(_DWORD *)((char *)v43 + 6) 编辑/注释/输入 0xAu;
(*(void (__fastcall **)(_QWORD, char *, signed __int64))(*(_QWORD *)sessionClient + 32LL))(sessionClient, &v39, 274LL);
v13 = 1;
return (unsigned int)v13;
} 这是找的伪代码。但是我想找到对应的if ((cur_time - charbase.levelsept) < 24*60*60)如何去查询 我有源码但是无法生产,只可以做参考,我给转成16进制去查询liunx生成的C语言运行程序,找到函数了,想修改这段代码 找不到对应的! 或者这么问吧 源码和伪代码的对应关系 ,例如我想查询 if ((cur_time - charbase.levelsept) < 24*60*60) 我查询关键charbase.levelsept 这个,我给转成16进制搜索 还是在伪代码中如何搜索才可以找到!!! if ((cur_time - charbase.levelsept) < 24*60*60)我需要做一些简单的修改,把 24*60*60改成60 但是找不到具体位置