⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 schedule.cpp

📁 反汇编工具borg2.27源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
			 break;
		  case user_upstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Unicode Pascal String");
#endif
			 dio.upstring();
			 break;
		  case user_dosstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:User DOS String");
#endif
			 dio.dosstring();
			 break;
		  case user_generalstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:User General String");
#endif
			 dio.generalstring();
			 break;
		  case user_argoverdec:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Override Decimal");
#endif
			 dio.argoverdec();
			 break;
		  case user_argsingle:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Override Single Real");
#endif
			 dio.argoversingle();
			 break;
		  case user_argoverhex:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Override Hex");
#endif
			 dio.argoverhex();
			 break;
		  case user_argoverchar:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Override Char");
#endif
			 dio.argoverchar();
			 break;
		  case user_argoveroffsetdseg:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Override Offset Dseg");
#endif
			 dio.argoveroffsetdseg();
			 break;
        case user_argnegate:
#ifdef DEBUG
			 DebugMessage("Scheduler:User Argument Negate");
#endif
			 dio.arg_negate();
			 break;
		  case dis_dialog:
#ifdef DEBUG
			 DebugMessage("Scheduler:Decoding Dialog at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdialog(task->addr,task->comment);
          delete task->comment;
			 break;
		  case dis_stringtable:
#ifdef DEBUG
			 DebugMessage("Scheduler:Decoding Stringtable at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disstringtable(task->addr,task->comment);
          delete task->comment;
			 break;
		  case dis_dataword:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making word at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdataword(task->addr);
			 break;
		  case dis_datadword:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making dword at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatadword(task->addr);
			 break;
		  case dis_datadsoffword:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making dword at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatadsoffword(task->addr);
			 break;
		  case dis_datastring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatastring(task->addr);
			 break;
		  case dis_datapstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making Pascal string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatapstring(task->addr);
			 break;
		  case dis_dataucstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making unicode c string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdataucstring(task->addr);
			 break;
		  case dis_dataupstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making unicode pascal string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdataupstring(task->addr);
			 break;
		  case dis_datadosstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making DOS string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatadosstring(task->addr);
			 break;
		  case dis_datageneralstring:
#ifdef DEBUG
			 DebugMessage("Scheduler:Making general string at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disdatageneralstring(task->addr);
			 break;
		  case dis_argoverdec:
#ifdef DEBUG
			 DebugMessage("Scheduler:Argument Override Decimal at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disargoverdec(task->addr);
			 break;
		  case dis_argoverhex:
#ifdef DEBUG
			 DebugMessage("Scheduler:Argument Override Hex at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disargoverhex(task->addr);
			 break;
		  case dis_argoverchar:
#ifdef DEBUG
			 DebugMessage("Scheduler:Argument Override Char at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disargoverchar(task->addr);
			 break;
		  case dis_argoveroffsetdseg:
#ifdef DEBUG
			 DebugMessage("Scheduler:Argument Override Offset Dseg at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disargoveroffsetdseg(task->addr);
			 break;
		  case nameloc:
#ifdef DEBUG
			 DebugMessage("Scheduler:Naming : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 name.addname(task->addr,task->comment);
			 break;
		  case dis_xref:
#ifdef DEBUG
			 DebugMessage("Scheduler:Adding Xref at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disxref(task->addr);
			 break;
		  case namecurloc:
#ifdef DEBUG
			 DebugMessage("Scheduler:Naming : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 name.addname(task->addr,task->comment);
			 delete task->comment;
			 break;
		  case dis_segheader:
#ifdef DEBUG
			 DebugMessage("Scheduler:Segheader at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dta.segheader(task->addr);
			 break;
		  case dis_jumptable:
#ifdef DEBUG
			 DebugMessage("Scheduler:Disassembling Jumptable at : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
			 dsm.disjumptable(task->addr);
			 break;
		  case dis_ordimport:
#ifdef DEBUG
			 DebugMessage("Scheduler:Import : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 import.addname(task->addr,task->comment);
			 delete task->comment;
			 break;
		  case dis_import:
#ifdef DEBUG
			 DebugMessage("Scheduler:Import : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 import.addname(task->addr,task->comment);
			 break;
		  case dis_ordexport:
#ifdef DEBUG
			 DebugMessage("Scheduler:Export : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 expt.addname(task->addr,task->comment);
			 delete task->comment;
			 break;
		  case dis_export:
#ifdef DEBUG
			 DebugMessage("Scheduler:Export : %04lx:%04lx to %s",task->addr.segm,task->addr.offs,task->comment);
#endif
			 expt.addname(task->addr,task->comment);
			 break;
        case seek_code:
#ifdef DEBUG
			 DebugMessage("Scheduler:Seek_Code : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
          dsm.codeseek(task->addr);
          break;
        case user_delcomment:
#ifdef DEBUG
			 DebugMessage("Scheduler:Delete_Comment : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
		    dsm.delcomment(task->addr,dsmcomment);
          break;
        case user_addcomment:
#ifdef DEBUG
			 DebugMessage("Scheduler:Add_Comment : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
          dsm.discomment(task->addr,dsmcomment,(unsigned char *)task->comment);
          break;
        case user_delxref:
#ifdef DEBUG
			 DebugMessage("Scheduler:User_Del_Xref : %04lx:%04lx",task->addr.segm,task->addr.offs);
#endif
          xrefs.userdel(task->addr);
          break;
        case user_repeatxrefview:
          PostMessage(mainwindow,WM_REPEATXREFVIEW,(WPARAM)0,(LPARAM)0);
          break;
        case user_repeatnameview:
          PostMessage(mainwindow,WM_REPEATNAMEVIEW,(WPARAM)0,(LPARAM)0);
          break;
		  case user_undefineblock:
          blk.undefine();
          break;
        case user_marktopblock:
          blk.settop();
          break;
        case user_markbottomblock:
          blk.setbottom();
          break;
		  case quitborg:
          threadstopped=true;
          return true;
		  default:
			 break;
		}
      // done with it, now delete it
		delete task;
	 }
	 if(KillThread)
      return true;
  } while(!done);
  // it is important to mark the thread as stopped if we leave here
  // so that the main thread can know if it is safe to quit
  threadstopped=true;
  return procdany;
}

/************************************************************************
* sizelist                                                              *
* - this simply returns number of tasks left to process                 *
************************************************************************/
dword schedule::sizelist(void)
{ return numlistitems();
}

/************************************************************************
* stopthread                                                            *
* - pausing and continuing the secondary thread has not been without    *
*   its headaches in early versions. Here I simply set threadpause and  *
*   wait until threadstopped is set to true. Having finally sorted out  *
*   most thread issues and critical sections, etc I have more or less   *
*   ended up with the simplest code back in here. Many problems have    *
*   been due to clashes of critical section code, and pausing at the    *
*   wrong time, or exitting and waiting for a thread to finish when it  *
*   was waiting for a critical section, etc. Anyway, hopefully these    *
*   issues are now resolved and this simple code will endure for a bit  *
* - further simplified whilst commenting and analysing, Borg v2.21      *
* - Note that threadpause and threadstopped are both declared as        *
*   volatile variables.                                                 *
************************************************************************/
void schedule::stopthread(void)
{ threadpause=true;
  while(!threadstopped)
    Sleep(0);
}

/************************************************************************
* continuethread                                                        *
* - simply sets threadpause to false again                              *
* - we dont need to wait around for verification that it has continued  *
************************************************************************/
void schedule::continuethread(void)
{ threadpause=false;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -