WOW开发工具

steak 2天前 92

import win.ui;
/*DSG{{*/
mainForm = win.form(text="wow屬性讀取";right=1248;bottom=667)
mainForm.add(
button={cls="button";text="刷新表";left=95;top=221;right=154;bottom=242;z=21};
button2={cls="button";text="计算rcx偏移";left=1104;top=536;right=1184;bottom=560;z=29};
button3={cls="button";text="求rcx值";left=1104;top=568;right=1184;bottom=592;z=31};
button4={cls="button";text="Button";left=968;top=592;right=1040;bottom=616;z=32};
button5={cls="button";text="取人物选中目标的坐标";left=952;top=624;right=1080;bottom=648;z=33};
button_lu={cls="button";text="录制坐标";left=91;top=344;right=153;bottom=364;z=23};
edit={cls="edit";left=154;top=531;right=535;bottom=659;edge=1;multiline=1;vscroll=1;z=3};
edit2={cls="edit";left=944;top=536;right=1096;bottom=560;edge=1;multiline=1;z=30};
itemlist={cls="listview";left=344;top=698;right=1045;bottom=828;edge=1;gridLines=1;vscroll=1;z=18};
man_bufflist={cls="listview";left=-2;top=366;right=152;bottom=659;edge=1;gridLines=1;z=20};
man_exp={cls="static";text="exp";left=59;top=14;right=134;bottom=28;transparent=1;z=19};
man_face={cls="static";text="face";left=80;top=176;right=158;bottom=192;notify=1;transparent=1;z=2};
man_hp={cls="static";text="hp";left=8;top=31;right=83;bottom=47;notify=1;transparent=1;z=5};
man_level={cls="static";text="level";left=8;top=14;right=49;bottom=31;transparent=1;z=9};
man_money={cls="static";text="money";left=80;top=136;right=165;bottom=155;notify=1;transparent=1;z=4};
man_mp={cls="static";text="mp";left=8;top=48;right=88;bottom=69;notify=1;transparent=1;z=6};
man_st1={cls="static";text="力量";left=8;top=144;right=48;bottom=165;notify=1;transparent=1;z=10};
man_st2={cls="static";text="敏捷";left=8;top=168;right=72;bottom=189;notify=1;transparent=1;z=11};
man_st3={cls="static";text="耐力";left=8;top=184;right=72;bottom=205;notify=1;transparent=1;z=12};
man_st4={cls="static";text="智力";left=8;top=208;right=72;bottom=229;notify=1;transparent=1;z=13};
man_st5={cls="static";text="精神";left=8;top=224;right=72;bottom=245;notify=1;transparent=1;z=14};
man_st6={cls="static";text="护甲";left=8;top=248;right=72;bottom=263;notify=1;transparent=1;z=15};
man_status={cls="static";text="status";left=80;top=152;right=160;bottom=171;notify=1;transparent=1;z=22};
man_x={cls="static";text="x";left=8;top=66;right=72;bottom=81;transparent=1;z=7};
man_y={cls="static";text="y";left=8;top=84;right=72;bottom=99;transparent=1;z=8};
man_z={cls="static";text="z";left=8;top=104;right=120;bottom=119;transparent=1;z=16};
mosterlist={cls="listview";left=1092;top=673;right=1356;bottom=796;edge=1;gridLines=1;vscroll=1;z=17};
pets_bufflist={cls="listview";left=541;top=534;right=936;bottom=659;edge=1;gridLines=1;z=28};
pets_exp={cls="static";text="pets_exp";left=8;top=320;right=150;bottom=339;notify=1;transparent=1;z=27};
pets_hp={cls="static";text="pet_hp";left=8;top=272;right=162;bottom=296;notify=1;transparent=1;z=24};
pets_mp={cls="static";text="pet_mp";left=8;top=288;right=163;bottom=305;notify=1;transparent=1;z=25};
pets_satiation={cls="static";text="satiation";left=8;top=304;right=124;bottom=319;notify=1;transparent=1;z=26};
tab={cls="tab";left=152;top=0;right=1242;bottom=532;db=1;dl=1;dr=1;dt=1;edge=1;z=1}
)
/*}}*/

import process;
import math;
import winex;
import winex.key

//mosterform=mainForm.tab.loadForm(".\moster.aardio")
mosterform=mainForm.tab.add(text="怪物表";right=871;bottom=548;)
mosterform.add(mosterlist={cls="listview";left=2;top=-2;right=874;bottom=549;db=1;dl=1;dr=1;dt=1;edge=1;gridLines=1;z=1})


itemform1=mainForm.tab.add(text="物品表";right=871;bottom=548;)
itemform1.add(listview={cls="listview";left=2;top=-2;right=874;bottom=549;db=1;dl=1;dr=1;dt=1;edge=1;gridLines=1;z=1})
//itemform=mainForm.tab.loadForm(".\item.aardio")
itemform=mainForm.tab.add(text="装备位置表";right=871;bottom=548;)
itemform.add(listview={cls="listview";left=2;top=-2;right=874;bottom=549;db=1;dl=1;dr=1;dt=1;edge=1;gridLines=1;z=1})

otherform=mainForm.tab.add(text="其它表";right=871;bottom=548;)
otherform.add(listview={cls="listview";left=2;top=-2;right=874;bottom=549;db=1;dl=1;dr=1;dt=1;edge=1;gridLines=1;z=1})

