;---------- ---------- ---------- ---------- ---------- ; 作成者のURL ---> http://www.setsuki.com/ ;---------- ---------- ---------- ---------- ---------- ; リソース情報をほんの少しだけ表示します。 #define resview 5 ;リソース情報の最大表示数 #define N 0 #define D 1 #define S 2 #define noteadd1(%1,%2,%3) noteadds a,%1,1,%3,%2 #define noteadd2(%1,%2,%3) noteadds a,%1,2,%3,%2 #define noteadd4(%1,%2,%3) noteadds a,%1,4,%3,%2 #module ;---------- ---------- ---------- ---------- ---------- ; 文字列を追加する ;---------- ---------- ---------- ---------- ---------- #deffunc noteadds val buf, int off, int size, str com, int sflag mref stt,64 sdim b,16 : a=0 : memcpy a, buf, size, 0, off if ( sflag == 1 ) : b = " [ "+ a +" ]" if ( sflag == 2 ) { lpoke b, 0, a : b = " ( "+ b +" )" } c="" : if ( size*2 < 8 ) : repeat 8-size*2 : c+=" " : loop noteadd strf("%08x : ", off)+strf("%0"+(size*2)+"x"+c+" : ", a)+com+b stt = a return ;---------- ---------- ---------- ---------- ---------- #global sdim rtype,16,25 rtype. 0 = "???" rtype. 1 = "RT_CURSOR" rtype. 2 = "RT_BITMAP" rtype. 3 = "RT_ICON" rtype. 4 = "RT_MENU" rtype. 5 = "RT_DIALOG" rtype. 6 = "RT_STRING" rtype. 7 = "RT_FONTDIR" rtype. 8 = "RT_ACCELERATOR" rtype. 9 = "RT_RCDATA" rtype.10 = "RT_RCDATA" rtype.11 = "RT_MESSAGETABLE" rtype.12 = "RT_GROUP_CURSOR" rtype.13 = "???" rtype.14 = "RT_GROUP_ICON" rtype.15 = "?" rtype.16 = "RT_VERSION" rtype.17 = "RT_DLGINCLUDE" rtype.18 = "???" rtype.19 = "RT_PLUGPLAY" rtype.20 = "RT_VXD" rtype.21 = "RT_ANICURSOR" rtype.22 = "RT_ANIICON" rtype.23 = "RT_HTML" rtype.24 = "???" ; 初期設定 ;---------- ---------- ---------- ---------- ---------- sdim file,1024 sdim buf,65535 : notesel buf sdim tmp,1024 objmode 1,1 : objsize 100,24 pos 0,0 : button "読み込み",*begin pos 100,0 : button "結果を保存",*text_save pos 0,24 : input file, ginfo_winx objmode 2,1 : mesbox buf,ginfo_winx,ginfo_winy-ginfo_cy,5,65535 : id=stat wait 10 ; ファイルを開く ;---------- ---------- ---------- ---------- ---------- *begin dialog "exe;*.icl;*.dll",16,"" : if stat!1 : stop objprm id-1, refstr ; ファイルのサイズを取得 ;---------- ---------- ---------- ---------- ---------- exist file : flen=strsize if flen<0 : dialog "ファイルが存在しません" : stop if flen<1 : dialog "ファイルのサイズが 0 です" : stop ; ファイルの種類をチェック ;---------- ---------- ---------- ---------- ---------- chk=0 : bload file,chk,2 if ( chk != 0x5A4D ) : dialog "EXEファイルではありません" : goto *begin ; ファイルを読み込む ;---------- ---------- ---------- ---------- ---------- sdim a,flen : bload file,a,flen title getpath(file,8)+" ("+flen+"byte)" ; ファイルの情報を取得 ;---------- ---------- ---------- ---------- ---------- buf="" : i=0 noteadd2 0, S, "Signature" noteadd2 60, N, "Signature の位置" : p=stat noteadd "--------------------------------------------------" noteadd2 p, S, "Signature" : c=stat ;---------- ---------- ---------- ---------- ---------- ; NE の場合 if ( c = 0x454E ) { ; リソースセクションのアドレス取得 noteadd2 36+p, N, "リソースセクションのアドレス" : rsad = stat p += rsad : i= p rsas = 0 repeat 10 noteadd "==================================================" type = peek(a, 2+i) : if ( type == 0 )|( type > 23 ) : break ; リソースの配列の桁送り noteadd2 i, N, "リソースの配列の桁送り" : rsas += stat : i+=2 noteadd1 i, D, "リソースID ( "+rtype( type )+" )" : i++ noteadd1 i, N, "???" : i++ noteadd2 i, D, "ファイルの数" : num = stat : i+=2 noteadd2 i, N, "???" : i+=2 repeat limit(num, 0, resview) noteadd "--------------------------------------------------" noteadd2 i, N, "???" : i+=2 noteadd2 i, N, "リソース位置" : i+=2 : pnt = stat noteadd2 i, N, "リソースサイズ" : i+=2 noteadd2 i, N, "???" : i+=2 noteadd2 i, N, "リソース番号?" : i+=2 noteadd2 i, N, "???" : i+=2 pnt2 = pnt << rsas gosub *resc_data loop if num > resview { noteadd "  ・\n  ・ [省略]\n  ・" i += (num-resview)*12 } loop noteadd2 i, N, "リソースの配列の桁送り" : i+=2 noteadd1 i, D, "リソースID" : i++ noteadd1 i, N, "???" : i++ goto *text_view } ;---------- ---------- ---------- ---------- ---------- ; PE の場合 if ( c == 0x04550 ) { ; セッションの数 noteadd2 6+p, N, "セッションの数" : nsec = stat noteadd4 136+p, N, "リソーステーブルのアドレス" : rsad = stat noteadd4 140+p, N, "リソーステーブルのサイズ" : rssz = stat p += 248 : flag=0 repeat nsec ;noteadd4 p, S, "セッション名" ;noteadd4 12+p, N, "セッションの位置" if ( lpeek(a, 12+p) == rsad ) : flag = p p+=40 loop noteadd "--------------------------------------------------" if flag == 0 { noteadd "イメージセッションが見当たりませんでした。" goto *text_view } p = flag noteadd4 p, S, "イメージセッション名" noteadd4 16+p, D, "このセッションのデータサイズ" noteadd4 20+p, D, "このセッションのデータアドレス" prsa = stat noteadd "--------------------------------------------------" i = prsa noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"???" : i+=2 noteadd2 i, N,"A(仮)リソースIDの数" : i+=2 : nres = stat noteadd2 i, N,"B(仮)リソースIDの数" : i+=2 : nres += stat repeat nres noteadd "==================================================" type = limit( wpeek(a, i), 0, 24 ) noteadd2 i, D, "リソースID ( "+rtype( type )+" )" noteadd2 2+i, N,"A(仮)かB(仮)の判別" : p = stat noteadd4 4+i, N,"位置?" i += 8 : if ( p ) : continue p = prsa + ( stat &0x7FFFFFFF ) noteadd "--------------------------------------------------" noteadd2 12+p, D, "C(仮) のファイル数" : num = stat noteadd2 14+p, D, "D(仮) のファイル数" : num+= stat p += 16 repeat limit(num, 0, resview) noteadd "--------------------------------------------------" noteadd4 p, N, "???" : p+=4 noteadd4 p, N, "Offset" : p+=4 : pirde2 = ( stat&0x7FFFFFFF ) + prsa +16 noteadd4 pirde2+4 , N, "Offset2" : pDatEnt = stat + prsa noteadd4 pDatEnt , N, "Offset3" : offset3 = stat noteadd4 pDatEnt+4, D, "Size?" pnt2 = prsa + offset3 - rsad gosub *resc_data loop if num > resview { noteadd "--------------------------------------------------" noteadd "  ・\n  ・ [省略]\n  ・" } loop goto *text_view } ;---------- ---------- ---------- ---------- ---------- ; その他 の場合 noteadd "不明です。" ; 結果を表示 ;---------- ---------- ---------- ---------- ---------- *text_view objprm id, buf stop ; 結果をテキストファイルに保存 ;---------- ---------- ---------- ---------- ---------- *text_save dialog "txt",17,"" if stat=1 : bsave refstr,buf,strlen(buf) stop ;---------- ---------- ---------- ---------- ---------- *resc_data if ( type == 3 ) { noteadd "" noteadd2 pnt2, D, "ヘッダサイズ" noteadd2 4+pnt2, D, "横幅" noteadd2 8+pnt2, D, "高さ" noteadd2 14+pnt2, D, "色ビット" } if ( type == 14 ) { noteadd2 pnt2, N, "予約" : noteadd2 2+pnt2, N, "アイコンリソースタイプ" noteadd2 4+pnt2, D, "アイコンの数" : inum=stat noteadd "" repeat inum noteadd2 14*cnt+18+pnt2, D, "No."+cnt+" のアイコン番号" loop } return ;---------- ---------- ---------- ---------- ---------- /* Resource types */ #define RT_CURSOR 1 #define RT_BITMAP 2 #define RT_ICON 3 #define RT_MENU 4 #define RT_DIALOG 5 #define RT_STRING 6 #define RT_FONTDIR 7 #define RT_FONT 8 #define RT_ACCELERATOR 9 #define RT_RCDATA 10 #define RT_MESSAGETABLE 11 #define RT_GROUP_CURSOR 12 #define RT_GROUP_ICON 14 #define RT_VERSION 16 #define RT_DLGINCLUDE 17 #define RT_PLUGPLAY 19 #define RT_VXD 20 #define RT_ANICURSOR 21 #define RT_ANIICON 22 #define RT_HTML 23