台服dnf吧 关注:117,764贴子:1,870,967
  • 1回复贴,共1
alloc(new,1024)
label(lop)
label(state)
label(getstate)
label(next)
label(end)
new:
pushad
mov eax,[1AB7CDC]//人物基址
mov eax,[eax+b8]//进图判断
cmp eax,0
je end
mov eax,[1AB7CDC]//人物基址
add eax,18c//18C x坐标偏移
mov [1800100],eax //x坐标
add eax,4//190 y坐标
mov [1800104],eax //y坐标
mov eax,[1AB7CDC]//人物基址
mov eax,[eax+b8]//
mov eax,[eax+b0]// eax 里为首地址
lop:
mov ebx,[eax]
mov ebx,[ebx+90]//obj类型
cmp ebx,#273//APC
je state
cmp ebx,#529//怪物
je state
cmp ebx,#289//物品
je state
jmp next
state:
mov ecx,[eax]
mov ebx,[ecx+644]//阵营
cmp ebx,0
jne getstate
jmp next
getstate: //吸
mov ecx,[eax]
mov ebx,[ecx+a8]//基址+a8
add ebx,c//基址+A8+C x坐标
mov ecx,[1800100]
mov ecx,[ecx]
mov [ebx],ecx
add ebx,4//基址+A8+10 y坐标
mov ecx,[1800104]
mov ecx,[ecx]
mov [ebx],ecx
next:
add eax,4
mov ebx,[1AB7CDC]//人物基址
mov ebx,[ebx+b8]//
mov ebx,[ebx+b4]//
cmp eax,ebx //判断
jne lop
mov cx,ffff
end:
dec cx
cmp cx,0
jne end
popad
cmp [1800108],1
jne new
ret
[ENABLE]
1800108:
dd 0
CreateThread(new)
[DISABLE]
dealloc(new)
1800108:
dd 1


IP属地:新疆1楼2025-01-16 00:29回复
    alloc(newmem,2048)
    alloc(NO_OFF,10)
    alloc(X,10)
    registersymbol(X)
    alloc(Y,10)
    registersymbol(Y)
    label(code)
    label(start)
    label(exit)
    label(next)
    newmem:
    pushad
    mov ebp,esp
    sub esp,8
    mov eax,[1AB7CDC]
    cmp [eax+b8],0//进图判断
    je exit
    mov eax,[1AB7CDC]//人物基址
    add eax,18c//18C x坐标偏移
    mov [X],eax //x坐标
    add eax,4//190 y坐标
    mov [Y],eax //y坐标
    mov eax,[1AB7CDC]//人物基址
    mov eax,[eax+b8]//
    mov ebx,[eax+b0]
    mov [ebp-4],ebx//开头单位指针,此指针每次循环都+4
    mov ebx,[eax+b4]
    sub ebx,4
    mov [ebp-8],ebx//结束单位指针
    //开始循环遍历地图各单位
    start:
    mov ebx,[ebp-4]
    mov ecx,[ebx]
    cmp [ecx+644],0//判断阵营,跳过自己人
    je next
    cmp [ecx+90],#289//物品
    je code
    cmp [ecx+90],#529//怪物
    je code
    cmp [ecx+90],#273//apc
    je code
    jne next
    //可以开始进行自己对单位的操作了
    code:
    pushad
    mov edx,[ecx+a8]//怪物基址+a8
    add edx,c//基址+A8+C x坐标
    mov ecx,[X]
    mov ecx,[ecx]
    mov [edx],ecx
    add edx,4//基址+A8+10 y坐标
    mov ecx,[Y]
    mov ecx,[ecx]
    mov [edx],ecx
    popad
    //进入下一次循环
    next:
    cmp ebx,[ebp-8]
    je exit
    add [ebp-4],4
    jmp start
    exit:
    mov esp,ebp
    //push #200
    //call sleep //延迟函数当下段用
    cmp [NO_OFF],#1//判断开关
    jne @f
    jmp newmem
    @@:
    popad
    ret
    [ENABLE]
    NO_OFF:
    dd #1
    CREATETHREAD(newmem)
    [DISABLE]
    NO_OFF:
    dd #0


    IP属地:新疆6楼2025-01-19 02:34
    回复