zuobiaoform=mainForm.tab.add(text="坐标编辑";right=871;bottom=548;)
zuobiaoform.add(
				button={cls="button";text="添加坐标";left=520;top=64;right=592;bottom=88;z=2};
				button2={cls="button";text="清空";left=520;top=160;right=592;bottom=184;z=3};
				checkbox={cls="checkbox";text="加入寻路坐标";left=528;top=232;right=624;bottom=248;z=5};
				checkbox2={cls="checkbox";text="增加采集坐标";left=528;top=208;right=624;bottom=224;z=6};
				checkbox3={cls="checkbox";text="采点";left=528;top=256;right=624;bottom=272;z=7};
				checkbox4={cls="checkbox";text="加入打怪坐标";left=528;top=280;right=624;bottom=296;z=8};
				checkbox5={cls="checkbox";text="走路";left=528;top=304;right=624;bottom=320;z=9};
				edit={cls="edit";left=0;top=0;right=472;bottom=464;ah=1;aw=1;edge=1;multiline=1;vscroll=1;z=1};
				static={cls="static";text="总数";left=528;top=336;right=592;bottom=352;transparent=1;z=4}				
)


NtdllModuleBase = ::Kernel32.GetModuleHandle("Ntdll.dll")

NtWow64ReadVirtualMemory64=::Ntdll.api("NtWow64ReadVirtualMemory64","pointer(
	pointer ProcessHandle,
	LONG BaseAddress,
	pointer BufferData,
	LONG BufferLength,
	pointer ReturnLength)")
	
NtWow64WriteVirtualMemory64=::Ntdll.api("NtWow64WriteVirtualMemory64","pointer(
	pointer ProcessHandle,
 	LONG BaseAddress,
 	pointer BufferData,
 	LONG BufferLength,
 	pointer ReturnLength)")
 	
NtQueryInformationProcess=::Ntdll.api("NtQueryInformationProcess","pointer(
	pointer ProcessHandle,
	PROCESSINFOCLASS ProcessInformationClass,
	pointer ProcessInformation,
	INT ProcessInformationLength,
	pointer ReturnLength OPTIONAL )" ) 	
 
 	
function Bin2hex (input){
	var len = string.len(input);
	var result = "";
	for(i=1;len;2){
		var now = string.sub(input,i,i+1);
		result = result ++ string.hex(now," ");
	}
	return result; 
}
//16进制字符串转换成字节流 用于modbus发送字符串
function Hex2bin (input){
	var len = string.len(input);
	var result = "";
	for(i=1;len;2){
		var now = string.sub(input,i,i+1);
		result = result ++ string.unhex(now," ");
	}
	return result; 
}
raw.cast = function( ctype,v ) begin

    var union_ctype = {
        union u= {
        byte byte =0;
        BYTE ubyte =0;
        word word =0;
        WORD uvord =0;
        int int =0;
        INT uint =0;
        long long =0;
        LONG ulong =0;
        double double =0;
        float float =0
        }
    }

    return raw.convert( { long x= v },
                        union_ctype
                      ).u[ctype];
                 
end;
namespace raw {
    byte = "byte";
    BYTE = "ubyte";
    word = "word";
    WORD = "uvord";
    int = "int";
    INT = "uint";
    long = "long";
    LONG = "ulong";
    double = "double";
    float = "float"
}
mosterform.mosterlist.insertColumn("序号",40)
mosterform.mosterlist.insertColumn("怪物名",100)
mosterform.mosterlist.insertColumn("x坐标",80)
mosterform.mosterlist.insertColumn("y坐标",80)
mosterform.mosterlist.insertColumn("z坐标",80)//5
mosterform.mosterlist.insertColumn("属性",80)
mosterform.mosterlist.insertColumn("角色基址",80)
mosterform.mosterlist.insertColumn("角色id1",80)
mosterform.mosterlist.insertColumn("角色id2",80)
mosterform.mosterlist.insertColumn("攻擊方向",70)
mosterform.mosterlist.insertColumn("等級",40)//10
mosterform.mosterlist.insertColumn("HP/MAXHP",100)
mosterform.mosterlist.insertColumn("MP/MAXMP",100)
mosterform.mosterlist.insertColumn("面向值",80)

itemform.listview.insertColumn("背包序号",80)
itemform.listview.insertColumn("物品欄位",100)
itemform.listview.insertColumn("ID",250)


itemform1.listview.insertColumn("背包序号",80)
itemform1.listview.insertColumn("類型",80)
itemform1.listview.insertColumn("物品名",100)
itemform1.listview.insertColumn("数量",60)
itemform1.listview.insertColumn("物品基址",90)
itemform1.listview.insertColumn("ID",90)
itemform1.listview.insertColumn("所屬背包ID",90)
itemform1.listview.insertColumn("物品类型",90)
itemform1.listview.insertColumn("包裹格数",90)

otherform.listview.insertColumn("序号",80)
otherform.listview.insertColumn("名稱",200)
otherform.listview.insertColumn("類型",80)
otherform.listview.insertColumn("基址",80)
otherform.listview.insertColumn("ID1",80)
otherform.listview.insertColumn("ID2",80)
otherform.listview.insertColumn("x",80)
otherform.listview.insertColumn("y",80)
otherform.listview.insertColumn("z",80)


mainForm.man_bufflist.insertColumn("人物buff序號",100)
mainForm.man_bufflist.insertColumn("人物buffid",100)

mainForm.pets_bufflist.insertColumn("宠物buff序號",120)
mainForm.pets_bufflist.insertColumn("宠物buffid",120)

//var dll = ..raw.loadDll("\Read64.dll");
dllfile=string.load("\res\Read64.dll")
//string.save("C:\wow.dll",dllfile)
var dll = raw.loadDll(dllfile)//"C:\wow.dll");

Read64=dll.api("Read64","bool(int pid,LONG baseaddress,point buffer,int bufflength)","stdcall")
GetBaseAddress=dll.api("GetBaseAddress","long (int ProcessID, string ExeName)","stdcall")

