奇迹Mu分析 - 各种主流BT功能实现

逐一给出主流外挂的功能实现,基地址就不提供了!

一、瞬移

这个功能需要分2个步骤

1、发送移动包

2、修正本地画面同步

procedure TGameFunMgr.Move(x,y:Integer; Way:Byte = 0);
type
  _Buffer = Packed record
    _C1:Byte;    //C1
    Len:Byte;
    cmd:byte;    //D7
    x,y:Byte;
    setp:Byte;
  end;
var
  Buffer:_Buffer;
  P:TPoint;
begin
  Role.IsSuperMove :=True;
  p.X:=x;
  p.Y:=y;
  Role.RolePos:=P;

  Buffer._C1:=$C1;
  Buffer.Len:=SizeOf(_Buffer);
  Buffer.cmd:=$D7;
  Buffer.x:=x;
  Buffer.y:=y;
  Buffer.setp:=Way;
  MyEncode(@Buffer,SizeOf(_Buffer));

  pNtGameSend(Buffer,Buffer.Len,0,0);

  //本地画面同步
  P.X:=x * 100 + 50;
  P.Y:=y * 100 + 50;
  Role.MapPos:= P;

end;

二、自动拾取/拾取过滤

服务端有对拾取距离的判断,但是配合瞬移就可以做到秒拾取

实现思路

1、拦截返回包,获取到物品掉落的包

2、解析封包是否需要过滤

3、瞬移+拾取 , 发2个包。(这里的瞬移就不需要同步画面,这样看上去就是远程拾取了)

拾取的实现如下:

procedure TGameFunMgr.PickUp(ItemIndex: Word);
type
  TBuffer = packed Record
    _C1:Byte;    //C1
    BufferCount:Byte;     //1
    Cmd:Byte;    //22
    ItemIndex_h:Byte;
    ItemIndex_l:Byte;
  end;
var
  Buffer:TBuffer;
begin

  Buffer._C1:=$C1;
  Buffer.BufferCount:=SizeOf(TBuffer);
  Buffer.Cmd:=$22;
  Buffer.ItemIndex_h:=ItemIndex shr 8;
  Buffer.ItemIndex_l:=ItemIndex and $FF;
  Buffer.ItemIndex_h:=Buffer.Cmd xor $FE xor Buffer.ItemIndex_h;
  Buffer.ItemIndex_l:=Buffer.ItemIndex_h xor $18 xor Buffer.ItemIndex_l;

  pNtGameSend(Buffer,Buffer.BufferCount,1,0);
end;
返回包的解析:

procedure DropItem(P:Pointer);
type
  _Buffer = Packed record
    Id_h:Byte;
    Id_l:Byte;
    x,y:Byte;
    ResId:Array [0..2] of Byte;
    M_h,M_l:Byte;
    OtherValue:array [0..6] of Byte;
  end;
var
  Count:Byte;
  I,Base:Cardinal;
  Buffer:^_Buffer;
  x,y:Byte;
begin
  Count:=pByte(P)^;
  if Count > 0 then
    begin
      Base:=Cardinal(P)+1;
      for I:= 0 to Count - 1 do
        begin
          Buffer:=Pointer(Base + i * SizeOf(_Buffer));
          Dbgprint('ID:%X POS:%d,%d Money:%d',[
          Buffer.Id_h * $100 + Buffer.Id_l,
          Buffer.x,
          Buffer.y,
          Buffer.M_h * $100 + Buffer.M_l]);
          if Buffer.Id_h = $80 then
            Buffer.Id_h:=0;
          x:=Role.RolePos.x;
          y:=Role.RolePos.y;
          Game.HideMove(Buffer.x,Buffer.y);               //无画面同步瞬移
          Game.PickUp(Buffer.Id_h * $100 + Buffer.Id_l);  
          Game.HideMove(x,y);                             //归位
        end;
    end;
end;

三、吸怪/聚怪/全屏打怪(普通攻击)

这个功能实现有2个方法

方法1:

   1、截取返回包(怪物移动的包)

   2、修改移动包内的坐标,全部改成固定坐标

   3、本地看上去就像吸怪/聚怪效果了,然后角色直接攻击即可

方法2:

    1、获取环境列表(怪的列表)

    2、一个循环对每个怪发送一个攻击包

    3、本地看上去就是周围怪在掉血,即全屏攻击

这个功能代码不提供~


四、多倍攻击/技能更换

这个功能实现效果就是放了个A技能,伤害效果是B技能的。例如:法师放火龙,效果是地狱火的!!

功能思路:

    1、奇迹攻击分为2个包,  ①攻击包 ②命中包

    2、我们只要修改命中包的技能ID即可实现

