import win.ui; import process;
//以下自动生成,不用看. /*DSG{{*/ var winform = ..win.form(text="AAuto Form";right=215;bottom=95) winform.add( button={cls="button";text="修改";left=120;top=16;right=205;bottom=57;z=1}; edit1={cls="edit";text="9";left=48;top=16;right=106;bottom=33;edge=1;num=1;tabstop=1;z=3}; edit2={cls="edit";text="7";left=48;top=40;right=104;bottom=56;edge=1;num=1;tabstop=1;z=5}; label1={cls="static";left=112;top=64;right=207;bottom=87;ah=1;aw=1;transparent=1;z=6}; static={cls="static";text="血量:";left=16;top=16;right=53;bottom=32;ah=1;aw=1;transparent=1;z=2}; static2={cls="static";text="魔力:";left=16;top=40;right=56;bottom=56;ah=1;aw=1;transparent=1;z=4} ) /*}}*/
//以上自动生成,不用看. winform.button.oncommand = function(id,event){ //winform.msgbox( winform.button.text );//这句也是自动生成的. myproce = process.find("CallExercise1.0.exe")//要修改的程序名. if (myproce) { baseAdress = myproce.readNumber(0x40315c)//0x40315c是游戏的基址,用cheatengine查的. myproce.writeNumber(baseAdress,winform.edit1.text) myproce.writeNumber(baseAdress+0x8,winform.edit2.text)//0x8是偏移. } else { win.msgbox("没有运行","提示") } } winform.show() win.loopMessage();
原文:http://www.cnblogs.com/jhcla/p/3872844.html