while(pid==null){
		for processEntry in process.each( "WowClassic.exe" ) { 
			pid=processEntry.th32ProcessID
			
		}
}
class PROCESS_BASIC_INFOMATION{
	int ExotStatus;
	int PebBaseAddress; //peb基址
	int AffintyMask;
	int BasePriority;
	INT UniqueProcessId;
	INT InheriterdFromUniqueProcesssId;//接收父進程ID
	
}
mainForm.edit.print("pid:",pid)
prcs=process(pid);
wowhandle=process.OpenProcess(0x1FFFFF/*_PROCESS_ALL_ACCESS*/,false,pid)
win.delay(1000);	
mainForm.edit.print("find wow process")




func = prcs.asmCdecl(
	"void( INT main)",
	'\x8B\x45\x08', //mov eax, [ebp+0x8]
	'\x6A\x33', //push 0x33
	'\xFF\x50\x25', //call dword [eax+0x25]
	'\x83\x04\x24\x05', //add dword [esp], 0x5
	'\xCB', //retf
	'\xFF\x50\x2F', //call dword [eax+0x2f]
	'\xC7\x44\x24\x04\x23\x00\x00\x00', //mov dword [esp+0x4], 0x23
	'\x83\x04\x24\x0D', //add dword [esp], 0xd
	'\xCB', //retf
) 


//func()


read1=function(address,long){
    if address == false {
        win.msgbox("false")
        return false;
    }     
	var buffer=raw.buffer(long)	
	var ret=Read64(pid,address,buffer,long)
	var aa=""
	if ret {		
		str=raw.tostring(buffer)
		if str=null{
			win.msgbox(raw.copy(buffer,aa,long))
			win.msgbox(buffer[1])
		}
		str=string.reverse(str)
		str=string.hex(str,"")	
				
	}
	else {
		return false; 
	}	
	//raw.realloc(0,buffer) //指針消毀	
	return "0x"++str;  
}
read=function(address,long){
       
	var buffer=raw.buffer(long)	
	var ReturnLength=raw.buffer(4)
	wowhandle=process.OpenProcess(0x1FFFFF/*_PROCESS_ALL_ACCESS*/,false,pid)
	
	NtWow64ReadVirtualMemory64(wowhandle,address,buffer,long,ReturnLength)
	var aa=""
	if buffer!=null {		
		str=raw.tostring(buffer)
		if str=null{
			win.msgbox(raw.copy(buffer,aa,long))
			win.msgbox(buffer[1])
		}
		str=string.reverse(str)
		str=string.hex(str,"")	
				
	}
	else {
		return false; 
	}	
	//raw.realloc(0,buffer) //指針消毀	
	return "0x"++str;  
}
write=function(address,buff){
    if !address return false; 
    var buffer=raw.buffer(buff)
	var ReturnLength=raw.buffer(4)
	//var len = raw.sizeof(buff);
	len=#buff
	raw.
	mainForm.edit.print(len)
	//mainForm.edit.print(raw.tostring(buffer))	
	wowhandle=process.OpenProcess(0x1FFFFF/*_PROCESS_ALL_ACCESS*/,false,pid)	
	NtWow64WriteVirtualMemory64(wowhandle,address,buffer,len,ReturnLength)	
	
}

readname=function(address){
    if address == false return false; 
	var buffer=raw.buffer(60)
	var ReturnLength=raw.buffer(4)	
	//Read64(pid,address,buffer,60)
	
	NtWow64ReadVirtualMemory64(wowhandle,address,buffer,60,ReturnLength)
	return raw.str(buffer,false); 
}
wowhwnd = winex.waitVisible(,,"GxWindowClass")

