static int lua_peekarb(lua_State *L) { lua::state st(L); size_t size=st.as<size_t>(2); void *p=st.newuserdata(size); peekarb(st.as<size_t>(1),p,size); return 1; }
void InfoManager::Dump() { uint32_t pos; for(size_t i=0;i<infovec.Size();i++) { infovec.Load(i,&pos); DF_info inf; peekarb(pos,&inf,sizeof(inf)); if(inf.InfoType()!="") cout<<inf.InfoType()<<":"<<inf.ID<<endl; else cout<<hex<<NormalizePtr(inf.vtable)<<dec<<":"<<inf.ID<<endl; } }
void ScanVectors(size_t start,size_t end) { //size_t start=0x01A00000; //size_t end= 0x01B00000; DF_Vector<size_t> vec; for (unsigned long off=start;off<end;off++) { //fstream ffile("data.txt",fstream::out|fstream::in|fstream::trunc); //ffile<<"START!"<<endl; peekarb(off,&vec,sizeof(vec)); if (vec.IsValid()) if (vec.Size_Abs()<100000) cout<<hex<<off<<" Size:"<<dec<<vec.Size()<<endl; } }
uint32_t InfoManager::FindOfType(string type) { uint32_t pos; for(size_t i=0;i<infovec.Size();i++) { infovec.Load(i,&pos); DF_info inf; peekarb(pos,&inf,sizeof(inf)); if(inf.InfoType()==type) { return pos; } } return 0; }