public unsafe bool Execute() { var largeInteger = LargeInteger.FromDateTime(GetTestSubscriptionTimeWithOffset(DateTime.Now.AddDays(2))); if (largeInteger != LargeInteger.Zero) { Console.WriteLine($"[INJECTION] >> Calculated large integer -- low '{largeInteger.LowPart}', high '{largeInteger.HighPart}'"); var mmap = DozeObject.Create <ManualMapperObject>(); if (File.Exists("loader.dll")) { mmap.Assign(System.Diagnostics.Process.GetCurrentProcess(), "loader.dll"); var allocated = Marshal.AllocHGlobal(Unsafe.SizeOf <LargeInteger>()); Unsafe.Write(allocated.ToPointer(), largeInteger); mmap.MapLibrary(allocated); Console.WriteLine($"[INJECTION] >> Library mapped: 0x{mmap.DllBaseAddress:X16}"); return(true); } else { Console.WriteLine("[INJECTION] >> loader.dll not found!"); } } return(false); }
public static void Run() { DozeObjectManager.Instantiate(); m_IsForceDebugMode = false; DozeObject.Create <WindowsObject>(); DozeObject.Create <CoreErrorObject>(); DozeObject.Create <HardwareObject>(); DozeObject.Create <NetworkClientObject>(); }
private unsafe static void MapLibrary() { var mapper = DozeObject.Create <Process.ManualMapperObject>(); if (mapper != null) { var ticks = GetExpirationTicks(); if (ticks != LargeInteger.Zero) { mapper.Assign(System.Diagnostics.Process.GetCurrentProcess(), "C:\\Doze\\Tests\\Map\\test.dll"); var reservedShadowPointer = Marshal.AllocHGlobal(Marshal.SizeOf <LargeInteger>()); Unsafe.Write(reservedShadowPointer.ToPointer(), GetExpirationTicks()); //Map unmanaged library with mapper.MapLibrary(reservedShadowPointer); } } }
static void Main() { try { AppContext = DozeObject.Create <ApplicationContext>(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var cachedForm = AppContext.GetVisualManager().CacheOrGetOriginalObject(new WindowGeneralForm(), "window-general:form"); AppContext.GetVisualManager().SetState(WindowVisualState.Loading); Application.Run(cachedForm); } catch { MessageBox.Show("Catched critical error while application will be running.\n\nApplication would be closed.", "Critical error", MessageBoxButtons.OK); } }
public MainWindow() { InitializeComponent(); MainWindowHelper = DozeObject.Create <MainWindowHelperObject>(); MainWindowHelper.RefWindow(this); }
public async void OnLoading() { if (IsLoadingNow) { return; } IsLoadingNow = true; LoginButton.Enabled = false; ShadowPanel.Visible = true; LoginProgressIndicator.Visible = true; CreateAccountLink.Enabled = false; ForgotAccountLink.Enabled = false; if (!IsInitialized && !IsLoginAttempt) { LoadingStatusText.Text = "initializing secure handshake"; WindowManager = DozeObject.FindObjectOfType <WindowsObject>(); LoginCtx = DozeObject.FindObjectOfType <LoginContext>(); if (LoginCtx == null) { LoginCtx = DozeObject.Create <LoginContext>(); } if (await LoginCtx.ConnectAsync()) { DozeObject.FindObjectOfType <WindowsObject>().SetState("window-general:login", WindowVisualState.Visible); } else { LoadingStatusText.Text = "connection timeout"; } } if (IsLoginAttempt) { LoadingStatusText.Text = "request auhtorization"; if (!TryGetTextBoxString(LoginTextBox, out string login, () => { LoginTextBox.Text = ""; LoginTextBox.PlaceholderText = "this field can't be empty!"; PasswordTextBox.Text = ""; SetState(WindowVisualState.Visible); IsLoginAttempt = false; })) { return; } if (!TryGetTextBoxString(PasswordTextBox, out string password, () => { LoginTextBox.Text = ""; PasswordTextBox.PlaceholderText = "this field can't be empty!"; PasswordTextBox.Text = ""; SetState(WindowVisualState.Visible); IsLoginAttempt = false; })) { return; } var loginAttemptResult = await LoginCtx.LoginAttemptAsync(login, password); if (loginAttemptResult.AttemptResult == LoginAttemptResult.Ok) { var cachedWindow = WindowManager.CacheOrGetOriginalObject(new MainWindow(), "window-general:main"); Hide(); cachedWindow.FormClosed += (e, args) => { Close(); }; cachedWindow.Show(); } else { MessageBox.Show(loginAttemptResult.Message, "Authenticate error"); SetState(WindowVisualState.Visible); } IsLoginAttempt = false; } IsLoadingNow = false; }