Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Select mira on circle button #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package metadata
TITLE := Payload Guest
VERSION := 0.98
VERSION := 0.99
TITLE_ID := AZIF00003
CONTENT_ID := IV0000-AZIF00003_00-PAYLOADGUEST0000
AUTHINFO := 000000000000000000000000001C004000FF000000000080000000000000000000000000000000000000008000400040000000000000008000000000000000080040FFFF000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
1 change: 1 addition & 0 deletions assets/languages/00.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "セレクト",
"selectMira": "セレクト Mira",
"refresh": "リフレッシュ",
"credits": "クレジット",
"return": "戻る",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/01.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Select",
"selectMira": "Select Mira",
"refresh": "Refresh",
"credits": "Credits",
"return": "Return",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/02.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Sélectionner",
"selectMira": "Sélectionner Mira",
"refresh": "Actualiser",
"credits": "Crédits",
"return": "Retour",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/03.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "ok",
"select": "Seleccionar",
"selectMira": "Seleccionar Mira",
"refresh": "Refrescar",
"credits": "Créditos",
"return": "Volver",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/04.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Auswählen",
"selectMira": "Auswählen Mira",
"refresh": "Neu laden",
"credits": "Credits",
"return": "Zurück",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/05.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Seleziona",
"selectMira": "Seleziona Mira",
"refresh": "Refresh",
"credits": "Credits",
"return": "Indietro",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/06.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Selecteer",
"selectMira": "Selecteer Mira",
"refresh": "Herversen",
"credits": "Credits",
"return": "Terug",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/07.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Selecionar",
"selectMira": "Selecionar Mira",
"refresh": "Atualizar",
"credits": "Créditos",
"return": "Voltar",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/08.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "ОК",
"select": "Выбрать",
"selectMira": "Выбрать Mira",
"refresh": "Обновить",
"credits": "Авторы",
"return": "Назад",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/09.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "확정",
"select": "선택",
"selectMira": "선택 Mira",
"refresh": "새로고침",
"credits": "크레딧",
"return": "돌아가기",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/10.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "確認",
"select": "選擇",
"selectMira": "選擇 Mira",
"refresh": "刷新",
"credits": "感謝",
"return": "返回",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/11.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "确定",
"select": "选择",
"selectMira": "选择 Mira",
"refresh": "刷新",
"credits": "感谢",
"return": "返回",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/16.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Wybierz",
"selectMira": "Wybierz Mira",
"refresh": "Odśwież",
"credits": "Autorzy",
"return": "Wstecz",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/17.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Selecionar",
"selectMira": "Selecionar Mira",
"refresh": "Atualizar",
"credits": "Créditos",
"return": "Voltar",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/19.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Tamam",
"select": "Seç",
"selectMira": "Seç Mira",
"refresh": "Yenile",
"credits": "Katkısı Olanlar",
"return": "Geri",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/20.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Aceptar",
"select": "Seleccionar",
"selectMira": "Seleccionar Mira",
"refresh": "Refrescar",
"credits": "Créditos",
"return": "Regresar",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/23.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Zvolit",
"selectMira": "Zvolit Mira",
"refresh": "Obnovit",
"credits": "Zásluhy",
"return": "Zpět",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/24.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Választ",
"selectMira": "Választ Mira",
"refresh": "Frissít",
"credits": "Köszönetlista",
"return": "Vissza",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/25.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Επιλέξτε",
"selectMira": "Επιλέξτε Mira",
"refresh": "Επαναφόρτωση",
"credits": "Συντελεστές",
"return": "Επιστροφή",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/26.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Bine",
"select": "Selectează",
"selectMira": "Selectează Mira",
"refresh": "Reîncarcă",
"credits": "Credite",
"return": "Revenire",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/29.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "Ok",
"select": "Pilih",
"selectMira": "Pilih Mira",
"refresh": "Segarkan",
"credits": "Penghargaan",
"return": "Kembali",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/X21.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

"ok": "موافق",
"select": "إختيار",
"selectMira": "إختيار Mira",
"refresh": "تحديث",
"credits": "",
"return": "رجوع",
Expand Down
19 changes: 19 additions & 0 deletions include/PayloadsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "Graphics.h"
#include "Utility.h"
#include "View.h"
#include "libLog.h"

class Application;
class PayloadsView;
Expand Down Expand Up @@ -74,6 +75,24 @@ class PayloadsView : public View {

void RefreshPayloadList(bool p_Reset);
void CleanupPayloadList(bool p_Reset);

bool sendPayloads(int port = 9020) {
if (m_Payloads.size() > 0) {
if (m_PayloadTimer == 0 || m_PayloadTimer + (5 * 1000000) < sceKernelGetProcessTime()) {
logKernel(LL_Debug, "Loading: %s", m_Payloads[m_PayloadSelected].location.c_str());
// notifi(NULL, "Loading: %s", m_Payloads[m_PayloadSelected].location.c_str()); // Pop notification
if (!Utility::SendPayload(m_App, "127.0.0.1", port, m_Payloads[m_PayloadSelected].location)) { // Send to GoldHEN's loader
Utility::LaunchShellcode(m_App, m_Payloads[m_PayloadSelected].location); // Launch here
}
m_PayloadTimer = sceKernelGetProcessTime();
return true;
} else {
logKernel(LL_Debug, "Skip loading due to timer: %s", m_Payloads[m_PayloadSelected].location.c_str());
return false;
}
}
return false;
}
};

