mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-22 10:17:01 +02:00
refactor: libciderra1n support (#764)
* refactor refactor: remove wdi refactor: move openra1n to its own library refactor: move everything standalone file to src root * submodule * okay these shouldnt of been included * remove * readd * fix openra1n libusb * liteusb for ra1ncovery * fix action * token * whatever lwra bw apwxidix * I knew this was gonna happen * fix mac build * what if this doesnt work * okay bro * lzma resources * rename * use idevice++, fix multiple devices, enter recovery * whatever * fix * --force-enable-ssv * improve exploit stuff, mirror tui logic to gui also cooool logging for libopenra1n * fix idevice windows build * lets not be fancy * new idevice patch * easier to read * lets hope this action works! * remove useless ifs * not required for non tui * PLEASE COMPILE * gsed lmao * this might work idk * whatever bro * ah * amd fix * fix ts * fix * licensing * update paleinfo * LETS NOT do that * forgot a file
This commit is contained in:
128 files changed
+12054
-3114
No files matched your search
+46
-28
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_TUI
|
||||
|
||||
#include "TuiExploitPanel.hpp"
|
||||
@@ -12,7 +39,7 @@
|
||||
|
||||
#include "Tui.hpp"
|
||||
#include "TuiText.hpp"
|
||||
#include "../m8/run.h"
|
||||
#include "../exploit.h"
|
||||
|
||||
static const char *buttons[] = { "Back" };
|
||||
static constexpr int kExploitContentX = 2;
|
||||
@@ -81,51 +108,42 @@ void TuiExploitPanel::set_status(const std::string& status, int progress) {
|
||||
m_progress = std::clamp(progress, 0, 100);
|
||||
}
|
||||
|
||||
void TuiExploitPanel::exploit() {
|
||||
void TuiExploitPanel::exploit()
|
||||
{
|
||||
if (m_is_exploiting) {
|
||||
return;
|
||||
} else {
|
||||
m_is_exploiting = true;
|
||||
}
|
||||
|
||||
m_is_exploiting = true;
|
||||
set_status(stage_to_string(STAGE_RESET), 0);
|
||||
|
||||
std::thread([this]() {
|
||||
std::thread([this]()
|
||||
{
|
||||
const DeviceState deviceState = GetFrame()->GetDeviceState();
|
||||
if (!deviceState.connected || deviceState.mode != DeviceMode::DFU) {
|
||||
set_status("Device is not in DFU mode.", 0);
|
||||
m_is_exploiting = false;
|
||||
return;
|
||||
}
|
||||
|
||||
auto sharedState = std::make_shared<shared_t>();
|
||||
atomic_init(&sharedState->stage, STAGE_RESET);
|
||||
atomic_init(&sharedState->stop, false);
|
||||
atomic_init(&sharedState->result, 0);
|
||||
auto stage = std::make_shared<std::atomic<int>>(STAGE_RESET);
|
||||
|
||||
auto isFinished = std::make_shared<std::atomic<bool>>(false);
|
||||
|
||||
std::thread worker([sharedState, isFinished]() {
|
||||
::exploit(sharedState.get());
|
||||
isFinished->store(true);
|
||||
std::thread worker([stage]()
|
||||
{
|
||||
::exploit(reinterpret_cast<int*>(stage.get()));
|
||||
stage->store(STAGE_DONE);
|
||||
});
|
||||
|
||||
for (;;) {
|
||||
int stage = atomic_load(&sharedState->stage);
|
||||
int progress = stage_to_progress(stage);
|
||||
bool finished = isFinished->load();
|
||||
set_status(stage_to_string(stage), progress);
|
||||
for (;;)
|
||||
{
|
||||
int currentStage = stage->load();
|
||||
int progress = stage_to_progress(currentStage);
|
||||
|
||||
if (stage == STAGE_DONE || finished) {
|
||||
atomic_store(&sharedState->stop, true);
|
||||
break;
|
||||
}
|
||||
set_status(stage_to_string(currentStage), progress);
|
||||
|
||||
if (currentStage == STAGE_DONE) break;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
|
||||
if (worker.joinable()) {
|
||||
worker.join();
|
||||
}
|
||||
if (worker.joinable()) worker.join();
|
||||
|
||||
m_is_exploiting = false;
|
||||
}).detach();
|
||||
|
||||
Reference in new issue
Block a user