--require("COM"); COM={}; function COM.normStr(s) if string.len(s)<8 then s=string.format("%s%s",string.rep("0",8-string.len(s)),s); end; s=string.upper(s); s=string.gsub(s,"%s+",""); return s; end function COM.InstallMenu(mnis,main,need,cb) local mi,s,mpos; mpos=menuItem_getCount(mnis); for i=0,menuItem_getCount(mnis)-1 do mi=menuItem_getItem(mnis, i); s=menuItem_getCaption(mi); s=string.gsub(s,"&",""); if string.upper(s)==string.upper(need) then return mi; end if string.upper(s)==string.upper(main) then mpos=i; end end -- not found, so we create it mi=createMenuItem(mnis); menuItem_setCaption(mi,need); if cb~=nil then menuItem_onClick(mi,cb); end menuItem_insert(mnis, mpos, mi); return mi; end --if (VTBL==nil) then VTBL = { title="Object Constructor Finder", width=800, height=300, form=nil, addr=nil, list=nil, addrlist=nil, backsize=50, foundlist={},foundnum=nil,lastindex=0, btnJump=nil, mem=nil, dis=nil } --end function VTBL.Show() local te,s,i; --te=addresslist_getSelectedRecord(VTBL.addrlist); --s=memoryrecord_getValue(te); s=string.format("%x",VTBL.getSelectedAddressValue()); s=VTBL.normStr(s); if s==VTBL.normStr(control_getCaption(VTBL.addr)) then VTBL.ShowFoundList(); else lastindex=-1; listview_clear(VTBL.list); VTBL.ClearFoundList(); control_setCaption(VTBL.foundnum,0); end control_setCaption(VTBL.addr,s); VTBL.ChangeJumpToState(); form_show(VTBL.form); end function VTBL.getSelectedAddressValue() local a,b,c; --a=form_getMenu(getMainForm()); a=addresslist_getSelectedRecord(getAddressList()); b=memoryrecord_getAddress(a); c=readInteger(b); return c; --a=control_getPopupMenu(); --print(string.format("%x",c)); end function VTBL.normStr(s) if string.len(s)<8 then s=string.format("%s%s",string.rep("0",8-string.len(s)),s); end; s=string.upper(s); s=string.gsub(s,"%s+",""); return s; end function VTBL.ClearFoundList() local i; for i in pairs(VTBL.foundlist) do VTBL.foundlist[i]=nil; end end function VTBL.GetFoundCount() local num=0; local a; if (VTBL.foundlist~=nil) then for a in pairs(VTBL.foundlist) do num = num + 1 end end return num; end function VTBL.Close() form_hide(VTBL.form); end function VTBL.AOBScan() local i,j,t,u,v; local s=control_getCaption(VTBL.addr); s=VTBL.normStr(s); control_setCaption(VTBL.addr,s); if s=="00000000" then showMessage("Please choose another address"); else listview_clear(VTBL.list); t=""; for i=0,3 do u=string.sub(s,i*2+1,i*2+2); t=string.format("%s %s",u,t); end t=string.sub(t,1,11); VTBL.FilterAOBList(t); control_setCaption(VTBL.foundnum,VTBL.GetFoundCount()); VTBL.ShowFoundList(); end end function VTBL.GetAddr(num) local i=num,c,m,j,found; local s,address,rs; rs={}; address=VTBL.normStr(control_getCaption(VTBL.addr)); address=string.format(",%s",address); --address=string.upper(address); m=0; while m