Exemple #1
0
int main(int argc, void* argv)
{
sigset_t emptyset;
    //  sigsegv_init(&ss_dispatcher);
  sigsegv_install_handler(ss_handler);
/* Save the current signal mask.  */
  sigemptyset (&emptyset);
  sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);

  enable_memory_block(&Vm_image_start, &Vm_image_end);
  process_opts(argc,argv);
  install_exception_handler(kernel_exception_handler);
  if ( opts.image_file != 0 )
    load_image(opts.image_file);

  run_repl();
  return 0;
}
Exemple #2
0
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	if(fdwReason == DLL_PROCESS_ATTACH)
	{
		process_command_line();

		void * module_base = reinterpret_cast<void *>(hinstDLL);
		if(verbose)
			write_line("Module base: " + ail::hex_string_32(reinterpret_cast<unsigned>(hinstDLL)));

		initialise_dll_vector();
		anti_debugging();

		if(!
			(
				hide_module(module_base) &&
				apply_hot_patches() &&
				install_exception_handler() &&
				process_main_thread() &&
				python::initialise_python()
			)
		)
		{
			console_output = true;
			write_line("A fatal error occured, the program is not going to continue, please close this window.");
			while(true)
				Sleep(0);
		}

		if(prompt_mode)
			initialise_console();

		LoadLibrary("D2Client.dll");
	}

	return TRUE;
}
Exemple #3
0
// Called to initialize a new m (including the bootstrap m).
void
runtime·minit(void)
{
	runtime·install_exception_handler();
}