//===============================================================================================
wowbaseaddress=GetBaseAddress(pid,"WowClassic.exe")
mainForm.edit.print("基址:"++tostring(wowbaseaddress,16))
//人物基址=tostring(read(wowbaseaddress+0xb4acc1-0x4,0x4)+(wowbaseaddress+0xb4acc1),16)
//人物基址=tostring(read(wowbaseaddress+0xb50cc1-0x4,0x4)+(wowbaseaddress+0xb50cc1),16)
人物基址=tostring(read(wowbaseaddress+0xd391e1-0x4,0x4)+(wowbaseaddress+0xd391e1),16)
//===================================================================================================
mainForm.edit.print("人物基址:"+人物基址)
//mainForm.edit.print(read(人物基址,0x4))
//草药学=read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+0x15f0,0x1) //[角色基址+0x10]+0x15f0
草药学=read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+0x1600,0x2) //[角色基址+0x10]+0x15f0		
mainForm.edit.print("草药学等级",tonumber(草药学))
mainForm.setInterval(
	1000,function(){
		// 定时执行参数@2指定的回调函数,参数@1指定间隔毫秒数		
		
		maxhp=tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x13c),0x4)) //[[[人物基址]+200]+10]]]+8e*4-13c
		maxmp=tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x134),0x4)) //[[[人物基址]+200]+10]]]+8e*4-134
		hp=tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x15c),0x4))//[[[人物基址]+200]+10]]]+8e*4-15c
		mp=tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x154),0x4))//[[[人物基址]+200]+10]]]+8e*4-154
		mainForm.man_hp.text="hp:"++hp++"/"++maxhp; 
		mainForm.man_mp.text="mp:"++mp++"/"++maxmp; 
		mainForm.man_level.text="等级:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x104),0x4)) //[[[人物基址]+200]+10]]]+8e*4-104
		mainForm.man_st6.text="护甲:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)),0x4)) //[[[人物基址]+200]+10]]]+8e*4
		mainForm.man_st1.text="力量:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x3c),0x4)) //[[[人物基址]+200]+10]]]+8e*4-3c
		mainForm.man_st2.text="敏捷:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x38),0x4)) //[[[人物基址]+200]+10]]]+8e*4-38
		mainForm.man_st3.text="耐力:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x34),0x4)) //[[[人物基址]+200]+10]]]+8e*4-34
		mainForm.man_st4.text="智力:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x30),0x4)) //[[[人物基址]+200]+10]]]+8e*4-30
		mainForm.man_st5.text="精神:"+tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)-0x2c),0x4)) //[[[人物基址]+200]+10]]]+8e*4-2c
		exp=tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)+0xf78),0x4)) //[[[人物基址]+200]+10]]]+8e*4+f78
		mainForm.man_exp.text="exp:"++exp++"/"++tonumber(read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+((0x8e*4)+0xf7c),0x4)) //[[[人物基址]+200]+10]]]+8e*4+f7c
		man_x=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1600,0x4))) //[[[人物基址]+200]+0x1600
		man_y=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1604,0x4))) //[[[人物基址]+200]+0x1604
		man_z=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1608,0x4))) //[[[人物基址]+200]+0x1608
		man_face=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1610,0x4))) //[[[人物基址]+200]+0x1608
		mainForm.man_x.text="x:"++man_x
		mainForm.man_y.text="y:"++man_y
		mainForm.man_z.text="z:"++man_z
		mainForm.man_face.text="face:"++man_face
		man_status=read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+0x174,0x4)
		select(tostring(man_status,16)) {
			case "0x00000408" {
				mainForm.man_status.text="拾物中"
				status=1
			}
			case "0x00080008" {
				mainForm.man_status.text="遠戰中"
				status=2				
			}
			case "0x00080808" {
				mainForm.man_status.text="近戰中"
				status=3
			}
			case "0x00040008" {
				mainForm.man_status.text="死亡中"
				status=4
			}
			case "0x00000008" {
				mainForm.man_status.text="正常中"
				status=5				
			}
			else {
				mainForm.man_status.text=man_status
			}
		}
		
		
		skillnum=0
		mainForm.man_bufflist.clear()
		while(true){			
			ret=read(read(read(人物基址,0x4)+0x200,0x4)+skillnum*0x8+0x7954,0x1)//[[[人物基址]+200]+skillnum*0x8+0x7954]
			if ret!=0x90 {
				line=mainForm.man_bufflist.addItem(tonumber(ret),1)
				skill=read(read(read(人物基址,0x4)+0x200,0x4)+skillnum*0x8+0x7954+0x4,0x4)
				mainForm.man_bufflist.setItemText(skill,line,2)
			}	
			skillnum++
			if skillnum >= 0x90 break ;
		}
		
	}
);
/*
import time.performance;
mainForm.setInterval( 
	500,function(){
		if status==5 and shiwu==true {
			//winex.key.click(wowhwnd,"C" )
			//shiwu=false			
		}
		elseif status==2 {//遠戰中
			war=true
			winex.key.click(wowhwnd,"4" )			
			//win.delay(500)
		}
		elseif status==3 {//近戰中
			war=true
			if maxhp*0.2<mp {
				winex.key.click(wowhwnd,"2" )
			}				
			winex.key.click(wowhwnd,"1" )	
		}
		elseif status==5 and war=true {
			if maxhp*0.5<mp {
				winex.key.click(wowhwnd,"5" )	
			}
			else {
				winex.key.click(wowhwnd,"3" )
			}
			
			
			//shiwu=true
		}
			
			
	} 
)
*/
timer1=mainForm.setInterval( 
	2000,function(){
		getitemsize()
		getmoster()
		getother()
		getitem()
	} 
)