#endif
36 changes: 23 additions & 13 deletions src/PayloadsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,16 @@ int PayloadsView::Update() {
}

if (m_App->Ctrl->GetButtonPressed(ORBIS_PAD_BUTTON_CROSS)) {
if (m_Payloads.size() > 0) {
if (m_PayloadTimer == 0 || m_PayloadTimer + (5 * 1000000) < sceKernelGetProcessTime()) {
logKernel(LL_Debug, "Loading: %s", m_Payloads[m_PayloadSelected].location.c_str());
// notifi(NULL, "Loading: %s", m_Payloads[m_PayloadSelected].location.c_str()); // Pop notification
if (!Utility::SendPayload(m_App, "127.0.0.1", 9090, m_Payloads[m_PayloadSelected].location)) { // Send to GoldHEN's loader
Utility::LaunchShellcode(m_App, m_Payloads[m_PayloadSelected].location); // Launch here
}
RefreshPayloadList(false);
m_PayloadTimer = sceKernelGetProcessTime();
} else {
logKernel(LL_Debug, "Skip loading due to timer: %s", m_Payloads[m_PayloadSelected].location.c_str());
}
bool is_payload_sent = sendPayloads(9020);
if (is_payload_sent) {
RefreshPayloadList(false);
}
}

if (m_App->Ctrl->GetButtonPressed(ORBIS_PAD_BUTTON_CIRCLE)) {
bool is_payload_sent = sendPayloads(9021);
if (is_payload_sent) {
RefreshPayloadList(false);
}
}
}
Expand Down Expand Up @@ -489,20 +487,23 @@ int PayloadsView::Render() {
m_App->Graph->DrawText(ok, m_App->Res->m_Typefaces, icon_x, text_y, m_TextColor, m_TextColor);
} else {
std::string select = m_App->Lang->Get("select");
std::string selectMira = m_App->Lang->Get("selectMira");
std::string refresh = m_App->Lang->Get("refresh");
std::string credit = m_App->Lang->Get("credits");

FontSize selectSize;
FontSize selectMiraSize;
FontSize refreshSize;
FontSize creditSize;

m_App->Graph->SetFontSize(m_App->Res->m_Typefaces, FOOTER_FONT_SIZE);

m_App->Graph->GetTextSize(select, m_App->Res->m_Typefaces, &selectSize);
m_App->Graph->GetTextSize(selectMira, m_App->Res->m_Typefaces, &selectMiraSize);
m_App->Graph->GetTextSize(refresh, m_App->Res->m_Typefaces, &refreshSize);
m_App->Graph->GetTextSize(credit, m_App->Res->m_Typefaces, &creditSize);

int s_IconWidth = (selectSize.width + refreshSize.width + creditSize.width) + (4 * FOOTER_ICON_SIZE) + (4 * FOOTER_TEXT_BORDER);
int s_IconWidth = (selectSize.width + selectMiraSize.width + refreshSize.width + creditSize.width) + (4 * FOOTER_ICON_SIZE) + (4 * FOOTER_TEXT_BORDER);
int s_IconX = (s_ScreenWidth - BORDER_X) - s_IconWidth;
int s_IconY = (s_ScreenHeight - FOOTER_SIZE + 5) + FOOTER_BORDER_Y;
int s_TextY = s_IconY + ((FOOTER_ICON_SIZE / 2) - (selectSize.height / 2));
Expand All @@ -516,6 +517,15 @@ int PayloadsView::Render() {
m_App->Graph->DrawText(select, m_App->Res->m_Typefaces, s_IconX, s_TextY, m_TextColor, m_TextColor);
s_IconX += selectSize.width + FOOTER_FONT_SIZE;

if (m_PayloadTimer == 0 || m_PayloadTimer + (5 * 1000000) < sceKernelGetProcessTime()) {
m_App->Graph->DrawSizedPNG(&m_App->Res->m_Circle, s_IconX, s_IconY, FOOTER_ICON_SIZE, FOOTER_ICON_SIZE);
} else {
m_App->Graph->DrawSizedPNG(&m_App->Res->m_Lock, s_IconX, s_IconY, FOOTER_ICON_SIZE, FOOTER_ICON_SIZE);
}
s_IconX += FOOTER_ICON_SIZE + FOOTER_TEXT_BORDER;
m_App->Graph->DrawText(selectMira, m_App->Res->m_Typefaces, s_IconX, s_TextY, m_TextColor, m_TextColor);
s_IconX += selectMiraSize.width + FOOTER_FONT_SIZE;

m_App->Graph->DrawSizedPNG(&m_App->Res->m_Square, s_IconX, s_IconY, FOOTER_ICON_SIZE, FOOTER_ICON_SIZE);
s_IconX += FOOTER_ICON_SIZE + FOOTER_TEXT_BORDER;
m_App->Graph->DrawText(refresh, m_App->Res->m_Typefaces, s_IconX, s_TextY, m_TextColor, m_TextColor);
Expand Down