mirror of
https://github.com/palera1n/palera1n.git
synced 2026-12-06 00:04:18 +01:00
refactor: ui improvements
refactor: ui improvements fix(build): missing include :/ refactor: type conversions
This commit is contained in:
13 files changed
+58
-29
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 6.6 KiB |
+1
-12
@@ -5,18 +5,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int dfu_serial_number_get_cpid(char *serial) {
|
uint16_t dfu_serial_number_get_cpid(char *serial) {
|
||||||
char *cpid = strstr(serial, "CPID:");
|
char *cpid = strstr(serial, "CPID:");
|
||||||
if (cpid == NULL) { return -1; }
|
if (cpid == NULL) { return -1; }
|
||||||
return strtol(cpid + 5, NULL, 16);
|
return strtol(cpid + 5, NULL, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dfu_serial_number_get_bdid(char *serial) {
|
|
||||||
char *bdid = strstr(serial, "BDID:");
|
|
||||||
if (bdid == NULL) { return -1; }
|
|
||||||
return strtol(bdid + 5, NULL, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dfu_serial_number_is_in_dfu_mode(char *serial) {
|
bool dfu_serial_number_is_in_dfu_mode(char *serial) {
|
||||||
char *DFU = strstr(serial, "SRTG");
|
char *DFU = strstr(serial, "SRTG");
|
||||||
return DFU != NULL;
|
return DFU != NULL;
|
||||||
@@ -31,8 +25,3 @@ bool dfu_serial_number_is_in_yolo_dfu(char *serial) {
|
|||||||
char *yolo = strstr(serial, "YOLO");
|
char *yolo = strstr(serial, "YOLO");
|
||||||
return yolo != NULL;
|
return yolo != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool device_serial_number_is_in_pongo_os(char *serial) {
|
|
||||||
char *pongo = strstr(serial, "SRTG:[PongoOS");
|
|
||||||
return pongo != NULL;
|
|
||||||
}
|
|
||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int dfu_serial_number_get_cpid(char *serial);
|
uint16_t dfu_serial_number_get_cpid(char *serial);
|
||||||
bool dfu_serial_number_is_in_dfu_mode(char *serial);
|
bool dfu_serial_number_is_in_dfu_mode(char *serial);
|
||||||
bool dfu_serial_number_is_pwned(char *serial);
|
bool dfu_serial_number_is_pwned(char *serial);
|
||||||
bool dfu_serial_number_is_in_yolo_dfu(char *serial);
|
bool dfu_serial_number_is_in_yolo_dfu(char *serial);
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@
|
|||||||
#include "../gen/payloads/yolo_t8015.h"
|
#include "../gen/payloads/yolo_t8015.h"
|
||||||
|
|
||||||
bool checkm8_find_device_configuration_for_cpid(
|
bool checkm8_find_device_configuration_for_cpid(
|
||||||
int cpid,
|
uint16_t cpid,
|
||||||
struct DeviceConfiguration *config)
|
struct DeviceConfiguration *config)
|
||||||
{
|
{
|
||||||
bool foundMatchingConfiguration = true;
|
bool foundMatchingConfiguration = true;
|
||||||
@@ -58,7 +58,7 @@ bool checkm8_find_device_configuration_for_cpid(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool checkm8_find_payload_configuration_for_cpid(
|
bool checkm8_find_payload_configuration_for_cpid(
|
||||||
int cpid,
|
uint16_t cpid,
|
||||||
struct PayloadConfiguration *config)
|
struct PayloadConfiguration *config)
|
||||||
{
|
{
|
||||||
bool foundMatchingConfiguration = true;
|
bool foundMatchingConfiguration = true;
|
||||||
|
|||||||
+2
-2
@@ -44,8 +44,8 @@ typedef struct {
|
|||||||
size_t len;
|
size_t len;
|
||||||
} yolo_payload_t;
|
} yolo_payload_t;
|
||||||
|
|
||||||
bool checkm8_find_device_configuration_for_cpid(int cpid, struct DeviceConfiguration *config);
|
bool checkm8_find_device_configuration_for_cpid(uint16_t cpid, struct DeviceConfiguration *config);
|
||||||
bool checkm8_find_payload_configuration_for_cpid(int cpid, struct PayloadConfiguration *config);
|
bool checkm8_find_payload_configuration_for_cpid(uint16_t cpid, struct PayloadConfiguration *config);
|
||||||
void create_pongo_payload_for_device(uint16_t cpid, const uint8_t **payload, size_t *payloadSize);
|
void create_pongo_payload_for_device(uint16_t cpid, const uint8_t **payload, size_t *payloadSize);
|
||||||
|
|
||||||
#endif // PAYLOAD_H
|
#endif // PAYLOAD_H
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "../utils.h"
|
#include "../utils.h"
|
||||||
#include "../globals.h"
|
#include "../globals.h"
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ void parse_arguments(int argc, char* argv[]) {
|
|||||||
} else {
|
} else {
|
||||||
palerain_flags &= ~palerain_option_cli;
|
palerain_flags &= ~palerain_option_cli;
|
||||||
palerain_flags |= palerain_option_gui;
|
palerain_flags |= palerain_option_gui;
|
||||||
|
// xcode doesn't know how to display colors
|
||||||
|
palerain_flags |= palerain_option_no_colors;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
|
|||||||
+2
-2
@@ -55,11 +55,11 @@ void log_write(log_level_t level, const char *fmt, ...) {
|
|||||||
snprintf(tag_buf, sizeof(tag_buf), "<%s>", level_name(level));
|
snprintf(tag_buf, sizeof(tag_buf), "<%s>", level_name(level));
|
||||||
|
|
||||||
if (palerain_flags & palerain_option_no_colors) {
|
if (palerain_flags & palerain_option_no_colors) {
|
||||||
printf(" %s%-9s%s [%s%s%s] => ",
|
printf(" %s%9s%s [%s%s%s] => ",
|
||||||
"", tag_buf, "",
|
"", tag_buf, "",
|
||||||
"", get_timestamp(), "");
|
"", get_timestamp(), "");
|
||||||
} else {
|
} else {
|
||||||
printf(" %s%-9s%s [%s%s%s] => ",
|
printf(" %s%9s%s [%s%s%s] => ",
|
||||||
level_color(level), tag_buf, RESET_COLOR,
|
level_color(level), tag_buf, RESET_COLOR,
|
||||||
GRAY_COLOR, get_timestamp(), RESET_COLOR);
|
GRAY_COLOR, get_timestamp(), RESET_COLOR);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -90,8 +90,8 @@ DfuPanel::DfuPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
bottomRow->AddStretchSpacer();
|
bottomRow->AddStretchSpacer();
|
||||||
bottomRow->Add(m_backButton, 0, wxALL, 10);
|
bottomRow->Add(m_backButton, 0, wxALL, 12);
|
||||||
bottomRow->Add(m_startButton, 0, wxALL, 10);
|
bottomRow->Add(m_startButton, 0, wxALL, 12);
|
||||||
|
|
||||||
root->Add(bottomRow, 0, wxEXPAND);
|
root->Add(bottomRow, 0, wxEXPAND);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ExploitPanel::ExploitPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
root->Add(m_progressBar, 0, wxALL | wxEXPAND, 20);
|
root->Add(m_progressBar, 0, wxALL | wxEXPAND, 20);
|
||||||
|
|
||||||
root->AddStretchSpacer();
|
root->AddStretchSpacer();
|
||||||
root->Add(m_backButton, 0, wxALL | wxALIGN_RIGHT, 10);
|
root->Add(m_backButton, 0, wxALL | wxALIGN_RIGHT, 12);
|
||||||
|
|
||||||
SetSizer(root);
|
SetSizer(root);
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-4
@@ -3,6 +3,7 @@
|
|||||||
#include "MainPanel.hpp"
|
#include "MainPanel.hpp"
|
||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
#include <wx/hyperlink.h>
|
||||||
#include <wx/mstream.h>
|
#include <wx/mstream.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
@@ -60,10 +61,46 @@ MainPanel::MainPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
"Made by: asdfugil, kok3shidoll, C, mineek, nekohaxx, plooshi, staturnz\n\n"
|
"Made by: asdfugil, kok3shidoll, C, mineek, nekohaxx, plooshi, staturnz\n\n"
|
||||||
"Thanks to: llsc12, itsnebulalol, lrdsnow, kirb, ehilwyma opa334, 0x7ff,\n"
|
"Thanks to: llsc12, itsnebulalol, lrdsnow, kirb, ehilwyma opa334, 0x7ff,\n"
|
||||||
"sbingner, nikias (libimobiledevice), Checkra1n (Siguza, axi0mx, littlelailo\n"
|
"sbingner, nikias (libimobiledevice), Checkra1n (Siguza, axi0mx, littlelailo\n"
|
||||||
"et al.), Procursus (Hayden Seay, Cameron Katri, Keto et al.)\n\n"
|
"et al.), Procursus (Hayden Seay, Cameron Katri, Keto et al.)"
|
||||||
"With <3 from C (claration)");
|
);
|
||||||
|
|
||||||
|
auto* credrow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
|
auto* lovetext = new wxStaticText(this, wxID_ANY,
|
||||||
|
#ifdef __APPLE__
|
||||||
|
"With 💖 from C (claration)"
|
||||||
|
#else
|
||||||
|
"With <3 from C (claration)"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
|
auto* link1 = new wxStaticText(this, wxID_ANY, "@palera1n");
|
||||||
|
auto* link2 = new wxStaticText(this, wxID_ANY, "https://palera.in");
|
||||||
|
|
||||||
|
link1->SetForegroundColour(wxColour(0, 120, 215));
|
||||||
|
link2->SetForegroundColour(wxColour(0, 120, 215));
|
||||||
|
|
||||||
|
link1->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||||
|
link2->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||||
|
|
||||||
|
link1->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent&) {
|
||||||
|
wxLaunchDefaultBrowser("https://twitter.com/intent/follow?screen_name=palera1n");
|
||||||
|
});
|
||||||
|
|
||||||
|
link2->Bind(wxEVT_LEFT_DOWN, [](wxMouseEvent&) {
|
||||||
|
wxLaunchDefaultBrowser("https://palera.in");
|
||||||
|
});
|
||||||
|
|
||||||
|
credrow->Add(lovetext, 0, wxALIGN_BOTTOM | wxLEFT, 0);
|
||||||
|
credrow->AddStretchSpacer();
|
||||||
|
|
||||||
|
auto* linkSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
linkSizer->Add(link1, 0, wxALIGN_RIGHT | wxBOTTOM, 0);
|
||||||
|
linkSizer->Add(link2, 0, wxALIGN_RIGHT);
|
||||||
|
|
||||||
|
credrow->Add(linkSizer, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
root->Add(credtext, 0, wxLEFT | wxRIGHT, 10);
|
root->Add(credtext, 0, wxLEFT | wxRIGHT, 10);
|
||||||
|
root->Add(credrow, 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
|
||||||
|
|
||||||
root->Add(new wxStaticLine(this), 0, wxEXPAND | wxALL, 10);
|
root->Add(new wxStaticLine(this), 0, wxEXPAND | wxALL, 10);
|
||||||
|
|
||||||
@@ -119,8 +156,8 @@ MainPanel::MainPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
bottomRow->AddStretchSpacer();
|
bottomRow->AddStretchSpacer();
|
||||||
bottomRow->Add(quickMode, 0, wxRIGHT | wxTOP, 1);
|
bottomRow->Add(quickMode, 0, wxRIGHT | wxTOP, 1);
|
||||||
bottomRow->Add(optionsButton, 0, wxRIGHT | wxLEFT | wxBOTTOM, 10);
|
bottomRow->Add(optionsButton, 0, wxRIGHT | wxLEFT | wxBOTTOM, 12);
|
||||||
bottomRow->Add(m_startButton, 0, wxRIGHT | wxLEFT | wxBOTTOM, 10);
|
bottomRow->Add(m_startButton, 0, wxRIGHT | wxLEFT | wxBOTTOM, 12);
|
||||||
|
|
||||||
root->Add(bottomRow, 0, wxEXPAND);
|
root->Add(bottomRow, 0, wxEXPAND);
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ RecoveryPanel::RecoveryPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
|
|
||||||
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
bottomRow->AddStretchSpacer();
|
bottomRow->AddStretchSpacer();
|
||||||
bottomRow->Add(m_backButton, 0, wxALL, 10);
|
bottomRow->Add(m_backButton, 0, wxALL, 12);
|
||||||
bottomRow->Add(m_nextButton, 0, wxALL, 10);
|
bottomRow->Add(m_nextButton, 0, wxALL, 12);
|
||||||
|
|
||||||
root->AddStretchSpacer();
|
root->AddStretchSpacer();
|
||||||
root->Add(bottomRow, 0, wxEXPAND);
|
root->Add(bottomRow, 0, wxEXPAND);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ SettingsPanel::SettingsPanel(MainFrame* frame, wxWindow* parent)
|
|||||||
|
|
||||||
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
||||||
bottomRow->AddStretchSpacer();
|
bottomRow->AddStretchSpacer();
|
||||||
bottomRow->Add(back, 0, wxALL, 10);
|
bottomRow->Add(back, 0, wxALL, 12);
|
||||||
|
|
||||||
root->Add(bottomRow, 0, wxEXPAND);
|
root->Add(bottomRow, 0, wxEXPAND);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user