getmoster=function(){
	num=0x1 //枚舉范圍 1~1ff
	mosterform.mosterlist.clear()
	mosterform.mosterlist.redraw()
	while(true){
    	//[[[人物基址]+30]+((num+num*2)*8)+10]
    		
		var rax=read(read(人物基址,0x4)+0x30,0x4)
		//mainForm.edit.print(tostring(rax,16))
		var rdx=rax+((num+num*2)*8)+0x10
		//mainForm.edit.print(tostring(rdx,16))
		rdx=read(rdx,0x4)
		if rdx != false  {
			//讀取類型
			attributes=read(rdx+0x20,0x1)			
			attributes1=read(rdx+0x21,0x1)
			//if attributes=="0x07" win.msgbox(attributes)
			if attributes!= false and (attributes==0x05 or attributes==0x06 or attributes=0x07){
								
				//取环境NPC坐标
				x=read(read(rdx+0x198,0x4)+0x20,0x4)//[[角色基址+0x198]+0x20			
				y=read(read(rdx+0x198,0x4)+0x24,0x4)//[[角色基址+0x198]+0x24				
				z=read(read(rdx+0x198,0x4)+0x28,0x4)//[[角色基址+0x198]+0x28
				face=read(read(rdx+0x198,0x4)+0x30,0x4)//[[角色基址+0x198]+0x34					
				x=raw.cast(raw.float,x)
				y=raw.cast(raw.float,y)
				z=raw.cast(raw.float,z)
				face=raw.cast(raw.float,face)					
				//讀取等級
				level=tonumber(read(read(rdx+0x10,0x4)+0x134,0x1))//[[角色基址+0x10]+0x134
					
				//讀取血量 			
				var mosterhp=tonumber(read(read(rdx+0x10,0x4)+0xdc,0x4))//[[角色基址+0x10]+0xdc
				var mostermaxhp=tonumber(read(read(rdx+0x10,0x4)+0xfc,0x4))//[[角色基址+0x10]+0xfc
				
				//讀取MP			
				var mostermp=tonumber(read(read(rdx+0x10,0x4)+0xe4,0x4))//[[角色基址+0x10]+0xe4
				var mostermaxmp=tonumber(read(read(rdx+0x10,0x4)+0x104,0x4))//[[角色基址+0x10]+0x104
				
				
				//attributes1=tostring(read(read(rdx+0x10,0x4)+0xd3,0x1),16)
				
				//讀取ID
				var mosterid=read(rdx+0x58,0x4)
				mosterid2=read(rdx+0x60,0x4)
				//if attributes==0x7 win.msgbox(attributes,mosterid)
				//attributes2=tostring(read(read(rdx+0x10,0x4)+0x134,0x1),16)
				if tonumber(mosterid)>0 and (tonumber(mosterid2)>0 or attributes==0x7 or attributes==0x6) {
							
					line=mosterform.mosterlist.addItem()
					mosterform.mosterlist.setItemText(tostring(num,16),line,1)
					if attributes==0x7 {
						x=man_x
						y=man_y
						z=man_z
					}	
					mosterform.mosterlist.setItemText(x,line,3)
					mosterform.mosterlist.setItemText(y,line,4)
					mosterform.mosterlist.setItemText(z,line,5)
					mosterform.mosterlist.setItemText(tostring(rdx,16),line,7)//baseaddr						
					mosterform.mosterlist.setItemText(tostring(mosterid,16),line,8)
					mosterform.mosterlist.setItemText(tostring(mosterid2,16),line,9)		
					mosterform.mosterlist.setItemText(level,line,11)
					mosterform.mosterlist.setItemText(mosterhp++"/"++mostermaxhp,line,12)
					mosterform.mosterlist.setItemText(mostermp++"/"++mostermaxmp,line,13)
					mosterform.mosterlist.setItemText(face,line,14)							
					
					select(attributes) {
						case "0x05" {
							/*															
							if attributes1 == 0x2 {
								mosterform.mosterlist.setItemText("怪物	"++attributes1,line,6)
							}
							elseif attributes1 == 0x1 or attributes1 == 0x0  {
								mosterform.mosterlist.setItemText("NPC	"++attributes1,line,6)
							}
							*/
							man_id=read(read(read(人物基址,0x4)+0x200,0x4)+0x58,0x4)
							mosterform.mosterlist.setItemText("怪物	"++attributes1,line,6)
							//mainForm.edit.print(man_id)	
							if read(read(rdx+0x10,0x4)+0x5c,0x4)==man_id {
								pets_id=read(read(rdx+0x10,0x4)+0x0,0x4)
								pets_satiation=tonumber(read(read(rdx+0x10,0x4)+0xf0,0x4))
								pets_level=tonumber(read(read(rdx+0x10,0x4)+0x134,0x4))
								pets_exp=tonumber(read(read(rdx+0x10,0x4)+0x1c8,0x4))
								pets_exp_max=tonumber(read(read(rdx+0x10,0x4)+0x1cc,0x4))
								pets_hp=tonumber(read(read(rdx+0x10,0x4)+0xdc,0x4))
								pets_hp_max=tonumber(read(read(rdx+0x10,0x4)+0xfc,0x4))
								pets_mp=tonumber(read(read(rdx+0x10,0x4)+0xe4,0x4))
								pets_mp_max=tonumber(read(read(rdx+0x10,0x4)+0x104,0x4))
								
								mainForm.pets_hp.text="pets_hp :"++pets_hp++"/"++pets_hp_max
								mainForm.pets_mp.text="pets_mp :"++pets_mp++"/"++pets_mp_max
								mainForm.pets_exp.text="pets_exp :"++pets_exp++"/"++pets_exp_max
								mainForm.pets_satiation.text="飽食度 :"++pets_satiation
								//mainForm.edit.print("宠物基址: "++rdx)
								//mainForm.edit.print("宠物id: "++pets_id)
								mosterform.mosterlist.setItemText("寵物	"++attributes1,line,6)
								skillnum=0
								mainForm.pets_bufflist.clear()
								while(true){			
									ret=read(rdx+skillnum*0x8+0x7954,0x1)//[[[人物基址]+200]+skillnum*0x8+0x7954]
									if ret!=0x90 {
										line=mainForm.pets_bufflist.addItem(tonumber(ret),1)
										skill=read(rdx+skillnum*0x8+0x7954+0x4,0x4)
										mainForm.pets_bufflist.setItemText(skill,line,2)
									}	
									skillnum++
									if skillnum >= 0x90 break ;
								}
							}
							elseif read(read(rdx+0x10,0x4)+0x5c,0x4)!=0{
								mosterform.mosterlist.setItemText("玩家寵物	"++attributes1,line,6)
							}	 							
						}
						case "0x06" {
							if attributes1=0x6{
								mosterform.mosterlist.setItemText("玩家	"++attributes1,line,6)
							}
						}
						case "0x07" {
							if tostring(read(rdx+0x21,0x1),16)=0x7{
								mosterform.mosterlist.setItemText("自已	"++attributes1,line,6)
								//mainForm.edit.print("角色基址:"++tostring(rdx,16))
							}
						}
						case "0x01" {
							mosterform.mosterlist.setItemText("背包	"++attributes1,line,6)
						}
						case "0x02"{
							mosterform.mosterlist.setItemText("包裹	"++attributes1,line,6)
						}
						case "0x08"{
							mosterform.mosterlist.setItemText("鱼漂	"++attributes1,line,6)
						}
						else {
							mosterform.mosterlist.setItemText("未知类型"++attributes++attributes1,line,6)
						}
							
					}	
					
					//名字讀取的2個方式 
					var per=read(rdx+0x17b8,0x4)
					if  per !=false and per !=0{
						var name1=readname(read(per+0x120,0x4))	
						if name1!=false {								
							mosterform.mosterlist.setItemText(name1,line,2)
						}
						var name2=readname(read(per+0xe0,0x4))
						if  name2 !=false {				
							mosterform.mosterlist.setItemText(name2,line,2)
						}
					}
					man_x=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1600,0x4))) //[[[人物基址]+200]+0x1600
					man_y=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1604,0x4))) //[[[人物基址]+200]+0x1604						
					man_face=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1610,0x4))) //[[[人物基址]+200]+0x1608
					if man_x-x !=0 { //自已坐標就為0
						jiao=math.atan((y-man_y)/(x-man_x))//反正切函数													
						if x-man_x < 0 and y-man_y > 0  { //第2象限
							jiao=math.rad(180)-jiao
						}
						elseif x-man_x < 0 and y-man_y < 0 {//第3象限
							jiao=math.rad(180)+jiao
						}
						elseif x-man_x > 0 and y-man_y < 0{//第4象限
							//jiao=math.rad(360)-jiao
						}
							
						jiao=math.abs(jiao) //絕對值
						//jiao=math.deg(jiao)							
						mosterform.mosterlist.setItemText(jiao,line,10)
					}							
					} 
				}		
			}		
			num++
			if num>0x4ff break ;
		}
}

