void ShowHint(uint addr) { uint pointer = U.toPointer(addr); AsmMapFile asmMap = Program.AsmMapFileAsmCache.GetAsmMapFile(); AsmMapFile.AsmMapSt p; //カーソル値のデータのヒントを与える. string hint = ""; if (asmMap.TryGetValue(pointer, out p)) { hint = p.ToStringInfo(); } else { uint near_pointer = asmMap.SearchNear(pointer); if (asmMap.TryGetValue(near_pointer, out p)) { if (pointer < near_pointer + p.Length) { uint offset = (pointer - near_pointer); hint = U.To0xHexString(U.toOffset(near_pointer)) + "+" + offset + "(" + U.To0xHexString(offset) + ") " + p.ToStringInfo(); } } } Hint.Text = hint; }
private void WhatIsButton_Click(object sender, EventArgs e) { uint addr = U.atoh(Address.Text); uint pointer = U.toPointer(addr); addr = U.toOffset(addr); string hint = ""; AsmMapFile asmMap = Program.AsmMapFileAsmCache.GetAsmMapFile(); AsmMapFile.AsmMapSt p; if (asmMap.TryGetValue(pointer, out p)) { hint = p.ToStringInfo(); } else { uint near_pointer = asmMap.SearchNear(pointer); if (asmMap.TryGetValue(near_pointer, out p)) { if (pointer < near_pointer + p.Length) { uint offset = (pointer - near_pointer); hint = U.To0xHexString(U.toOffset(near_pointer)) + "+" + offset + "(" + U.To0xHexString(offset) + ") " + p.ToStringInfo(); } } } if (hint.Length <= 0) { R.ShowOK("not found"); return; } R.ShowOK("アドレス{0}は {1} 領域です。", U.To0xHexString(addr), hint); }
void ShowHint(uint addr) { uint pointer = U.toPointer(addr); AsmMapFile asmMap = Program.AsmMapFileAsmCache.GetAsmMapFile(); AsmMapFile.AsmMapSt p; //カーソル値のデータのヒントを与える. string hint = ""; if (asmMap.TryGetValue(pointer, out p)) { hint = p.ToStringInfo(); if (p.Length > 0) { hint += " Length:" + p.Length; } } else { uint near_pointer = asmMap.SearchNear(pointer); if (asmMap.TryGetValue(near_pointer, out p)) { if (pointer < near_pointer + p.Length) { uint offset = (pointer - near_pointer); hint = U.To0xHexString(U.toOffset(near_pointer)) + "+" + offset + "(" + U.To0xHexString(offset) + ")/" + p.Length + p.ToStringInfo(); } } } string comment; if (Program.CommentCache.TryGetValue(U.toOffset(pointer), out comment)) {//ユーザー定義のコメントがある if (hint.Length > 0) { hint += " "; } hint += comment; } Hint.Text = hint; }