public static void MakeAllDataLength(List <Address> list, List <DisassemblerTrumb.LDRPointer> ldrmap) { List <Address> procs = new List <Address>(); FindProc find = new FindProc(procs, ldrmap); list.AddRange(procs); //発見したProcsを追加. //Procsに付属するデータを発見する foreach (Address a in procs) { uint addr = a.Addr; uint end = addr + a.Length; for (; addr < end; addr += 8) { uint code = Program.ROM.u8(addr); if (ProcsScriptForm.hasASMRoutine(code)) {//呼び出しているASM関数 uint arg = Program.ROM.p32(addr + 4); if (arg != 0) { FEBuilderGBA.Address.AddFunction(list, addr + 4, GetProcsName(a) + " CallASM"); } } else if (code == 0x01) {//Set name FEBuilderGBA.Address.AddCString(list, addr + 4); } } } }
public bool SearchBackword() { if (Target == null) { return(false); } string key = textBoxSearch.Text; if (string.IsNullOrEmpty(key)) { return(false); } string s = Target.Text; if (string.IsNullOrEmpty(s)) { return(false); } int p0 = Target.SelectionStart; StringComparison comp = IsChecked(checkBoxCaseful) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase; FindProc proc = FindPrevSimple; int p; if (IsChecked(checkBoxWardwrap)) { proc = FindPrevWord; } if (IsChecked(checkBoxRegex)) { proc = FindPrevRegex; } p = proc(s, p0 - 1, key, comp); if (p == -1) { p = proc(s, s.Length - 1, key, comp); if (p <= p0) { p = -1; } } if (p == -1) { return(false); } SelectTextBox(Target, p, key.Length); return(true); }
private void ProcsScriptForm_Shown(object sender, EventArgs e) { using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { pleaseWait.DoEvents(R._("準備しています")); ProcsList = new List <Address>(); List <DisassemblerTrumb.LDRPointer> ldrmap = Program.AsmMapFileAsmCache.GetLDRMapCache(); FindProc find = new FindProc(ProcsList, ldrmap); this.AddressList.BeginUpdate(); this.AddressList.Items.Clear(); for (int i = 0; i < ProcsList.Count; i++) { Address address = ProcsList[i]; string name = U.ToHexString(address.Addr) + " " + address.Info.Substring(6); this.AddressList.Items.Add(name); } this.AddressList.EndUpdate(); } }
public static void MakeCheckError(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap) { List <Address> procs = new List <Address>(); FindProc find = new FindProc(procs, ldrmap); //Procsに付属するデータを発見する foreach (Address a in procs) { uint addr = a.Addr; uint end = addr + a.Length; for (; addr < end; addr += 8) { uint code = Program.ROM.u8(addr); if (ProcsScriptForm.hasASMRoutine(code)) {//呼び出しているASM関数 uint arg = Program.ROM.u32(addr + 4); if (arg != 0) { FELint.CheckASMPointer(arg, errors, FELint.Type.PROCS, a.Addr, addr); } } else if (ProcsScriptForm.hasChildProcs(code)) {//子Procsの確認 uint arg = Program.ROM.u32(addr + 4); if (arg != 0) { FELint.CheckProcsPointer(arg, errors, FELint.Type.PROCS, a.Addr, addr); } } else if (code == 0x01) {//Set name uint name = Program.ROM.u32(addr + 4); FELint.CheckText(name, "PROCS", errors, FELint.Type.SOUNDROOM, a.Addr, addr); } } } }