getitemsize=function(){
	rdx=read(read(人物基址,0x4)+0x200,0x4)
	itemcount=read(rdx+0x20f98,0x4)
	for(i=itemcount;1;-1){
		//mainForm.edit.print(read(itemtab+i*0x10,0x10))
		
		itemform.listview.addItem()
		itemform.listview.setItemText(tostring(i,16),i,1)
		itemtab=read(rdx+0x20fa0,0x4)
		itemid=read(itemtab+i*0x10,0x4)
		select(i) {
			case 3 {
				itemform.listview.setItemText("衬衣",i,2)
			}
			case 4 {
				itemform.listview.setItemText("胸部",i,2)
			}
			case 5 {
				itemform.listview.setItemText("腰部",i,2)
			}
			case 6 {
				itemform.listview.setItemText("腿部",i,2)
			}
			case 7 {
				itemform.listview.setItemText("脚",i,2)
			}
			case 8 {
				itemform.listview.setItemText("手腕",i,2)
			}
			case 9 {
				itemform.listview.setItemText("手",i,2)
			}
			case 14 {
				itemform.listview.setItemText("背部",i,2)
			}
			case 15 {
				itemform.listview.setItemText("主手",i,2)
			}
			case 16 {
				itemform.listview.setItemText("副手",i,2)
			}
			case 17 {
				itemform.listview.setItemText("远程",i,2)
			}
			case 19 {
				itemform.listview.setItemText("背包栏第四格",i,2)
			}
			case 20 {
				itemform.listview.setItemText("背包栏第三格",i,2)
			}
			case 21 {
				itemform.listview.setItemText("背包栏第二格",i,2)
			}
			case 22 {
				itemform.listview.setItemText("背包栏第一格",i,2)
			}
			case 23 {
				itemform.listview.setItemText("大背包第1格",i,2)
			}
			case 24 {
				itemform.listview.setItemText("大背包第2格",i,2)
			}
			case 25 {
				itemform.listview.setItemText("大背包第3格",i,2)
			}
			case 26 {
				itemform.listview.setItemText("大背包第4格",i,2)
			}
			case 27 {
				itemform.listview.setItemText("大背包第5格",i,2)
			}
			case 28 {
				itemform.listview.setItemText("大背包第6格",i,2)
			}
			case 29 {
				itemform.listview.setItemText("大背包第7格",i,2)
			}
			case 30 {
				itemform.listview.setItemText("大背包第8格",i,2)
			}
			case 31 {
				itemform.listview.setItemText("大背包第9格",i,2)
			}
			case 32 {
				itemform.listview.setItemText("大背包第10格",i,2)
			}
			case 33 {
				itemform.listview.setItemText("大背包第11格",i,2)
			}
			case 34 {
				itemform.listview.setItemText("大背包第12格",i,2)
			}
			case 35 {
				itemform.listview.setItemText("大背包第13格",i,2)
			}
			case 36 {
				itemform.listview.setItemText("大背包第14格",i,2)
			}
			case 37 {
				itemform.listview.setItemText("大背包第15格",i,2)
			}
			case 38 {
				itemform.listview.setItemText("大背包第16格",i,2)
			}				
		}
		if tonumber(itemid)!=0{
			itemform.listview.setItemText(itemid,i,3)	
		}		
		else {
			itemform.listview.setItemText("空物品栏",i,3)	
		}
	}
}

	man_id=read(read(人物基址,0x4)+0x200+0x58,0x4)
	mainForm.edit.print("角色基址:"++read(read(人物基址,0x4)+0x200,0x4))
	//物品總數 [[141a3fb48]+0x200]+20f98
	
	rdx=read(read(人物基址,0x4)+0x200,0x4)
	money=read(read(rdx+0x10,0x4)+0x11a8,0x4)//金幣[[角色基址+10]+11a8]
	mainForm.man_money.text="金幣:"+tonumber(money)
	itemcount=read(rdx+0x20f98,0x4)
	//裝備列表 [[[141a3fb48]+0x200]+20fa0]
	itemtab=read(rdx+0x20fa0,0x4)
	mainForm.edit.print("itemcount: "++itemcount)
	mainForm.edit.print("itemtab: "++itemtab)
	
	//取物品枚舉
	//[[[141a3fb48]+30]+((rdx+rdx*2)*8)+10]
	/*itemnum=0x73
	for(i=1;itemcount;1){
		rdx=read(read(人物基址,0x4)+0x30,0x4)
		mainForm.edit.print("物品指針: "++read((rdx+(i+i*2)*0x8)+0x10,0x4))
		rdx=read((rdx+(i+i*2)*0x8)+0x10,0x4)	
	
	}
	*/