修改方式:

    1、直接改代码(困难,有CRC)

    2、修改封包,拦截发包,如果是命中包,直接换了技能ID即可

这里提供一个命中包的构造

procedure TGameFunMgr.BeKill(SkillId: Byte; Tar: TWorldNode);
type
  TBuffer = packed Record
    _C1:Byte;    //C1
    BufferCount:Byte;     //1
    Cmd:Byte;    //1D
    skill_h:Byte;
    Count:Byte;
    skill_l:Byte;
    x:Byte;
    way_s:Byte;
    y:Byte;
    tar_h:Byte;
    way_e:Byte;
    tar_l:Byte;
  end;
var
  Buffer:TBuffer;
begin
  Buffer._C1:=$C1;
  Buffer.BufferCount:=SizeOf(TBuffer);
  Buffer.Cmd:=$1D;
  Buffer.skill_h:= SkillId shr 8;
  Buffer.Count:=1;
  Buffer.skill_l:=SkillId and $FF;
  Buffer.x:=Tar.x;
  Buffer.y:=Tar.y;
  Buffer.way_s:=35;
  Buffer.way_e:=0;
  Buffer.tar_h:=Tar.Id shr 8;
  Buffer.tar_l:=Tar.Id and $FF;

  MyEncode(@Buffer,SizeOf(TBuffer));

  pBeSkill(Buffer.skill_h,SizeOf(TBuffer) - 3);
  pNtGameSend(Buffer,SizeOf(TBuffer),1,0);
end;
这个函数还能改造,最后的tar_x的3字节结构,可以支持10个,这就意味着可以同时攻击10个怪,这就是全屏攻击了


五、单体技能群攻效果

这个功能挺方便。

效果:单体的技能释放,可以攻击周围所有怪物

思路:群攻的包内的技能ID改用单体技能ID

给出群攻包的构造

procedure TGameFunMgr.UseRangeSkill(SkillId: Byte; X, Y: Byte);
type
  TBuffer = packed Record
    Head:Byte;  //c1
    BufferCount:Byte;     //1
    Cmd:Byte;    //1E
    x:Byte;
    skill_h:byte;
    y:byte;
    skill_l:byte;
    Def1:Byte;       //??? 0
    Def2:Byte;       //ff
    Def3:Byte;       //00
    Def4:Byte;       //ff
    Def5:Byte;       //00
    Def6:Byte;       //00
  end;
var
  Buffer:TBuffer;
begin
  Buffer.Head:=$C1;
  Buffer.BufferCount:=SizeOf(TBuffer);
  Buffer.Cmd:=$1E;
  Buffer.x:=x;
  Buffer.y:=y;
  Buffer.skill_h:=skillid shr 8;
  Buffer.skill_l:=SkillId and $FF;
  Buffer.Def1:=$9D;
  Buffer.Def2:=$FF;
  Buffer.Def3:=0;
  Buffer.Def4:=$FF;
  Buffer.Def5:=0;
  Buffer.Def6:=0;
  MyEncode(@Buffer,SizeOf(TBuffer));
  //
  pNtGameSend(Buffer,Buffer.BufferCount,1,0);
end;

六、多重攻击(单体技能)

释放1次技能,有最多5次攻击效果

实现方法挺简单,直接在短间隔内连续发送技能包

这里给出单体技能释放包 构造

procedure TGameFunMgr.UseRangeSkill(SkillId: Byte; X, Y: Byte);
type
  TBuffer = packed Record
    Head:Byte;  //c1
    BufferCount:Byte;     //1
    Cmd:Byte;    //1E
    x:Byte;
    skill_h:byte;
    y:byte;
    skill_l:byte;
    Def1:Byte;       //??? 0
    Def2:Byte;       //ff
    Def3:Byte;       //00
    Def4:Byte;       //ff
    Def5:Byte;       //00
    Def6:Byte;       //00
  end;
var
  Buffer:TBuffer;
begin
  Buffer.Head:=$C1;
  Buffer.BufferCount:=SizeOf(TBuffer);
  Buffer.Cmd:=$1E;
  Buffer.x:=x;
  Buffer.y:=y;
  Buffer.skill_h:=skillid shr 8;
  Buffer.skill_l:=SkillId and $FF;
  Buffer.Def1:=$9D;
  Buffer.Def2:=$FF;
  Buffer.Def3:=0;
  Buffer.Def4:=$FF;
  Buffer.Def5:=0;
  Buffer.Def6:=0;
  MyEncode(@Buffer,SizeOf(TBuffer));
  //
  pNtGameSend(Buffer,Buffer.BufferCount,1,0);
end;



你可能感兴趣的:(那些年我们玩过的网游)