getother=function(){
	num=0x1 //枚舉范圍 1~1ff
	otherform.listview.clear()
	otherform.listview.redraw()
	while(true){
		rax=read(read(人物基址,0x4)+0x30,0x4)		
		rdx=rax+((num+num*2)*8)+0x10		
		rdx=read(rdx,0x4)		
		if rdx != false  {
			attributes=tostring(read(rdx+0x20,0x1),16)
			attributes1=tostring(read(rdx+0x21,0x1),16)
			if attributes!= false and (attributes==0x08 and attributes1==0x08 ){
				name=readname(read(read(rdx+0x478,0x4)+0xe0,0x4)) //[[物品基址+478]+e0]
				x=read(rdx+0x4b0,0x4) //[物品基址+4b0]
				y=read(rdx+0x4b4,0x4) //[物品基址+4b4]
				z=read(rdx+0x4b8,0x4) //[物品基址+4b8]
				x=raw.cast(raw.float,x)
				y=raw.cast(raw.float,y)
				z=raw.cast(raw.float,z)
				otherid=read(rdx+0x58,0x4)
				line=otherform.listview.addItem()
				otherform.listview.setItemText(num,line,1)
				otherform.listview.setItemText(name,line,2)
				otherform.listview.setItemText(attributes++" "++attributes1,line,3)
				otherform.listview.setItemText(tostring(rdx,16),line,4)//baseaddr
				otherform.listview.setItemText(otherid,line,5)				
				otherform.listview.setItemText(x,line,7)
				otherform.listview.setItemText(y,line,8)
				otherform.listview.setItemText(z,line,9)
					
			}	
		}
		num++
		if num>0x1ff break ;
	}	
}	

getitem=function(){
	num=0x1 //枚舉范圍 1~1ff
	itemform1.listview.clear()
	itemform1.listview.redraw()
	while(true){
		rax=read(read(人物基址,0x4)+0x30,0x4)		
		rdx=rax+((num+num*2)*8)+0x10		
		rdx=read(rdx,0x4)		
		if rdx != false  {
			attributes=tostring(read(rdx+0x20,0x1),16)
			attributes1=tostring(read(rdx+0x21,0x1),16)
			if attributes!= false and ((attributes==0x01 and attributes1==0x01) or (attributes==0x02 and attributes1==0x02)){
				shu=read(read(rdx+0x10,0x4)+0x5c,0x4)
				name=readname(read(read(rdx+0x478,0x4)+0xe0,0x4))
				itemid=read(rdx+0x58,0x4)
				itemid2=read(read(rdx+0x10,0x4)+0x2c,0x4)
				itemtype=read(read(rdx+0x10,0x4)+0x10,0x4)
				line=itemform1.listview.addItem()
				itemform1.listview.setItemText(num,line,1)
				if attributes==0x01 and attributes1==0x01 {
					itemform1.listview.setItemText("道具 "++attributes++" "++attributes1,line,2)
				}
				elseif(attributes==0x02 and attributes1==0x02){
					itemform1.listview.setItemText("包裹 "++attributes++" "++attributes1,line,2)
					bagcount=read(read(rdx+0x10,0x4)+0x380,0x4)	
					itemform1.listview.setItemText(bagcount,line,9)	//包裹数目				
				}
					
				itemform1.listview.setItemText(name,line,3)
				itemform1.listview.setItemText(tonumber(shu),line,4)//數量
				
				itemform1.listview.setItemText(tostring(rdx,16),line,5)//baseaddr				
				itemform1.listview.setItemText(itemid,line,6)
				itemform1.listview.setItemText(itemid2,line,7)	
				itemform1.listview.setItemText(itemtype,line,8)
				
					
			}	
		}
		num++
		if num>0x1ff break ;
	}	
}
	
//取环境NPC坐标
//x=[[[[人物基址]+0x30]+(0x44+0x44*2)*8+0x10]+0x198]+0x20
//y=[[[[人物基址]+0x30]+(0x44+0x44*2)*8+0x10]+0x198]+0x24
//z=[[[[人物基址]+0x30]+(0x44+0x44*2)*8+0x10]+0x198]+0x28
/* 	
class TokenPrivileges  { 0 }; 	
//t=raw.convert(TokenPrivileges)

OpenProcessToken=::Kernel32.api("OpenProcessToken","Bool(point handle,struct desired , point tokenhandle)" )
Advapi32=raw.loadDll("Advapi32.dll")

LookupPrivilegeValue=Advapi32.api("LookupPrivilegeValue","int(ustring lpSystemName,ustring lpName,point& lpLuid)");

ret=LookupPrivilegeValue(null,"SeDebugPrivilege",topointer("v1"))
OpenProcessToken(process.getHandle(),t,null)

	aa=raw.realloc(1)
	//dd=raw.realloc(20)
	
	ReturnLength=raw.realloc(1)
	
	NtWow64ReadVirtualMemory64(prcs.handle,0x0000000036C55215,aa,1,ReturnLength)
	mainForm.edit.print(aa,ret)
/*
for( addr,len,str,i,j,pattern,protect,mtype
		in prcs.eachQuery(  , ,eval("'"+str+"'"),0x0 
		) 
		){
		mainForm.edit.print("基址",tostring(addr-0x1000,16),"長度",tostring(len,16))
		mainForm.edit.print("找到的代碼地址",tostring(addr+i-1,16))
		address=addr+i-1+offaddr
		baseaddr=addr-0x1000
}
*/

mainForm.onClose = function(hwnd,message,wParam,lParam){
    //fsys.delete("c:\wow.dll")
}

mainForm.button.oncommand = function(id,event){
	if mainForm.button.text=="刷新表" {
		mainForm.changeInterval(timer1,20000000);
		mainForm.button.text="停止刷新";
	}	
	elseif mainForm.button.text=="停止刷新"{
		mainForm.changeInterval(timer1,2000);
		mainForm.button.text="刷新表";
	}
		
}



mainForm.tab.onnotify = function(id,code,ptr){
	
}

mainForm.button_lu.oncommand = function(id,event){
	import fsys.ini;
	ini=fsys.ini("..\跑图路线.INI")
	//path=ini.readKeys("路线")	
	path=ini.getSection("路线")
	var num=tonumber(ini.read("路线","点数"))	

	//num=tonumber(path.点数)		
	//mainForm.edit.print(#num,type(num))
	if num==null{
		//win.msgbox("1")
		//mainForm.edit.print(num)
		num=0;		
		ini.write("路线","点数","0")		
	}
	else {
		//win.msgbox("2")		
		num=num+1
		ini.write("路线","点数",num)
	}		
	
	ini.write("路线","点"+num,math.round(man_x)++","++math.round(man_y)++","++math.round(man_z))		
			
}

mainForm.button2.oncommand = function(id,event){
	var aa=mainForm.edit2.text
	aa=tonumber("0x"+aa)
	mainForm.edit2.text=tostring(aa-wowbaseaddress,16)
}

mainForm.button3.oncommand = function(id,event){
	var aa=mainForm.edit2.text
	aa=tonumber("0x"+aa)
	mainForm.edit2.text=tostring(aa+wowbaseaddress,16)
	//mainForm.edit2.text=string.reverse(string.replace(tostring(aa+wowbaseaddress,16),"0x",""))
}
zuobiao=0
zuobiaoform.button.oncommand = function(id,event){
    
	//zuobiaoform.edit.print("MoveTo("++math.round(man_x,2)++","++math.round(man_y,2)++","++math.round(man_z,2)++")")	
	//zuobiaoform.edit.print(string.format("%.2f",-4335.255654 ))
	//zuobiaoform.edit.print(string.format("%i",-4335.258654 ))
	if zuobiaoform.checkbox.checked {
		zuobiaoform.edit.print("加入寻路坐标("++string.format("%.2f",man_x)++","++string.format("%.2f",man_y)++","++string.format("%.2f",man_z)++")")
	}
	elseif zuobiaoform.checkbox2.checked {
		zuobiaoform.edit.print("增加采集坐标("++string.format("%.2f",man_x)++","++string.format("%.2f",man_y)++","++string.format("%.2f",man_z)++")")
	}
	elseif zuobiaoform.checkbox3.checked {
		//zuobiaoform.edit.print("[路径]")
		zuobiaoform.edit.print("点"++zuobiao++"="++string.format("%.2f",man_x)++","++string.format("%.2f",man_y)++","++string.format("%.2f",man_z))
	}	
	elseif zuobiaoform.checkbox4.checked {
		zuobiaoform.edit.print("加入打怪坐标("++string.format("%.2f",man_x)++","++string.format("%.2f",man_y)++","++string.format("%.2f",man_z)++")")
	}
	elseif zuobiaoform.checkbox5.checked {
		zuobiaoform.edit.print("走路("++string.format("%.2f",man_x)++","++string.format("%.2f",man_y)++","++string.format("%.2f",man_z)++")")
	}	
	zuobiao++
	zuobiaoform.static.text="总数"++zuobiao	
}
zuobiaoform.button2.oncommand = function(id,event){
	zuobiaoform.edit.text=""
	zuobiaoform.static.text="总数"++0
	zuobiao=0	
}

mainForm.button4.oncommand = function(id,event){
	var man_x=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1600,0x4))) //[[[人物基址]+200]+0x1600	
	var man_y=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1604,0x4))) //[[[人物基址]+200]+0x1604
	var man_z=raw.cast(raw.float,(read(read(read(人物基址,0x4)+0x200,0x4)+0x1608,0x4))) //[[[人物基址]+200]+0x1608
	var xaddress=string.format("%x",read(read(人物基址,0x4)+0x200,0x4)+0x1600)
	var yaddress=string.format("%x",read(read(人物基址,0x4)+0x200,0x4)+0x1604)
	var zaddress=string.format("%x",read(read(人物基址,0x4)+0x200,0x4)+0x1608)
	mainForm.edit.print(xaddress,yaddress,zaddress)
	
	
	mainForm.edit.print(chage(man_x),chage(man_y),chage(man_z))
	write(xaddress,chage(man_x))
	//write(0x40366cbc,0x0000ffff)
}
chage= function(num){
	var floatX = raw.convert( {float n=num},{int x}).x
	floatX=string.format("%x",floatX )
	return floatX; 
}

mainForm.button5.oncommand = function(id,event){
	目标ID1=read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+0x9c,0x4)
	目标ID2=read(read(read(read(人物基址,0x4)+0x200,0x4)+0x10,0x4)+0xA4,0x4)
	ss=mosterform.mosterlist.count
	for(i=1;ss;1){
		if 目标ID1==mosterform.mosterlist.getItemText(i,8) and 目标ID2==mosterform.mosterlist.getItemText(i,9){			
			mainForm.edit.print("名字:",mosterform.mosterlist.getItemText(i,2))	
			mainForm.edit.print("x:",mosterform.mosterlist.getItemText(i,3))	
			mainForm.edit.print("y:",mosterform.mosterlist.getItemText(i,4))	
			mainForm.edit.print("z:",mosterform.mosterlist.getItemText(i,5))	
		}
	}
	
}

mainForm.show();

return win.loopMessage();


最新回复 (0)
返回
发新帖