mirror of
https://github.com/eliboa/TegraRcmGUI.git
synced 2025-04-29 13:49:26 -04:00
Compare commits
37 commits
Author | SHA1 | Date | |
---|---|---|---|
|
417d212ea9 | ||
|
0e72b97770 | ||
|
2524968059 | ||
|
b6d6f18e6a | ||
|
6c0fb778f4 | ||
|
5c37ceaa97 | ||
|
1786276e52 | ||
|
3be31123e9 | ||
|
7b60923460 | ||
|
2f00e5264b | ||
|
6e4d3a3906 | ||
|
b115ecadb2 | ||
|
781da57c4e | ||
|
27f82da96a | ||
|
42658d7acb | ||
|
ce2d05edd4 | ||
|
5ce7782fab | ||
|
1467953323 | ||
|
6e20afa898 | ||
|
d506aa091c | ||
|
fb2e609b6e | ||
|
638f85281c | ||
|
730afcd0a4 | ||
|
952fb4ec83 | ||
|
cd9d69da30 | ||
|
83b771a186 | ||
|
1fc3004d41 | ||
|
076f041175 | ||
|
b324d94931 | ||
|
65f1d80cda | ||
|
74fa514608 | ||
|
ad20c28501 | ||
|
9c17f65208 | ||
|
56f3e05586 | ||
|
9600f0d081 | ||
|
739bbd3fc9 | ||
|
cfa0dc0eb4 |
40 changed files with 1186 additions and 455 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.vs
|
||||
Output
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "TegraRcmGUI/tools/src/biskeydump"]
|
||||
path = TegraRcmGUI/tools/src/biskeydump
|
||||
url = https://github.com/eliboa/biskeydump
|
41
README.md
41
README.md
|
@ -1,17 +1,27 @@
|
|||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# TegraRcmGUI
|
||||
C++ GUI for [TegraRcmSmash](https://github.com/rajkosto/TegraRcmSmash) by [rajkosto](https://github.com/rajkosto) (payload loader for Nintendo Switch)
|
||||
C++ GUI for [TegraRcmSmash](https://github.com/rajkosto/TegraRcmSmash) by [rajkosto](https://github.com/rajkosto) (Fusée Gelée exploit for Nintendo Switch)
|
||||
|
||||
The RCM exploit only works on "unpatched" units, i.e manufactured before July 2018. To check if your Switch is patched, use https://ismyswitchpatched.com/
|
||||
|
||||
## Features
|
||||
- Inject payloads (such as CFW bootloader, Nand/Key Dumper, etc)
|
||||
- Inject payloads
|
||||
- Manage favorites
|
||||
- Run Linux on your switch (ShofEL2)
|
||||
- Mount device as USB mass storage (read/write from/to SD card only, hold power button down for 10sec to exit)
|
||||
- Option - "Auto inject" : automatically inject payload after selection or/and when the Switch is plugged in RCM mode (does not apply at startup)
|
||||
- Mount device as USB mass storage (read/write from/to SD card & NAND partitions, hold power button down for 5sec to exit)
|
||||
- Dump BIS keys for eMMC content decryption (biskeydump by rajkosto)
|
||||
- Option - "Auto inject" : automatically inject payload after selection or/and when the Switch is plugged in RCM mode
|
||||
- Option - Minimize app to tray & tray icon's context menu
|
||||
- Option - Run app at Windows startup
|
||||
- Install APX device driver (if needed)
|
||||
|
||||

|
||||

|
||||
|
||||
## Download
|
||||
[Latest release](https://github.com/eliboa/TegraRcmGUI/releases/latest) (Windows)
|
||||
|
@ -21,14 +31,29 @@ This UI is **Windows-only**.
|
|||
For other platforms, you can use :
|
||||
- [Fusée Launcher](https://github.com/Cease-and-DeSwitch/fusee-launcher) (GNU/Linux)
|
||||
- [NXBoot](https://mologie.github.io/nxboot/) (OS X, iOS)
|
||||
- [JTegraNX](https://github.com/dylwedma11748/JTegraNX) (Windows, OS X, GNU/Linux)
|
||||
- [NXLoader](https://github.com/DavidBuchanan314/NXLoader) (Android)
|
||||
- [Web Fusée Launcher](https://fusee-gelee.firebaseapp.com/) (Cross-platform, only works with Chrome)
|
||||
|
||||
## Issue / Suggestion
|
||||
Please open new [issue](https://github.com/eliboa/TegraRcmGUI/issues) to report a bug or submit a suggestion.
|
||||
Please open new [issue](https://github.com/eliboa/TegraRcmGUI/issues) to report a bug or submit a suggestion.
|
||||
|
||||
## Development
|
||||
|
||||
Install the [libusbk dev kit](https://sourceforge.net/projects/libusbk/) using the setup program, then create an environment variable `LIBUSBK_DIR` with the installation path as the value.
|
||||
|
||||
## How to backup/restore your Nintendo Switch's NAND ?
|
||||
|
||||
1) Use [memloader](https://github.com/rajkosto/memloader) v3 to mount eMMC on your computer
|
||||
2) Download and open [NxNandManager](https://github.com/eliboa/NxNandManager). Select "File" then "Open drive".
|
||||
3) Select the mounted drive. You can now perform backup/restore operations.
|
||||
|
||||

|
||||
|
||||
## Credits
|
||||
- [Rajkosto](https://github.com/rajkosto) / [TegraRcmSmash](https://github.com/rajkosto/TegraRcmSmash) (Fusée Launcher reimplementation for Windows), [memloader](https://github.com/rajkosto/memloader), SD tool, [biskeydump](https://github.com/rajkosto/biskeydump)
|
||||
- [Kate Temkin](https://github.com/ktemkin) / [Fusée Launcher](https://github.com/Cease-and-DeSwitch/fusee-launcher)
|
||||
- [Rajkosto](https://github.com/rajkosto) / [TegraRcmSmash](https://github.com/rajkosto/TegraRcmSmash) (Fusée Launcher reimplementation for Windows), [memloader](https://github.com/rajkosto/memloader), SD tool
|
||||
- [fail0verflow](https://github.com/fail0verflow) / [ShofEL2](https://github.com/fail0verflow/shofel2) (Boot stack for no-modification, universal code execution and Linux on the Nintendo Switch)
|
||||
- [Rob Fisher](http://come.to/robfisher) / GetRelativeFilename
|
||||
- [SciresM](https://github.com/SciresM) / [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere)
|
||||
- [CTCaer](https://github.com/CTCaer/hekate) / [Hekate](https://github.com/CTCaer/hekate)
|
||||
- [Reisyukaku](https://github.com/Reisyukaku/) / [ReiNX](https://github.com/Reisyukaku/ReiNX)
|
||||
|
|
40
TegraRcmGUI.sln
Normal file
40
TegraRcmGUI.sln
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26228.9
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TegraRcmGUI", "TegraRcmGUI\TegraRcmGUI.vcxproj", "{2C091C5B-378F-44D0-91F2-53489BA7B83C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
Static Debug|x64 = Static Debug|x64
|
||||
Static Debug|x86 = Static Debug|x86
|
||||
Static Release|x64 = Static Release|x64
|
||||
Static Release|x86 = Static Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x64.Build.0 = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x64.ActiveCfg = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x64.Build.0 = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x86.Build.0 = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x64.ActiveCfg = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x64.Build.0 = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x86.Build.0 = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x64.ActiveCfg = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x64.Build.0 = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x86.ActiveCfg = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -142,12 +142,12 @@ BOOL DialogTab01::OnInitDialog()
|
|||
|
||||
BEGIN_MESSAGE_MAP(DialogTab01, CDialog)
|
||||
ON_BN_CLICKED(IDC_BROWSE, &DialogTab01::OnBnClickedBrowse)
|
||||
ON_EN_CHANGE(PAYLOAD_PATH, &CTegraRcmGUIDlg::OnEnChangePath)
|
||||
ON_BN_CLICKED(IDC_INJECT, &DialogTab01::InjectPayload)
|
||||
ON_BN_CLICKED(ID_ADD_FAV, &DialogTab01::OnBnClickedAddFav)
|
||||
ON_BN_CLICKED(ID_DEL_FAV, &DialogTab01::OnBnClickedDelFav)
|
||||
ON_LBN_DBLCLK(IDC_LIST1, &DialogTab01::OnDblclkList1)
|
||||
ON_LBN_SELCHANGE(IDC_LIST1, &DialogTab01::OnLbnSelchangeList1)
|
||||
ON_MESSAGE(DM_GETDEFID, OnGetDefID)
|
||||
ON_WM_CTLCOLOR()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -246,6 +246,7 @@ void DialogTab01::InjectPayload()
|
|||
{
|
||||
m_TegraRcm->BitmapDisplay(LOADED);
|
||||
m_TegraRcm->SendUserMessage("Payload injected !", VALID);
|
||||
m_TegraRcm->AppendLogBox(TEXT("Payload successfully injected\r\n"));
|
||||
m_TegraRcm->WAITING_RECONNECT = TRUE;
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Payload injected"), TEXT(" "), 1000, NIIF_INFO);
|
||||
}
|
||||
|
@ -255,6 +256,10 @@ void DialogTab01::InjectPayload()
|
|||
string s = "Error while injecting payload (RC=" + std::to_string(rc) + ")";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Error"), TEXT("Error while injecting payload"), 1000, NIIF_ERROR);
|
||||
m_TegraRcm->SendUserMessage(s.c_str(), INVALID);
|
||||
CString rc_str;
|
||||
rc_str.Format(L"%d", rc);
|
||||
m_TegraRcm->AppendLogBox(TEXT("Error while injecting payload (RC=") + rc_str + TEXT(")\r\n"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -295,6 +300,7 @@ void DialogTab01::OnBnClickedAddFav()
|
|||
m_TegraRcm->SaveFavorites();
|
||||
|
||||
m_TegraRcm->SendUserMessage("Favorite added", VALID);
|
||||
m_TegraRcm->AppendLogBox(TEXT("New favorite added\r\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -310,6 +316,8 @@ void DialogTab01::OnBnClickedDelFav()
|
|||
m_TegraRcm->Favorites.RemoveAt(i);
|
||||
m_TegraRcm->SaveFavorites();
|
||||
m_TegraRcm->SendUserMessage("Favorite removed", VALID);
|
||||
m_TegraRcm->AppendLogBox(TEXT("Favorite removed\r\n"));
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -357,3 +365,7 @@ HBRUSH DialogTab01::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
|||
}
|
||||
return hbr;
|
||||
}
|
||||
LRESULT DialogTab01::OnGetDefID(WPARAM wp, LPARAM lp)
|
||||
{
|
||||
return MAKELONG(0, DC_HASDEFID);
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
#include <string>
|
||||
#include "TegraRcmGUIDlg.h"
|
||||
#include "TegraRcm.h"
|
||||
#include "afxole.h"
|
||||
|
||||
// DialogTab01 dialog
|
||||
|
||||
|
@ -19,7 +20,7 @@ public:
|
|||
#endif
|
||||
TCHAR* PAYLOAD_FILE;
|
||||
BOOL PREVENT_AUTOINJECT = TRUE;
|
||||
BOOL DELAY_AUTOINJECT = FALSE;
|
||||
BOOL DELAY_AUTOINJECT = TRUE;
|
||||
CArray <CString, CString> m_ListBox;
|
||||
int m_SelectedItem = -1;
|
||||
CFont m_BoldFont;
|
||||
|
@ -38,4 +39,6 @@ public:
|
|||
afx_msg void OnDblclkList1();
|
||||
afx_msg void OnLbnSelchangeList1();
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
COleDropTarget FileDropTarget;
|
||||
afx_msg LRESULT OnGetDefID(WPARAM wp, LPARAM lp);
|
||||
};
|
||||
|
|
|
@ -29,7 +29,8 @@ SOFTWARE.
|
|||
#include "TegraRcmGUI.h"
|
||||
#include "afxdialogex.h"
|
||||
#include "DialogTab02.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <codecvt>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -58,6 +59,7 @@ BEGIN_MESSAGE_MAP(DialogTab02, CDialogEx)
|
|||
ON_BN_CLICKED(IDC_SHOFEL2, &DialogTab02::OnBnClickedShofel2)
|
||||
// ON_WM_CTLCOLOR()
|
||||
ON_WM_CTLCOLOR()
|
||||
ON_BN_CLICKED(IDC_DUMP_BISKEY, &DialogTab02::OnBnClickedDumpBiskey)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
|
@ -92,6 +94,16 @@ BOOL DialogTab02::OnInitDialog()
|
|||
);
|
||||
pBtn->SetIcon(hIcn);
|
||||
|
||||
pBtn = (CButton*)GetDlgItem(IDC_DUMP_BISKEY);
|
||||
pBtn->ModifyStyle(0, BS_ICON);
|
||||
hIcn = (HICON)LoadImage(
|
||||
AfxGetApp()->m_hInstance,
|
||||
MAKEINTRESOURCE(ID_KEYS_ICON),
|
||||
IMAGE_ICON,
|
||||
height, height, // use actual size
|
||||
LR_DEFAULTCOLOR
|
||||
);
|
||||
pBtn->SetIcon(hIcn);
|
||||
|
||||
CFont* pFont = GetFont();
|
||||
LOGFONT lf;
|
||||
|
@ -99,21 +111,57 @@ BOOL DialogTab02::OnInitDialog()
|
|||
lf.lfWeight = FW_BOLD;
|
||||
m_BoldFont.CreateFontIndirect(&lf);
|
||||
|
||||
CComboBox* pmyComboBox = (CComboBox*)GetDlgItem(ID_UMS_COMBO);
|
||||
pmyComboBox->AddString(TEXT("eMMC BOOT0 (DANGEROUS)"));
|
||||
pmyComboBox->AddString(TEXT("eMMC BOOT1 (DANGEROUS)"));
|
||||
pmyComboBox->AddString(TEXT("eMMC rawNAND (DANGEROUS)"));
|
||||
pmyComboBox->AddString(TEXT("MMC - SD Card"));
|
||||
pmyComboBox->SetCurSel(3);
|
||||
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void DialogTab02::OnBnClickedMountSd()
|
||||
{
|
||||
CComboBox* pmyComboBox = (CComboBox*)GetDlgItem(ID_UMS_COMBO);
|
||||
if (pmyComboBox->GetCurSel() < 3) {
|
||||
CString message = _T("-----> WARNING <-----\nYou are about to mount internal storage of your Nintendo Switch\nBE VERY CAREFUL ! Do not format or write to your NAND partitions if you don't know what you're doing.\nTHIS COULD BRICK YOUR CONSOLE !!!\n\nAre you really sure you want to continue ?");
|
||||
const int result = MessageBox(message, _T("BEWARE & WARNING"), MB_YESNO | MB_ICONWARNING);
|
||||
if (result != IDYES) {
|
||||
m_TegraRcm->AppendLogBox(TEXT("Mount NAND partition ABORTED\r\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_TegraRcm->BitmapDisplay(LOADING);
|
||||
GetParent()->UpdateWindow();
|
||||
string s;
|
||||
TCHAR args[] = TEXT("memloader\\memloader_usb.bin -r --dataini=memloader\\ums_sd.ini");
|
||||
int rc = m_TegraRcm->Smasher(args);
|
||||
if (rc < 0)
|
||||
|
||||
|
||||
TCHAR args[256];
|
||||
switch (pmyComboBox->GetCurSel())
|
||||
{
|
||||
case 0:
|
||||
_tcscpy_s(args, 255, TEXT(".\\tools\\memloader\\memloader_usb.bin -r --dataini=.\\tools\\memloader\\ums_boot0.ini"));
|
||||
break;
|
||||
case 1:
|
||||
_tcscpy_s(args, 255, TEXT(".\\tools\\memloader\\memloader_usb.bin -r --dataini=.\\tools\\memloader\\ums_boot1.ini"));
|
||||
break;
|
||||
case 2:
|
||||
_tcscpy_s(args, 255, TEXT(".\\tools\\memloader\\memloader_usb.bin -r --dataini=.\\tools\\memloader\\ums_emmc.ini"));
|
||||
break;
|
||||
default:
|
||||
_tcscpy_s(args, 255, TEXT(".\\tools\\memloader\\memloader_usb.bin -r --dataini=.\\tools\\memloader\\ums_sd.ini"));
|
||||
break;
|
||||
}
|
||||
|
||||
int rc = m_TegraRcm->Smasher(args, FALSE);
|
||||
if (rc < -10)
|
||||
{
|
||||
m_TegraRcm->BitmapDisplay(LOAD_ERROR);
|
||||
s = "Error while injecting payload (RC=" + std::to_string(rc) + ")";
|
||||
s = "Error while injecting UMS Tool (RC=" + std::to_string(rc) + ")";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Error"), TEXT("Error while injecting payload"), 1000, NIIF_ERROR);
|
||||
}
|
||||
else
|
||||
|
@ -122,8 +170,10 @@ void DialogTab02::OnBnClickedMountSd()
|
|||
s = "UMS Tool injected";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("UMS Tool injected"), TEXT(" "), 1000, NIIF_INFO);
|
||||
}
|
||||
CA2T wt(s.c_str());
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, wt);
|
||||
//CA2T wt(s.c_str());
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, wt);
|
||||
CString ss(s.c_str());
|
||||
m_TegraRcm->AppendLogBox(ss + TEXT("\r\n"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,8 +182,8 @@ void DialogTab02::OnBnClickedShofel2()
|
|||
TCHAR *exe_dir = m_TegraRcm->GetAbsolutePath(TEXT(""), CSIDL_APPDATA);
|
||||
|
||||
string s;
|
||||
TCHAR *COREBOOT_FILE = m_TegraRcm->GetAbsolutePath(TEXT("shofel2\\coreboot\\coreboot.rom"), CSIDL_APPDATA);
|
||||
TCHAR *PAYLOAD = m_TegraRcm->GetAbsolutePath(TEXT("shofel2\\coreboot\\cbfs.bin"), CSIDL_APPDATA);
|
||||
TCHAR *COREBOOT_FILE = m_TegraRcm->GetAbsolutePath(TEXT("tools\\shofel2\\coreboot\\coreboot.rom"), CSIDL_APPDATA);
|
||||
TCHAR *PAYLOAD = m_TegraRcm->GetAbsolutePath(TEXT("tools\\shofel2\\coreboot\\cbfs.bin"), CSIDL_APPDATA);
|
||||
CString COREBOOT_FILE2 = COREBOOT_FILE;
|
||||
CString COREBOOT = _T("CBFS+") + COREBOOT_FILE2;
|
||||
|
||||
|
@ -143,7 +193,9 @@ void DialogTab02::OnBnClickedShofel2()
|
|||
BOOL payload_exists = infile2.good();
|
||||
|
||||
if (!coreboot_exists || !payload_exists) {
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Linux coreboot not found in \\shofel2 dir"));
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Linux coreboot not found in \\shofel2 dir"));
|
||||
m_TegraRcm->AppendLogBox(TEXT("Linux coreboot not found in \\shofel2 di\r\n"));
|
||||
|
||||
CString message = _T("Kernel not found in shofel2 directory. Do you want to automatically download arch linux kernel from SoulCipher repo ?");
|
||||
const int result = MessageBox(message, _T("Kernel not found"), MB_YESNOCANCEL | MB_ICONQUESTION);
|
||||
if (result == IDYES)
|
||||
|
@ -152,34 +204,39 @@ void DialogTab02::OnBnClickedShofel2()
|
|||
STARTUPINFO si;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
TCHAR *download_script = m_TegraRcm->GetAbsolutePath(TEXT("shofel2\\download.bat"), CSIDL_APPDATA);
|
||||
TCHAR *download_script = m_TegraRcm->GetAbsolutePath(TEXT("tools\\shofel2\\download.bat"), CSIDL_APPDATA);
|
||||
BOOL bRet = CreateProcess(download_script, NULL, NULL, NULL, FALSE, 0, NULL, exe_dir, &si, &pif);
|
||||
}
|
||||
return; // TO-DO : Remove return for coreboot injection after download
|
||||
}
|
||||
m_TegraRcm->BitmapDisplay(LOADING);
|
||||
GetParent()->UpdateWindow();
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Loading coreboot. Please wait."));
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Loading coreboot. Please wait."));
|
||||
m_TegraRcm->AppendLogBox(TEXT("Linux coreboot not found in \\shofel2 di\r\n"));
|
||||
|
||||
|
||||
//int rc = device.SmashMain(5, args);
|
||||
TCHAR cmd[MAX_PATH] = TEXT("--relocator= \"");
|
||||
TCHAR cmd[4096] = TEXT("--relocator= \"");
|
||||
lstrcat(cmd, _tcsdup(PAYLOAD));
|
||||
lstrcat(cmd, TEXT("\" \"CBFS:"));
|
||||
lstrcat(cmd, _tcsdup(COREBOOT_FILE));
|
||||
lstrcat(cmd, TEXT("\""));
|
||||
int rc = m_TegraRcm->Smasher(cmd);
|
||||
|
||||
int rc = m_TegraRcm->Smasher(cmd, FALSE);
|
||||
int test = 1;
|
||||
if (rc >= 0 || rc < -7)
|
||||
{
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Coreboot injected. Waiting 5s for device..."));
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Coreboot injected. Waiting 5s for device..."));
|
||||
m_TegraRcm->AppendLogBox(TEXT("Coreboot injected. Waiting 5s for device...\r\n"));
|
||||
Sleep(5000);
|
||||
|
||||
PROCESS_INFORMATION pif;
|
||||
STARTUPINFO si;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
TCHAR *imx_script = m_TegraRcm->GetAbsolutePath(TEXT("shofel2\\imx_usb.bat"), CSIDL_APPDATA);
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Loading coreboot... Please wait."));
|
||||
TCHAR *imx_script = m_TegraRcm->GetAbsolutePath(TEXT("tools\\shofel2\\imx_usb.bat"), CSIDL_APPDATA);
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, TEXT("Loading coreboot... Please wait."));
|
||||
m_TegraRcm->AppendLogBox(TEXT("Loading coreboot... Please wait\r\n"));
|
||||
|
||||
BOOL ret = CreateProcess(imx_script, NULL, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, exe_dir, &si, &pif);
|
||||
int rc = -50;
|
||||
if (NULL != ret)
|
||||
|
@ -200,21 +257,27 @@ void DialogTab02::OnBnClickedShofel2()
|
|||
m_TegraRcm->BitmapDisplay(LOADED);
|
||||
s = "\nCoreboot loaded !";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Coreboot loaded "), TEXT(" "), 1000, NIIF_INFO);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_TegraRcm->BitmapDisplay(LOAD_ERROR);
|
||||
s = "Error while loading imx_usb.exe";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Error"), TEXT("Error while loading imx_usb.exe"), 1000, NIIF_ERROR);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s = "Error while injecting payload. (RC=" + std::to_string(rc) + ")";
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Error"), TEXT("Error while injecting payload"), 1000, NIIF_ERROR);
|
||||
|
||||
}
|
||||
CA2T wt2(s.c_str());
|
||||
GetParent()->SetDlgItemText(INFO_LABEL, wt2);
|
||||
//CA2T wt2(s.c_str());
|
||||
//GetParent()->SetDlgItemText(INFO_LABEL, wt2);
|
||||
CString ss(s.c_str());
|
||||
m_TegraRcm->AppendLogBox(ss + TEXT("\r\n"));
|
||||
|
||||
}
|
||||
|
||||
HBRUSH DialogTab02::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
||||
|
@ -225,8 +288,98 @@ HBRUSH DialogTab02::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
|||
{
|
||||
case ID_UMSTOOL_TITLE:
|
||||
case ID_LINUX_TITLE:
|
||||
case ID_BISKEY_TITLE:
|
||||
pDC->SelectObject(&m_BoldFont);
|
||||
break;
|
||||
}
|
||||
return hbr;
|
||||
}
|
||||
|
||||
|
||||
void DialogTab02::OnBnClickedDumpBiskey()
|
||||
{
|
||||
|
||||
|
||||
m_TegraRcm->BitmapDisplay(LOADING);
|
||||
GetParent()->UpdateWindow();
|
||||
TCHAR args[] = TEXT("-w tools\\biskeydump_usb.bin BOOT:0x0");
|
||||
int rc = m_TegraRcm->Smasher(args);
|
||||
|
||||
BOOL keyFound = FALSE;
|
||||
TCHAR *rfile = m_TegraRcm->GetAbsolutePath(TEXT("out.log"), CSIDL_APPDATA);
|
||||
CString Cline;
|
||||
std::wifstream fin(rfile, std::ios::binary);
|
||||
fin.imbue(std::locale(fin.getloc(), new std::codecvt_utf8_utf16<wchar_t>));
|
||||
CString Filename;
|
||||
for (wchar_t c; fin.get(c); ) {
|
||||
CString Cchar(c);
|
||||
if (Cchar == TEXT("\n")) {
|
||||
|
||||
if (Cline.Find(TEXT("HWI")) != -1 ||
|
||||
Cline.Find(TEXT("SBK")) != -1 ||
|
||||
Cline.Find(TEXT("TSEC KEY")) != -1 ||
|
||||
Cline.Find(TEXT("BIS KEY")) != -1) {
|
||||
|
||||
if (!keyFound)
|
||||
{
|
||||
keyFound = TRUE;
|
||||
|
||||
CString szFilter;
|
||||
szFilter = "TXT files (*.txt)|*.txt|All files (*.*)|*.*||";
|
||||
|
||||
CFileDialog FileOpenDialog(
|
||||
FALSE,
|
||||
NULL,
|
||||
TEXT("BIS_keys.txt"),
|
||||
OFN_HIDEREADONLY,
|
||||
szFilter,
|
||||
AfxGetMainWnd());
|
||||
|
||||
if (FileOpenDialog.DoModal() == IDOK)
|
||||
{
|
||||
CFile File;
|
||||
Filename = FileOpenDialog.GetPathName();
|
||||
remove(CT2A(Filename));
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
CT2CA pszConvertedAnsiString(Cline + _T('\n'));
|
||||
std::string outLine = pszConvertedAnsiString;
|
||||
fstream outFile;
|
||||
outFile.open(Filename, fstream::in | fstream::out | fstream::app);
|
||||
outFile << outLine;
|
||||
outFile.close();
|
||||
|
||||
}
|
||||
Cline.Empty();
|
||||
}
|
||||
else if (Cchar != TEXT("\r") && Cchar != TEXT("")) {
|
||||
Cline.Append(Cchar);
|
||||
}
|
||||
}
|
||||
fin.close();
|
||||
|
||||
|
||||
CString s;
|
||||
if (!keyFound)
|
||||
{
|
||||
m_TegraRcm->BitmapDisplay(LOAD_ERROR);
|
||||
s.Append(TEXT("Error while retrieving BIS keys"));
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(TEXT("Error"), s, 1000, NIIF_ERROR);
|
||||
s.Append(TEXT("\r\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_TegraRcm->BitmapDisplay(LOADED);
|
||||
CString loc(Filename);
|
||||
s.Append(TEXT("BIS keys saved to : "));
|
||||
s.Append(loc);
|
||||
if (!m_TegraRcm->CmdShow) m_TegraRcm->ShowTrayIconBalloon(s, TEXT(" "), 1000, NIIF_INFO);
|
||||
s.Append(TEXT("\r\n"));
|
||||
|
||||
}
|
||||
m_TegraRcm->AppendLogBox(s);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "TegraRcm.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// DialogTab02 dialog
|
||||
|
||||
class DialogTab02 :
|
||||
|
@ -33,4 +35,5 @@ public:
|
|||
// HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
afx_msg void OnBnClickedDumpBiskey();
|
||||
};
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
/*
|
||||
DialogTab03.cpp
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright(c) 2018 eliboa
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "TegraRcmGUI.h"
|
||||
#include "DialogTab03.h"
|
||||
|
@ -55,6 +27,7 @@ void DialogTab03::DoDataExchange(CDataExchange* pDX)
|
|||
BOOL DialogTab03::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
CleanRegestry();
|
||||
|
||||
string value = m_TegraRcm->GetPreset("AUTO_INJECT");
|
||||
if (value == "TRUE")
|
||||
|
@ -72,25 +45,26 @@ BOOL DialogTab03::OnInitDialog()
|
|||
checkbox->SetCheck(BST_CHECKED);
|
||||
}
|
||||
|
||||
HKEY hKey;
|
||||
const std::string key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
||||
const std::string subkey = "TegraRcmGUI";
|
||||
|
||||
// Open Run Registry location
|
||||
LONG lnRes = RegOpenKeyExA(HKEY_CURRENT_USER,
|
||||
key.c_str(), 0, KEY_READ, &hKey);
|
||||
|
||||
if (ERROR_SUCCESS == lnRes)
|
||||
value = m_TegraRcm->GetPreset("LOGGING");
|
||||
if (value == "TRUE")
|
||||
{
|
||||
lnRes = RegQueryValueExA(hKey, subkey.c_str(), NULL, NULL, NULL, NULL);
|
||||
if (lnRes != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
m_TegraRcm->LOGGING_CURR = TRUE;
|
||||
CMFCButton* checkbox = (CMFCButton*)GetDlgItem(LOGGING);
|
||||
checkbox->SetCheck(BST_CHECKED);
|
||||
}
|
||||
|
||||
TCHAR szPath[MAX_PATH];
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, szPath)))
|
||||
{
|
||||
PathAppend(szPath, _T("\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\TegraRcmGUI.lnk"));
|
||||
std::ifstream infile(szPath);
|
||||
if (infile.good()) {
|
||||
infile.close();
|
||||
CMFCButton*checkbox = (CMFCButton*)GetDlgItem(RUN_WINSTART);
|
||||
checkbox->SetCheck(BST_CHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
@ -100,6 +74,8 @@ BEGIN_MESSAGE_MAP(DialogTab03, CDialogEx)
|
|||
ON_BN_CLICKED(MIN_TO_TRAY, &DialogTab03::OnClickedMinToTray)
|
||||
ON_BN_CLICKED(ID_INSTALL_DRIVER, &DialogTab03::OnBnClickedInstallDriver)
|
||||
ON_BN_CLICKED(RUN_WINSTART, &DialogTab03::OnBnClickedWinstart)
|
||||
ON_BN_CLICKED(LOGGING, &DialogTab03::OnClickedLogging)
|
||||
//ON_BN_CLICKED(IDC_BUTTON2, &DialogTab03::OnBnClickedButton2)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
|
@ -146,6 +122,20 @@ void DialogTab03::OnClickedMinToTray()
|
|||
}
|
||||
|
||||
|
||||
void DialogTab03::OnClickedLogging()
|
||||
{
|
||||
// Get Minimize to tray checkbox value (checked, unchecked)
|
||||
CButton* m_ctlCheck = (CButton*)GetDlgItem(LOGGING);
|
||||
BOOL IsCheckChecked = (m_ctlCheck->GetCheck() == 1) ? true : false;
|
||||
if (m_TegraRcm->LOGGING_CURR != IsCheckChecked)
|
||||
{
|
||||
if (IsCheckChecked) m_TegraRcm->SetPreset("LOGGING", "TRUE");
|
||||
else m_TegraRcm->SetPreset("LOGGING", "FALSE");
|
||||
m_TegraRcm->LOGGING_CURR = IsCheckChecked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DialogTab03::OnBnClickedInstallDriver()
|
||||
{
|
||||
m_TegraRcm->InstallDriver();
|
||||
|
@ -166,48 +156,99 @@ void DialogTab03::OnBnClickedWinstart()
|
|||
|
||||
// Get application absolute path
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
// Convert path to ANSI string
|
||||
int size = WideCharToMultiByte(CP_UTF8, 0, szPath, -1, NULL, 0, NULL, NULL);
|
||||
if (size > 0) {
|
||||
buffer.resize(size);
|
||||
WideCharToMultiByte(CP_UTF8, 0, szPath, -1, (LPSTR)(&buffer[0]), buffer.size(), NULL, NULL);
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, szPath)))
|
||||
{
|
||||
// Remove shortcut
|
||||
PathAppend(szPath, _T("\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\TegraRcmGUI.lnk"));
|
||||
if(remove(CW2A(szPath)) == 0) m_TegraRcm->AppendLogBox(TEXT("Winstart shortcut REMOVED\r\n"));
|
||||
}
|
||||
std::string appPath(&buffer[0]);
|
||||
std::string keyValue;
|
||||
keyValue.append("\"");
|
||||
keyValue.append(appPath);
|
||||
keyValue.append("\" /autostart");
|
||||
|
||||
|
||||
// Create new shortcut
|
||||
if (IsCheckChecked) {
|
||||
CreateLink();
|
||||
m_TegraRcm->AppendLogBox(TEXT("Winstart shortcut ADDED\r\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DialogTab03::CreateLink()
|
||||
{
|
||||
TCHAR szAppPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szAppPath, _MAX_PATH));
|
||||
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, szPath)))
|
||||
{
|
||||
PathAppend(szPath, _T("\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\TegraRcmGUI.lnk"));
|
||||
}
|
||||
CoInitializeEx(NULL, 0);
|
||||
HRESULT hres = 0;
|
||||
IShellLink* psl;
|
||||
if (SUCCEEDED(hres)) {
|
||||
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLink, (LPVOID*)&psl);
|
||||
if (SUCCEEDED(hres)) {
|
||||
IPersistFile* ppf;
|
||||
|
||||
// Set the path to the shortcut target and add the description.
|
||||
//PathAppend(szPath, _T("\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\TegraRcmGUI.lnk"));
|
||||
|
||||
psl->SetPath(szAppPath);
|
||||
psl->SetArguments(_T("/autostart"));
|
||||
psl->SetDescription(L"TegraRcmGUI");
|
||||
psl->SetIconLocation(szAppPath, 0);
|
||||
|
||||
CString csPath, csPathf(szAppPath);
|
||||
int nIndex = csPathf.ReverseFind(_T('\\'));
|
||||
if (nIndex > 0) csPath = csPathf.Left(nIndex);
|
||||
else csPath.Empty();
|
||||
psl->SetWorkingDirectory(csPath);
|
||||
|
||||
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
|
||||
if (SUCCEEDED(hres)) {
|
||||
hres = ppf->Save(szPath, TRUE);
|
||||
ppf->Release();
|
||||
}
|
||||
psl->Release();
|
||||
}
|
||||
|
||||
}
|
||||
CoUninitialize();
|
||||
}
|
||||
|
||||
void DialogTab03::CleanRegestry() {
|
||||
HKEY hKey;
|
||||
const std::string key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
||||
const std::string subkey = "TegraRcmGUI";
|
||||
|
||||
// Open Run Registry location
|
||||
LONG lnRes = RegOpenKeyEx(HKEY_CURRENT_USER,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),
|
||||
0L, KEY_WRITE,
|
||||
&hKey);
|
||||
LONG lnRes = RegOpenKeyExA(HKEY_CURRENT_USER,
|
||||
key.c_str(), 0, KEY_READ, &hKey);
|
||||
|
||||
if (ERROR_SUCCESS == lnRes)
|
||||
{
|
||||
if (IsCheckChecked)
|
||||
lnRes = RegQueryValueExA(hKey, subkey.c_str(), NULL, NULL, NULL, NULL);
|
||||
if (lnRes != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
// Set full application path with a keyname to registry
|
||||
lnRes = RegSetValueExA(hKey,
|
||||
key.c_str(),
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)(keyValue.c_str()),
|
||||
keyValue.size() + 1);
|
||||
//Remove regestry value
|
||||
lnRes = RegOpenKeyEx(HKEY_CURRENT_USER,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),
|
||||
0L, KEY_WRITE,
|
||||
&hKey);
|
||||
|
||||
if (lnRes != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
//Remove regestry value
|
||||
lnRes = RegDeleteValueA(hKey, subkey.c_str());
|
||||
|
||||
// Create new shortcut
|
||||
CreateLink();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lnRes = RegDeleteValueA(hKey, key.c_str());
|
||||
}
|
||||
if (ERROR_SUCCESS != lnRes)
|
||||
{
|
||||
AfxMessageBox(_T("Failed to set/unset at startup"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AfxMessageBox(_T("Failed to access registry"));
|
||||
}
|
||||
}
|
||||
/*
|
||||
void DialogTab03::OnBnClickedButton2()
|
||||
{
|
||||
m_TegraRcm->SetLocale();
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,19 @@
|
|||
#include "TegraRcmGUIDlg.h"
|
||||
#include "TegraRcm.h"
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <Windows.h>
|
||||
#include <shlobj.h>
|
||||
#include <winnls.h>
|
||||
#include <shobjidl.h>
|
||||
#include <objbase.h>
|
||||
#include <objidl.h>
|
||||
#include <shlguid.h>
|
||||
#include <atlbase.h>
|
||||
#include <atlconv.h>
|
||||
|
||||
|
||||
|
||||
// DialogTab03 dialog
|
||||
|
||||
class DialogTab03 : public CDialogEx
|
||||
|
@ -31,5 +44,8 @@ public:
|
|||
afx_msg void OnClickedMinToTray();
|
||||
afx_msg void OnBnClickedInstallDriver();
|
||||
afx_msg void OnBnClickedWinstart();
|
||||
afx_msg void OnClickedLogging();
|
||||
void CreateLink();
|
||||
afx_msg void CleanRegestry();
|
||||
|
||||
};
|
||||
|
|
|
@ -27,6 +27,9 @@ SOFTWARE.
|
|||
#include <stdlib.h>
|
||||
#include "stdafx.h"
|
||||
#include "TegraRcm.h"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <codecvt>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -34,8 +37,9 @@ TegraRcm::TegraRcm(CDialog* pParent /*=NULL*/)
|
|||
{
|
||||
m_Parent = pParent;
|
||||
m_hWnd = AfxGetMainWnd()->GetSafeHwnd();
|
||||
this->LOGGING_CURR = GetPreset("LOGGING") == "TRUE";
|
||||
GetFavorites();
|
||||
SendUserMessage("Waiting for device in RCM mode");
|
||||
//SendUserMessage("Waiting for device in RCM mode");
|
||||
}
|
||||
|
||||
TegraRcm::~TegraRcm()
|
||||
|
@ -256,7 +260,7 @@ void TegraRcm::ShowContextMenu(HWND hWnd)
|
|||
DestroyMenu(hMenu);
|
||||
}
|
||||
}
|
||||
LRESULT TegraRcm::OnTrayIconEvent(UINT wParam, LPARAM lParam)
|
||||
LRESULT TegraRcm::OnTrayIconEvent(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if ((UINT)wParam != ID_SYSTEMTRAY)
|
||||
{
|
||||
|
@ -303,6 +307,89 @@ LRESULT TegraRcm::OnTrayIconEvent(UINT wParam, LPARAM lParam)
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
void TegraRcm::SetLocale()
|
||||
{
|
||||
TCHAR *rfile = GetAbsolutePath(TEXT("locale\\french.txt"), CSIDL_APPDATA);
|
||||
std::wifstream wif(rfile);
|
||||
wif.imbue(std::locale(std::locale::empty(), new std::codecvt_utf8<wchar_t>));
|
||||
if (wif.is_open())
|
||||
{
|
||||
wif.seekg(0, std::ios::beg);
|
||||
std::wstring wline;
|
||||
std::wstring stringName;
|
||||
std::wstring value;
|
||||
std::wstring delimiter = L"=";
|
||||
|
||||
while (wif.good())
|
||||
{
|
||||
std::getline(wif, wline);
|
||||
if (!wif.eof())
|
||||
{
|
||||
if (wline.find(delimiter) != std::string::npos) {
|
||||
stringName = wline.substr(0, wline.find(delimiter));
|
||||
value = wline.substr(wline.find(delimiter) + 1, wline.length() + 1);
|
||||
CString value2 = value.c_str();
|
||||
value2.Replace(_T('#'), '\n');
|
||||
int intValue = stoi(stringName.c_str());;
|
||||
if (intValue > 0) {
|
||||
|
||||
//TCITEM tcItem1;
|
||||
//tcItem1.mask = TCIF_TEXT;
|
||||
//tcItem1.pszText = _T("Test");
|
||||
|
||||
//AfxGetMainWnd()->m_tbCtrl->
|
||||
//m_tbCtrl.InsertItem(0, &tcItem1);
|
||||
//m_Ctrltb1->SetWindowText(_T("test"));
|
||||
|
||||
|
||||
if (m_Ctrltb1->GetDlgItem(intValue)) {
|
||||
m_Ctrltb1->SetDlgItemText(intValue, value2);
|
||||
}
|
||||
if (m_Ctrltb2->GetDlgItem(intValue)) {
|
||||
m_Ctrltb2->SetDlgItemText(intValue, value2);
|
||||
}
|
||||
if (m_Ctrltb3->GetDlgItem(intValue)) {
|
||||
m_Ctrltb3->SetDlgItemText(intValue, value2);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wif.close();
|
||||
}
|
||||
}
|
||||
|
||||
void TegraRcm::AppendLogBox(CString line) {
|
||||
CEdit* pBox = (CEdit*)AfxGetMainWnd()->GetDlgItem(IDC_LOG_BOX);
|
||||
CString Content;
|
||||
pBox->GetWindowText(Content);
|
||||
Content.Append(line);
|
||||
AfxGetMainWnd()->SetDlgItemText(IDC_LOG_BOX, Content);
|
||||
pBox->LineScroll(pBox->GetLineCount());
|
||||
AfxGetMainWnd()->UpdateWindow();
|
||||
|
||||
}
|
||||
void TegraRcm::UpdateLogBox() {
|
||||
TCHAR *rfile = GetAbsolutePath(TEXT("out.log"), CSIDL_APPDATA);
|
||||
CString Cline;
|
||||
std::wifstream fin(rfile, std::ios::binary);
|
||||
fin.imbue(std::locale(fin.getloc(), new std::codecvt_utf8_utf16<wchar_t>));
|
||||
for (wchar_t c; fin.get(c); ) {
|
||||
CString Cchar(c);
|
||||
if (Cchar == TEXT("\n")) {
|
||||
Cline.Append(TEXT("\r\n"));
|
||||
AppendLogBox(Cline);
|
||||
Cline.Empty();
|
||||
}
|
||||
else if(Cchar != TEXT("\r")) {
|
||||
Cline.Append(Cchar);
|
||||
}
|
||||
}
|
||||
fin.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Presets functions
|
||||
|
@ -356,6 +443,10 @@ void TegraRcm::SetPreset(string param, string value)
|
|||
readFile.close();
|
||||
remove(CT2A(rfile));
|
||||
rename(CT2A(wfile), CT2A(rfile));
|
||||
|
||||
CString paramStr(param.c_str()), valueStr(value.c_str());
|
||||
AppendLogBox(TEXT("Preset \"") + paramStr + TEXT("\" set to : ") + valueStr + TEXT("\r\n"));
|
||||
|
||||
}
|
||||
void TegraRcm::GetFavorites()
|
||||
{
|
||||
|
@ -436,6 +527,7 @@ void TegraRcm::AddFavorite(CString value)
|
|||
outFile.open(GetAbsolutePath(TEXT("favorites.conf"), CSIDL_APPDATA), fstream::in | fstream::out | fstream::app);
|
||||
outFile << outLine;
|
||||
outFile.close();
|
||||
|
||||
}
|
||||
void TegraRcm::SaveFavorites()
|
||||
{
|
||||
|
@ -452,8 +544,7 @@ void TegraRcm::SaveFavorites()
|
|||
void TegraRcm::AppendLog(string message)
|
||||
{
|
||||
|
||||
// DISABLED
|
||||
return;
|
||||
if (!this->LOGGING_CURR) return;
|
||||
|
||||
|
||||
// Get time
|
||||
|
@ -492,8 +583,13 @@ void TegraRcm::SendUserMessage(string message, int type)
|
|||
LabelColor = RGB(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
AfxGetMainWnd()->SetDlgItemText(INFO_LABEL, wmessage);
|
||||
//AfxGetMainWnd()->SetDlgItemText(INFO_LABEL, wmessage);
|
||||
AppendLog(message);
|
||||
/*
|
||||
CString msgStr(message.c_str());
|
||||
msgStr.Append(TEXT("\r\n"));
|
||||
AppendLogBox(msgStr);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -608,7 +704,6 @@ void TegraRcm::BitmapDisplay(int IMG)
|
|||
//
|
||||
void TegraRcm::LookUp()
|
||||
{
|
||||
|
||||
// Exit when PAUSE_LKP_DEVICE flag is TRUE
|
||||
if (PAUSE_LKP_DEVICE) return;
|
||||
|
||||
|
@ -623,7 +718,9 @@ void TegraRcm::LookUp()
|
|||
m_Ctrltb1->GetDlgItem(IDC_INJECT)->EnableWindow(TRUE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_SHOFEL2)->EnableWindow(TRUE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_MOUNT_SD)->EnableWindow(TRUE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_DUMP_BISKEY)->EnableWindow(TRUE);
|
||||
m_Ctrltb3->GetDlgItem(ID_INSTALL_DRIVER)->EnableWindow(FALSE);
|
||||
|
||||
|
||||
}
|
||||
// RCM Status = "USB Driver KO"
|
||||
|
@ -632,6 +729,7 @@ void TegraRcm::LookUp()
|
|||
m_Ctrltb1->GetDlgItem(IDC_INJECT)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_SHOFEL2)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_MOUNT_SD)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_DUMP_BISKEY)->EnableWindow(FALSE);
|
||||
m_Ctrltb3->GetDlgItem(ID_INSTALL_DRIVER)->EnableWindow(TRUE);
|
||||
}
|
||||
// RCM Status = "RCM not detected"
|
||||
|
@ -640,13 +738,14 @@ void TegraRcm::LookUp()
|
|||
m_Ctrltb1->GetDlgItem(IDC_INJECT)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_SHOFEL2)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_MOUNT_SD)->EnableWindow(FALSE);
|
||||
m_Ctrltb2->GetDlgItem(IDC_DUMP_BISKEY)->EnableWindow(FALSE);
|
||||
m_Ctrltb3->GetDlgItem(ID_INSTALL_DRIVER)->EnableWindow(TRUE);
|
||||
// Delay Auto inject if needed
|
||||
if (AUTOINJECT_CURR) DELAY_AUTOINJECT = TRUE;
|
||||
}
|
||||
|
||||
// On change RCM status
|
||||
if (rc != m_RC)
|
||||
if (rc != m_RC || m_RC == -99)
|
||||
{
|
||||
m_RC = rc;
|
||||
//CStatic*pCtrl0 = (CStatic*) m_Parent->GetDlgItem(RCM_PIC_4);
|
||||
|
@ -655,13 +754,20 @@ void TegraRcm::LookUp()
|
|||
// Status changed to "RCM Detected"
|
||||
if (rc == 0)
|
||||
{
|
||||
AppendLogBox(TEXT("RCM Device detected\r\n"));
|
||||
|
||||
BitmapDisplay(RCM_DETECTED);
|
||||
|
||||
CString file;
|
||||
m_Ctrltb1->GetDlgItem(PAYLOAD_PATH)->GetWindowTextW(file);
|
||||
|
||||
// Trigger auto inject if payload injection scheduled
|
||||
if (!FIRST_LOOKUP && DELAY_AUTOINJECT && file.GetLength() > 0)
|
||||
//if (!FIRST_LOOKUP && DELAY_AUTOINJECT && file.GetLength() > 0)
|
||||
if (FIRST_LOOKUP) {
|
||||
if(AUTOINJECT_CURR) DELAY_AUTOINJECT = TRUE;
|
||||
else DELAY_AUTOINJECT = FALSE;
|
||||
}
|
||||
if (DELAY_AUTOINJECT && file.GetLength() > 0 && AUTOINJECT_CURR)
|
||||
{
|
||||
|
||||
BitmapDisplay(LOADING);
|
||||
|
@ -674,7 +780,8 @@ void TegraRcm::LookUp()
|
|||
if (rc >= 0)
|
||||
{
|
||||
BitmapDisplay(LOADED);
|
||||
SendUserMessage("Payload injected !", VALID);
|
||||
//SendUserMessage("Payload injected !", VALID);
|
||||
AppendLogBox(TEXT("Payload successfully injected\r\n"));
|
||||
if (!CmdShow) ShowTrayIconBalloon(TEXT("Payload injected"), TEXT(" "), 1000, NIIF_INFO);
|
||||
WAITING_RECONNECT = TRUE;
|
||||
}
|
||||
|
@ -682,15 +789,19 @@ void TegraRcm::LookUp()
|
|||
{
|
||||
BitmapDisplay(LOAD_ERROR);
|
||||
string s = "Error while injecting payload (RC=" + std::to_string(rc) + ")";
|
||||
CString error = TEXT("Error while injecting payload");
|
||||
CString rc_str;
|
||||
rc_str.Format(L"%d", rc);
|
||||
CString error = TEXT("Error while injecting payload (RC=") + rc_str + TEXT(")");
|
||||
if (!CmdShow) ShowTrayIconBalloon(TEXT("Error"), error, 1000, NIIF_ERROR);
|
||||
SendUserMessage(s.c_str(), INVALID);
|
||||
//SendUserMessage(s.c_str(), INVALID);
|
||||
AppendLogBox(error);
|
||||
|
||||
}
|
||||
DELAY_AUTOINJECT = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendUserMessage("Waiting for user action");
|
||||
SendUserMessage(labels[20].name);
|
||||
}
|
||||
}
|
||||
// Status changed to "RCM not detected" or "USB driver KO"
|
||||
|
@ -700,6 +811,7 @@ void TegraRcm::LookUp()
|
|||
if (rc > -5)
|
||||
{
|
||||
BitmapDisplay(DRIVER_KO);
|
||||
AppendLogBox(TEXT("RCM device detected but APX driver is not installed\r\n"));
|
||||
InstallDriver();
|
||||
}
|
||||
else
|
||||
|
@ -707,12 +819,15 @@ void TegraRcm::LookUp()
|
|||
if (LookForAPXDevice())
|
||||
{
|
||||
BitmapDisplay(DRIVER_KO);
|
||||
AppendLogBox(TEXT("RCM device detected but APX driver is not installed\r\n"));
|
||||
InstallDriver();
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapDisplay(RCM_NOT_DETECTED);
|
||||
if (FIRST_LOOKUP) SendUserMessage("Waiting for device in RCM mode");;
|
||||
if (!FIRST_LOOKUP) AppendLogBox(TEXT("RCM device disconnected\r\n"));
|
||||
else AppendLogBox(TEXT("No RCM device detected\r\n"));
|
||||
if (FIRST_LOOKUP) SendUserMessage(labels[21].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -729,7 +844,7 @@ void TegraRcm::LookUp()
|
|||
//
|
||||
// Smasher => TegraRcmSmash.exe calls
|
||||
//
|
||||
int TegraRcm::Smasher(TCHAR args[])
|
||||
int TegraRcm::Smasher(TCHAR args[4096], BOOL bInheritHandles)
|
||||
{
|
||||
if (WAITING_RECONNECT)
|
||||
{
|
||||
|
@ -743,11 +858,28 @@ int TegraRcm::Smasher(TCHAR args[])
|
|||
}
|
||||
WAITING_RECONNECT = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// This should fix RC-50 issue, ! At last.
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
CString csPathf(szPath);
|
||||
int nIndex = csPathf.ReverseFind(_T('\\'));
|
||||
if (nIndex > 0) csPath = csPathf.Left(nIndex);
|
||||
else csPath.Empty();
|
||||
CString csPath2(csPath);
|
||||
csPath.Append(TEXT(".\\TegraRcmSmash.exe "));
|
||||
TCHAR cmd[4096];
|
||||
_tcscpy_s(cmd, 4095, csPath);
|
||||
lstrcat(cmd, args);
|
||||
|
||||
SECURITY_ATTRIBUTES sa;
|
||||
sa.nLength = sizeof(sa);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = TRUE;
|
||||
|
||||
TCHAR *rfile = GetAbsolutePath(TEXT("out.log"), CSIDL_APPDATA);
|
||||
remove(CT2A(rfile));
|
||||
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
BOOL ret = FALSE;
|
||||
|
@ -757,9 +889,24 @@ int TegraRcm::Smasher(TCHAR args[])
|
|||
si.cb = sizeof(STARTUPINFO);
|
||||
si.dwFlags |= STARTF_USESTDHANDLES;
|
||||
si.hStdInput = NULL;
|
||||
TCHAR cmd[MAX_PATH] = TEXT(".\\TegraRcmSmash.exe ");
|
||||
lstrcat(cmd, args);
|
||||
ret = CreateProcess(NULL, cmd, NULL, NULL, TRUE, flags, NULL, NULL, &si, &pi);
|
||||
if (bInheritHandles) {
|
||||
HANDLE h = CreateFile(rfile,
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_WRITE | FILE_SHARE_READ,
|
||||
&sa,
|
||||
OPEN_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
si.hStdError = h;
|
||||
si.hStdOutput = h;
|
||||
}
|
||||
|
||||
CString argsStr(args);
|
||||
CString msgStr(TEXT("Invoking TegraRcmSmash.exe with args : ") + argsStr + TEXT("\r\n"));
|
||||
AppendLogBox(msgStr);
|
||||
|
||||
|
||||
ret = CreateProcess(NULL, cmd, NULL, NULL, bInheritHandles, flags, NULL, NULL, &si, &pi);
|
||||
int rc = -50;
|
||||
if (NULL != ret)
|
||||
{
|
||||
|
@ -767,6 +914,7 @@ int TegraRcm::Smasher(TCHAR args[])
|
|||
DWORD exit_code;
|
||||
if (FALSE != GetExitCodeProcess(pi.hProcess, &exit_code))
|
||||
{
|
||||
AppendLog("GetExitCodeProcess != FALSE");
|
||||
if (STILL_ACTIVE != exit_code)
|
||||
{
|
||||
rc = exit_code;
|
||||
|
@ -774,7 +922,9 @@ int TegraRcm::Smasher(TCHAR args[])
|
|||
else
|
||||
{
|
||||
rc = -52;
|
||||
AppendLog("RC = -52");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -783,6 +933,27 @@ int TegraRcm::Smasher(TCHAR args[])
|
|||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
else {
|
||||
int lastErrorCode = GetLastError();
|
||||
LPWSTR lpMsgBuf = NULL;
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
|
||||
NULL,
|
||||
lastErrorCode,
|
||||
0,
|
||||
(LPWSTR)&lpMsgBuf,
|
||||
0,
|
||||
NULL);
|
||||
std::string MyString = CW2A(lpMsgBuf);
|
||||
std::string intStr = std::to_string(lastErrorCode);
|
||||
//AppendLog(intStr);
|
||||
//AppendLog(MyString);
|
||||
|
||||
CString CLogBuf(lpMsgBuf);
|
||||
msgStr = TEXT("Error : ") + CLogBuf + TEXT("\r\n");
|
||||
}
|
||||
if (bInheritHandles) {
|
||||
UpdateLogBox();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
//
|
||||
|
@ -811,36 +982,110 @@ ULONGLONG TegraRcm::GetDllVersion(LPCTSTR lpszDllName)
|
|||
}
|
||||
return ullVersion;
|
||||
}
|
||||
|
||||
void TegraRcm::KillRunningProcess(CString process) {
|
||||
|
||||
CString compare;
|
||||
DWORD processID;
|
||||
DWORD currentProcessID = GetCurrentProcessId();
|
||||
bool procRunning = false;
|
||||
|
||||
HANDLE hProcessSnap;
|
||||
PROCESSENTRY32 pe32;
|
||||
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
|
||||
if (hProcessSnap == INVALID_HANDLE_VALUE) {
|
||||
procRunning = false;
|
||||
}
|
||||
else {
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
if (Process32First(hProcessSnap, &pe32)) { // Gets first running process
|
||||
if (pe32.szExeFile == process) {
|
||||
procRunning = true;
|
||||
}
|
||||
else {
|
||||
// loop through all running processes looking for process
|
||||
while (Process32Next(hProcessSnap, &pe32)) {
|
||||
// Set to an AnsiString instead of Char[] to make compare easier
|
||||
compare = pe32.szExeFile;
|
||||
processID = pe32.th32ProcessID;
|
||||
if (compare == process && processID != currentProcessID) {
|
||||
// if found process is running, set to true and break from loop
|
||||
procRunning = true;
|
||||
HWND hProcess = find_main_window(processID);
|
||||
SendMessage(hProcess, WM_CLOSE, 0, 0);
|
||||
DWORD err = GetLastError();
|
||||
int test = 1;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// clean the snapshot object
|
||||
CloseHandle(hProcessSnap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct handle_data {
|
||||
unsigned long process_id;
|
||||
HWND window_handle;
|
||||
};
|
||||
BOOL CALLBACK enum_windows_callback(HWND handle, LPARAM lParam)
|
||||
{
|
||||
handle_data& data = *(handle_data*)lParam;
|
||||
unsigned long process_id = 0;
|
||||
GetWindowThreadProcessId(handle, &process_id);
|
||||
if (data.process_id != process_id)
|
||||
return TRUE;
|
||||
data.window_handle = handle;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HWND TegraRcm::find_main_window(unsigned long process_id)
|
||||
{
|
||||
handle_data data;
|
||||
data.process_id = process_id;
|
||||
data.window_handle = 0;
|
||||
EnumWindows(enum_windows_callback, (LPARAM)&data);
|
||||
return data.window_handle;
|
||||
}
|
||||
|
||||
TCHAR* TegraRcm::GetAbsolutePath(TCHAR* relative_path, DWORD dwFlags)
|
||||
{
|
||||
|
||||
// Get current directory
|
||||
CString csPath;
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
CString csPathf(szPath);
|
||||
int nIndex = csPathf.ReverseFind(_T('\\'));
|
||||
if (nIndex > 0) csPath = csPathf.Left(nIndex);
|
||||
else csPath.Empty();
|
||||
CString csPath2;
|
||||
csPath2 = csPath;
|
||||
csPath2 += TEXT("\\");
|
||||
csPath2 += relative_path;
|
||||
return _tcsdup(csPath2);
|
||||
|
||||
/*
|
||||
// USE THIS INSTEAD TO BUILD FOR MSI PACKAGER
|
||||
//
|
||||
//
|
||||
BOOL PORTABLE = TRUE;
|
||||
//
|
||||
//
|
||||
|
||||
TCHAR szPath[MAX_PATH];
|
||||
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, dwFlags, NULL, SHGFP_TYPE_CURRENT, szPath)))
|
||||
{
|
||||
if (dwFlags == CSIDL_APPDATA) PathAppend(szPath, _T("\\TegraRcmGUI"));
|
||||
PathAppend(szPath, relative_path);
|
||||
return _tcsdup(szPath);
|
||||
if (PORTABLE) {
|
||||
// Get current directory
|
||||
CString csPath;
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
CString csPathf(szPath);
|
||||
int nIndex = csPathf.ReverseFind(_T('\\'));
|
||||
if (nIndex > 0) csPath = csPathf.Left(nIndex);
|
||||
else csPath.Empty();
|
||||
CString csPath2;
|
||||
csPath2 = csPath;
|
||||
csPath2 += TEXT("\\");
|
||||
csPath2 += relative_path;
|
||||
return _tcsdup(csPath2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// USE THIS INSTEAD TO BUILD FOR MSI PACKAGER
|
||||
TCHAR szPath[MAX_PATH];
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, dwFlags, NULL, SHGFP_TYPE_CURRENT, szPath)))
|
||||
{
|
||||
if (dwFlags == CSIDL_APPDATA) PathAppend(szPath, _T("\\TegraRcmGUI"));
|
||||
PathAppend(szPath, relative_path);
|
||||
return _tcsdup(szPath);
|
||||
}
|
||||
return _T("");
|
||||
}
|
||||
return _T("");
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -880,7 +1125,7 @@ char* TegraRcm::GetRelativeFilename(char *currentDirectory, char *absoluteFilena
|
|||
if (currentDirectory[0] != absoluteFilename[0])
|
||||
{
|
||||
// not on the same drive, so only absolute filename will do
|
||||
strcpy(relativeFilename, absoluteFilename);
|
||||
strcpy_s(relativeFilename, MAX_FILENAME_LEN, absoluteFilename);
|
||||
return relativeFilename;
|
||||
}
|
||||
// they are on the same drive, find out how much of the current directory
|
||||
|
@ -901,7 +1146,7 @@ char* TegraRcm::GetRelativeFilename(char *currentDirectory, char *absoluteFilena
|
|||
// file name should not have a leading one...
|
||||
i++;
|
||||
}
|
||||
strcpy(relativeFilename, &absoluteFilename[i]);
|
||||
strcpy_s(relativeFilename, MAX_FILENAME_LEN, &absoluteFilename[i]);
|
||||
return relativeFilename;
|
||||
}
|
||||
// The file is not in a child directory of the current directory, so we
|
||||
|
@ -946,6 +1191,6 @@ char* TegraRcm::GetRelativeFilename(char *currentDirectory, char *absoluteFilena
|
|||
relativeFilename[rfMarker++] = SLASH;
|
||||
}
|
||||
// copy the rest of the filename into the result string
|
||||
strcpy(&relativeFilename[rfMarker], &absoluteFilename[afMarker]);
|
||||
strcpy_s(&relativeFilename[rfMarker], MAX_FILENAME_LEN, &absoluteFilename[afMarker]);
|
||||
return relativeFilename;
|
||||
}
|
|
@ -16,6 +16,8 @@
|
|||
#include <stdio.h>
|
||||
#include <Strsafe.h>
|
||||
#include "afxcmn.h"
|
||||
#include <tlhelp32.h>
|
||||
|
||||
#pragma comment (lib, "setupapi.lib")
|
||||
|
||||
class TegraRcm
|
||||
|
@ -23,11 +25,15 @@ class TegraRcm
|
|||
public:
|
||||
TegraRcm(CDialog* pParent = NULL);
|
||||
~TegraRcm();
|
||||
|
||||
public:
|
||||
void InitCtrltbDlgs(CDialog* pCtrltb1, CDialog* pCtrltb2, CDialog* pCtrltb3);
|
||||
int GetRcmStatus();
|
||||
ULONGLONG GetDllVersion(LPCTSTR lpszDllName);
|
||||
TCHAR* GetAbsolutePath(TCHAR* relative_path, DWORD dwFlags);
|
||||
void SetLocale();
|
||||
void AppendLogBox(CString line);
|
||||
void UpdateLogBox();
|
||||
string GetPreset(string param);
|
||||
void InstallDriver();
|
||||
BOOL LookForAPXDevice();
|
||||
|
@ -39,8 +45,12 @@ public:
|
|||
void SaveFavorites();
|
||||
void BitmapDisplay(int IMG);
|
||||
void LookUp();
|
||||
int Smasher(TCHAR args[]);
|
||||
int Smasher(TCHAR args[], BOOL bInheritHandles = TRUE);
|
||||
char* GetRelativeFilename(char *currentDirectory, char *absoluteFilename);
|
||||
|
||||
|
||||
void KillRunningProcess(CString process);
|
||||
HWND find_main_window(unsigned long process_id);
|
||||
|
||||
BOOL CmdShow = TRUE;
|
||||
// Notify Icon
|
||||
|
@ -54,14 +64,15 @@ public:
|
|||
BOOL SetTrayIcon(WORD wIconID);
|
||||
void ShowContextMenu(HWND hWnd);
|
||||
BOOL DestroyTrayIcon();
|
||||
LRESULT OnTrayIconEvent(UINT wParam, LPARAM lParam);
|
||||
LRESULT OnTrayIconEvent(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BOOL PAUSE_LKP_DEVICE = FALSE;
|
||||
BOOL AUTOINJECT_CURR = FALSE;
|
||||
BOOL DELAY_AUTOINJECT = FALSE;
|
||||
BOOL DELAY_AUTOINJECT = TRUE;
|
||||
BOOL WAITING_RECONNECT = FALSE;
|
||||
BOOL ASK_FOR_DRIVER = FALSE;
|
||||
BOOL MIN_TO_TRAY_CURR = FALSE;
|
||||
BOOL LOGGING_CURR = FALSE;
|
||||
|
||||
CString csPath;
|
||||
COLORREF LabelColor = RGB(0, 0, 0);
|
||||
|
@ -76,6 +87,38 @@ public:
|
|||
CDialog* m_Ctrltb1;
|
||||
CDialog* m_Ctrltb2;
|
||||
CDialog* m_Ctrltb3;
|
||||
|
||||
struct Label {
|
||||
int uid;
|
||||
string name;
|
||||
};
|
||||
|
||||
Label labels[23] = {
|
||||
{ 0, "TegraRcmGUI"},
|
||||
{ 1, "No file selected" },
|
||||
{ 2, "File doesn't exist" },
|
||||
{ 3, "Injecting payload..." },
|
||||
{ 4, "Payload injected !" },
|
||||
{ 5, "Error while injecting payload" },
|
||||
{ 6, "Favorite already exists" },
|
||||
{ 7, "Favorite added" },
|
||||
{ 8, "Favorite removed" },
|
||||
{ 9, "UMS Tool injected" },
|
||||
{ 10, "Linux coreboot not found in \\shofel2 dir" },
|
||||
{ 11, "Kernel not found in shofel2 directory. Do you want to automatically download arch linux kernel from SoulCipher repo ?" },
|
||||
{ 12, "Kernel not found" },
|
||||
{ 13, "Loading coreboot. Please wait." },
|
||||
{ 14, "Coreboot injected. Waiting 5s for device..." },
|
||||
{ 15, "Coreboot loaded " },
|
||||
{ 16, "Error" },
|
||||
{ 17, "Error while loading imx_usb.exe" },
|
||||
{ 18, "APX device driver is missing. Do you want to install it now ?" },
|
||||
{ 19, "APX driver not found !" },
|
||||
{ 20, "Waiting for user action" },
|
||||
{ 21, "Waiting for device in RCM mode" },
|
||||
{ 22, "Payload already injected. Are you sure you want to overwrite the stack again ?" }
|
||||
};
|
||||
|
||||
private:
|
||||
HWND m_hWnd;
|
||||
TegraRcmSmash m_Device;
|
||||
|
|
Binary file not shown.
40
TegraRcmGUI/TegraRcmGUI.sln
Normal file
40
TegraRcmGUI/TegraRcmGUI.sln
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TegraRcmGUI", "TegraRcmGUI.vcxproj", "{2C091C5B-378F-44D0-91F2-53489BA7B83C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
Static Debug|x64 = Static Debug|x64
|
||||
Static Debug|x86 = Static Debug|x86
|
||||
Static Release|x64 = Static Release|x64
|
||||
Static Release|x86 = Static Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x64.Build.0 = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x64.ActiveCfg = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x64.Build.0 = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Release|x86.Build.0 = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x64.ActiveCfg = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x64.Build.0 = Debug|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Debug|x86.Build.0 = Debug|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x64.ActiveCfg = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x64.Build.0 = Release|x64
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x86.ActiveCfg = Release|Win32
|
||||
{2C091C5B-378F-44D0-91F2-53489BA7B83C}.Static Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,285 +1,292 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2C091C5B-378F-44D0-91F2-53489BA7B83C}</ProjectGuid>
|
||||
<RootNamespace>TegraRcmGUI</RootNamespace>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DialogTab01.h" />
|
||||
<ClInclude Include="DialogTab02.h" />
|
||||
<ClInclude Include="DialogTab03.h" />
|
||||
<ClInclude Include="libusbk_int.h" />
|
||||
<ClInclude Include="MyTabCtrl.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="res\BitmapPicture.h" />
|
||||
<ClInclude Include="ScopeGuard.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="TegraRcm.h" />
|
||||
<ClInclude Include="TegraRcmGUI.h" />
|
||||
<ClInclude Include="TegraRcmGUIDlg.h" />
|
||||
<ClInclude Include="TegraRcmSmash.h" />
|
||||
<ClInclude Include="Types.h" />
|
||||
<ClInclude Include="Win32Def.h" />
|
||||
<ClInclude Include="WinHandle.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DialogTab01.cpp" />
|
||||
<ClCompile Include="DialogTab02.cpp" />
|
||||
<ClCompile Include="DialogTab03.cpp" />
|
||||
<ClCompile Include="MyTabCtrl.cpp" />
|
||||
<ClCompile Include="res\BitmapPicture.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TegraRcm.cpp" />
|
||||
<ClCompile Include="TegraRcmGUI.cpp" />
|
||||
<ClCompile Include="TegraRcmGUIDlg.cpp" />
|
||||
<ClCompile Include="TegraRcmSmash.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="TegraRcmGUI.rc">
|
||||
<DeploymentContent>false</DeploymentContent>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\TegraRcmGUI.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\..\..\..\..\Visual Studio 2015\Projects\TegraRcmGUI\TegraRcmGUI\res\TegraRcmGUI.ico" />
|
||||
<Image Include="res\add.ico" />
|
||||
<Image Include="res\bitmap2.bmp" />
|
||||
<Image Include="res\browse.ico" />
|
||||
<Image Include="res\delete.ico" />
|
||||
<Image Include="res\driver_ko.bmp" />
|
||||
<Image Include="res\driver_ko_2.bmp" />
|
||||
<Image Include="res\error.bmp" />
|
||||
<Image Include="res\error_2.bmp" />
|
||||
<Image Include="res\icon1.ico" />
|
||||
<Image Include="res\init_log.bmp" />
|
||||
<Image Include="res\init_logo.bmp" />
|
||||
<Image Include="res\init_logo_2.bmp" />
|
||||
<Image Include="res\linux_icon.ico" />
|
||||
<Image Include="res\loaded.bmp" />
|
||||
<Image Include="res\loaded_2.bmp" />
|
||||
<Image Include="res\loading.bmp" />
|
||||
<Image Include="res\loading_2.bmp" />
|
||||
<Image Include="res\rcm_detected.bmp" />
|
||||
<Image Include="res\rcm_detected_2.bmp" />
|
||||
<Image Include="res\rcm_undetected.bmp" />
|
||||
<Image Include="res\rcm_undetected_2.bmp" />
|
||||
<Image Include="res\status.ico" />
|
||||
<Image Include="res\TegraRcmGUI.ico" />
|
||||
<Image Include="res\tray_ico_connected.ico" />
|
||||
<Image Include="res\tray_ico_not_connected.ico" />
|
||||
<Image Include="res\usb_icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="TegraRcmGUI.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2C091C5B-378F-44D0-91F2-53489BA7B83C}</ProjectGuid>
|
||||
<RootNamespace>TegraRcmGUI</RootNamespace>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\Output\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Output\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\Output\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Output\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
|
||||
<EnableUAC>true</EnableUAC>
|
||||
<UACUIAccess>false</UACUIAccess>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(LIBUSBK_DIR)\includes\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>$(LIBUSBK_DIR)\bin\lib\$(PlatformShortName.Replace('x64','amd64'))\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Version.lib;libusbK.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DialogTab01.h" />
|
||||
<ClInclude Include="DialogTab02.h" />
|
||||
<ClInclude Include="DialogTab03.h" />
|
||||
<ClInclude Include="libusbk_int.h" />
|
||||
<ClInclude Include="MyTabCtrl.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="res\BitmapPicture.h" />
|
||||
<ClInclude Include="ScopeGuard.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="TegraRcm.h" />
|
||||
<ClInclude Include="TegraRcmGUI.h" />
|
||||
<ClInclude Include="TegraRcmGUIDlg.h" />
|
||||
<ClInclude Include="TegraRcmSmash.h" />
|
||||
<ClInclude Include="Types.h" />
|
||||
<ClInclude Include="Win32Def.h" />
|
||||
<ClInclude Include="WinHandle.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DialogTab01.cpp" />
|
||||
<ClCompile Include="DialogTab02.cpp" />
|
||||
<ClCompile Include="DialogTab03.cpp" />
|
||||
<ClCompile Include="MyTabCtrl.cpp" />
|
||||
<ClCompile Include="res\BitmapPicture.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TegraRcm.cpp" />
|
||||
<ClCompile Include="TegraRcmGUI.cpp" />
|
||||
<ClCompile Include="TegraRcmGUIDlg.cpp" />
|
||||
<ClCompile Include="TegraRcmSmash.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="TegraRcmGUI.rc">
|
||||
<DeploymentContent>false</DeploymentContent>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\TegraRcmGUI.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\..\..\..\..\Visual Studio 2015\Projects\TegraRcmGUI\TegraRcmGUI\res\TegraRcmGUI.ico" />
|
||||
<Image Include="res\add.ico" />
|
||||
<Image Include="res\bitmap2.bmp" />
|
||||
<Image Include="res\browse.ico" />
|
||||
<Image Include="res\bunch-of-keys.ico" />
|
||||
<Image Include="res\delete.ico" />
|
||||
<Image Include="res\driver_ko.bmp" />
|
||||
<Image Include="res\driver_ko_2.bmp" />
|
||||
<Image Include="res\error.bmp" />
|
||||
<Image Include="res\error_2.bmp" />
|
||||
<Image Include="res\icon1.ico" />
|
||||
<Image Include="res\init_log.bmp" />
|
||||
<Image Include="res\init_logo.bmp" />
|
||||
<Image Include="res\init_logo_2.bmp" />
|
||||
<Image Include="res\linux_icon.ico" />
|
||||
<Image Include="res\loaded.bmp" />
|
||||
<Image Include="res\loaded_2.bmp" />
|
||||
<Image Include="res\loading.bmp" />
|
||||
<Image Include="res\loading_2.bmp" />
|
||||
<Image Include="res\rcm_detected.bmp" />
|
||||
<Image Include="res\rcm_detected_2.bmp" />
|
||||
<Image Include="res\rcm_undetected.bmp" />
|
||||
<Image Include="res\rcm_undetected_2.bmp" />
|
||||
<Image Include="res\status.ico" />
|
||||
<Image Include="res\TegraRcmGUI.ico" />
|
||||
<Image Include="res\tray_ico_connected.ico" />
|
||||
<Image Include="res\tray_ico_not_connected.ico" />
|
||||
<Image Include="res\usb_icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="TegraRcmGUI.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
|
@ -194,5 +194,8 @@
|
|||
<Image Include="res\init_logo_2.bmp">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
<Image Include="res\bunch-of-keys.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -93,6 +93,7 @@ BEGIN_MESSAGE_MAP(CTegraRcmGUIDlg, CDialog)
|
|||
ON_COMMAND(SWM_FAV09, InjectFav09Command)
|
||||
ON_COMMAND(SWM_FAV10, InjectFav10Command)
|
||||
ON_COMMAND(SWM_AUTOINJECT, AutoInjectCommand)
|
||||
ON_MESSAGE(WM_QUERYENDSESSION, OnQueryEndSession)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
//
|
||||
|
@ -100,6 +101,10 @@ END_MESSAGE_MAP()
|
|||
//
|
||||
BOOL CTegraRcmGUIDlg::OnInitDialog()
|
||||
{
|
||||
|
||||
m_TegraRcm = new TegraRcm(this);
|
||||
m_TegraRcm->AppendLog("new TegraRcm()");
|
||||
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Accessibility
|
||||
|
@ -109,18 +114,20 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
CString csPathf(szPath);
|
||||
CT2CA pszConvertedAnsiString(csPathf);
|
||||
std::string strStd(pszConvertedAnsiString);
|
||||
m_TegraRcm->AppendLog("Module filename is : ");
|
||||
m_TegraRcm->AppendLog(strStd);
|
||||
|
||||
int nIndex = csPathf.ReverseFind(_T('\\'));
|
||||
if (nIndex > 0) csPath = csPathf.Left(nIndex);
|
||||
else csPath.Empty();
|
||||
|
||||
// Initialize bitmap
|
||||
|
||||
|
||||
|
||||
CRect rc;
|
||||
AfxGetMainWnd()->GetWindowRect(rc);
|
||||
int width = rc.Width();
|
||||
|
||||
int fontSize = width * 0.031;
|
||||
if (width < 400)
|
||||
{
|
||||
RCM_BITMAP0.SetBitmap(INIT_LOGO_2);
|
||||
|
@ -141,6 +148,26 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
RCM_BITMAP5.SetBitmap(LOADED);
|
||||
RCM_BITMAP6.SetBitmap(LOAD_ERROR);
|
||||
}
|
||||
|
||||
// Log Box
|
||||
LOGFONT lf;
|
||||
/*
|
||||
CEdit* pBox = (CEdit*)AfxGetMainWnd()->GetDlgItem(IDC_LOG_BOX);
|
||||
CFont* old = pBox->GetFont();
|
||||
old->GetLogFont(&lf);
|
||||
CFont newfont;
|
||||
newfont.CreateFont(lf.lfHeight + 30, 0, lf.lfEscapement, lf.lfOrientation, lf.lfWeight, lf.lfItalic, lf.lfUnderline, lf.lfStrikeOut, lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision, lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName);
|
||||
pBox->SetFont(&newfont);
|
||||
*/
|
||||
|
||||
CEdit* pBox = (CEdit*)AfxGetMainWnd()->GetDlgItem(IDC_LOG_BOX);
|
||||
|
||||
CFont *myFont = new CFont();
|
||||
myFont->CreateFont(fontSize, 0, 0, 0, FW_NORMAL, false, false,
|
||||
0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
|
||||
FIXED_PITCH | FF_MODERN, _T("Verdana"));
|
||||
|
||||
pBox->SetFont(myFont);
|
||||
|
||||
|
||||
// Menu
|
||||
|
@ -164,7 +191,9 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
m_TegraRcm = new TegraRcm(this);
|
||||
// Kill other running process of app
|
||||
m_TegraRcm->KillRunningProcess(TEXT("TegraRcmGUI.exe"));
|
||||
|
||||
m_tbCtrl.InitDialogs(m_TegraRcm);
|
||||
|
||||
TCITEM tcItem1;
|
||||
|
@ -195,6 +224,8 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
// Start timer to check RCM status every second
|
||||
CTegraRcmGUIDlg::StartTimer();
|
||||
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
void CTegraRcmGUIDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
|
@ -211,18 +242,25 @@ HBRUSH CTegraRcmGUIDlg::OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor)
|
|||
switch (nCtlColor)
|
||||
{
|
||||
case CTLCOLOR_STATIC:
|
||||
/*
|
||||
if (GetDlgItem(IDC_RAJKOSTO)->GetSafeHwnd() == pWnd->GetSafeHwnd() || GetDlgItem(SEPARATOR)->GetSafeHwnd() == pWnd->GetSafeHwnd())
|
||||
{
|
||||
pDC->SetTextColor(RGB(192, 192, 192));
|
||||
pDC->SetBkMode(TRANSPARENT);
|
||||
return (HBRUSH)GetStockObject(NULL_BRUSH);
|
||||
}
|
||||
*/
|
||||
if (GetDlgItem(INFO_LABEL)->GetSafeHwnd() == pWnd->GetSafeHwnd())
|
||||
{
|
||||
pDC->SetBkMode(TRANSPARENT);
|
||||
pDC->SetTextColor(m_TegraRcm->LabelColor);
|
||||
return (HBRUSH) CreateSolidBrush( WhiteRGB );
|
||||
}
|
||||
if (GetDlgItem(IDC_LOG_BOX)->GetSafeHwnd() == pWnd->GetSafeHwnd())
|
||||
{
|
||||
pDC->SetBkMode(TRANSPARENT);
|
||||
return (HBRUSH)CreateSolidBrush(WhiteRGB);
|
||||
}
|
||||
if (GetDlgItem(IDC_STATUS_BG)->GetSafeHwnd() == pWnd->GetSafeHwnd())
|
||||
{
|
||||
return (HBRUSH)CreateSolidBrush(WhiteRGB);
|
||||
|
@ -289,7 +327,7 @@ void CTegraRcmGUIDlg::OnClose()
|
|||
PostQuitMessage(0);
|
||||
}
|
||||
|
||||
LRESULT CTegraRcmGUIDlg::OnTrayIconEvent(UINT wParam, LPARAM lParam)
|
||||
LRESULT CTegraRcmGUIDlg::OnTrayIconEvent(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return m_TegraRcm->OnTrayIconEvent(wParam, lParam);
|
||||
}
|
||||
|
@ -341,6 +379,8 @@ void CTegraRcmGUIDlg::MountCommand()
|
|||
if (m_TegraRcm != NULL)
|
||||
{
|
||||
DialogTab02 *pt = (DialogTab02*)m_TegraRcm->m_Ctrltb2;
|
||||
CComboBox* pmyComboBox = (CComboBox*)pt->GetDlgItem(ID_UMS_COMBO);
|
||||
pmyComboBox->SetCurSel(3);
|
||||
pt->OnBnClickedMountSd();
|
||||
}
|
||||
}
|
||||
|
@ -406,7 +446,7 @@ void CTegraRcmGUIDlg::StopTimer()
|
|||
KillTimer(ID_TIMER_MINUTE);
|
||||
KillTimer(ID_TIMER_SECONDS);
|
||||
}
|
||||
void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
|
||||
void CTegraRcmGUIDlg::OnTimer(UINT_PTR nIDEvent)
|
||||
{
|
||||
// Each second
|
||||
if (nIDEvent == ID_TIMER_SECONDS)
|
||||
|
@ -422,7 +462,10 @@ void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
|
|||
}
|
||||
}
|
||||
|
||||
void CTegraRcmGUIDlg::OnEnChangePath()
|
||||
LRESULT CTegraRcmGUIDlg::OnQueryEndSession(WPARAM wParm, LPARAM lParm)
|
||||
{
|
||||
int test = 1;
|
||||
// This is not useful, exit is not needed in that case
|
||||
m_TegraRcm->AppendLog("OnEndSession");
|
||||
PostMessage(WM_QUIT);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
int RCM_STATUS = -10;
|
||||
BOOL WAITING_RECONNECT = FALSE;
|
||||
BOOL PREVENT_AUTOINJECT = TRUE;
|
||||
BOOL DELAY_AUTOINJECT = FALSE;
|
||||
BOOL DELAY_AUTOINJECT = TRUE;
|
||||
BOOL ASK_FOR_DRIVER = FALSE;
|
||||
BOOL PAUSE_LKP_DEVICE = FALSE;
|
||||
BOOL AUTOSTART = FALSE;
|
||||
|
@ -90,16 +90,17 @@ protected:
|
|||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg LRESULT OnTrayIconEvent(UINT wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnTrayIconEvent(WPARAM wParam, LPARAM lParam);
|
||||
DECLARE_MESSAGE_MAP()
|
||||
afx_msg LRESULT OnQueryEndSession(WPARAM wParm, LPARAM lParm);
|
||||
|
||||
public:
|
||||
void StartTimer();
|
||||
void StopTimer();
|
||||
void OnTimer(UINT nIDEvent);
|
||||
void OnTimer(UINT_PTR nIDEvent);
|
||||
int STATUS;
|
||||
afx_msg void BitmapDisplay(int IMG);
|
||||
afx_msg void OnEnChangePath();
|
||||
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor);
|
||||
void ShowWindowCommand();
|
||||
void HideWindowCommand();
|
||||
|
@ -124,4 +125,6 @@ public:
|
|||
private:
|
||||
MyTabCtrl m_tbCtrl;
|
||||
TegraRcm *m_TegraRcm;
|
||||
public:
|
||||
afx_msg void OnEnChangeLogBox();
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
TegraRcmGUI/res/bunch-of-keys.ico
Normal file
BIN
TegraRcmGUI/res/bunch-of-keys.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
3
TegraRcmGUI/shofel2/imx_usb.bat
Normal file
3
TegraRcmGUI/shofel2/imx_usb.bat
Normal file
|
@ -0,0 +1,3 @@
|
|||
cd shofel2
|
||||
imx_usb.exe -c conf/
|
||||
ping 127.0.0.1 -n 6 > nul
|
BIN
TegraRcmGUI/tools/biskeydump_usb.bin
Normal file
BIN
TegraRcmGUI/tools/biskeydump_usb.bin
Normal file
Binary file not shown.
BIN
TegraRcmGUI/tools/memloader/memloader_usb.bin
Normal file
BIN
TegraRcmGUI/tools/memloader/memloader_usb.bin
Normal file
Binary file not shown.
BIN
TegraRcmGUI/tools/memloader/u-boot.elf
Normal file
BIN
TegraRcmGUI/tools/memloader/u-boot.elf
Normal file
Binary file not shown.
14
TegraRcmGUI/tools/memloader/ums_boot0.ini
Normal file
14
TegraRcmGUI/tools/memloader/ums_boot0.ini
Normal file
|
@ -0,0 +1,14 @@
|
|||
[load:PH_0]
|
||||
if=/u-boot.elf
|
||||
skip=0x00010000
|
||||
count=0x0006e13f
|
||||
dst=0x80110000
|
||||
|
||||
[load:script]
|
||||
if=ums_emmc_boot0.scr.img
|
||||
dst=0x80100000
|
||||
|
||||
[boot:ENTRY]
|
||||
pc=0x80110000
|
||||
maxMemoryFreq=200
|
||||
pwroffHoldTime=4
|
14
TegraRcmGUI/tools/memloader/ums_boot1.ini
Normal file
14
TegraRcmGUI/tools/memloader/ums_boot1.ini
Normal file
|
@ -0,0 +1,14 @@
|
|||
[load:PH_0]
|
||||
if=/u-boot.elf
|
||||
skip=0x00010000
|
||||
count=0x0006e13f
|
||||
dst=0x80110000
|
||||
|
||||
[load:script]
|
||||
if=ums_emmc_boot1.scr.img
|
||||
dst=0x80100000
|
||||
|
||||
[boot:ENTRY]
|
||||
pc=0x80110000
|
||||
maxMemoryFreq=-1600
|
||||
pwroffHoldTime=4
|
13
TegraRcmGUI/tools/memloader/ums_emmc.ini
Normal file
13
TegraRcmGUI/tools/memloader/ums_emmc.ini
Normal file
|
@ -0,0 +1,13 @@
|
|||
[load:PH_0]
|
||||
if=/u-boot.elf
|
||||
skip=0x00010000
|
||||
count=0x0006e13f
|
||||
dst=0x80110000
|
||||
|
||||
[load:script]
|
||||
if=ums_emmc.scr.img
|
||||
dst=0x80100000
|
||||
|
||||
[boot:ENTRY]
|
||||
pc=0x80110000
|
||||
pwroffHoldTime=4
|
1
TegraRcmGUI/tools/memloader/ums_emmc.scr
Normal file
1
TegraRcmGUI/tools/memloader/ums_emmc.scr
Normal file
|
@ -0,0 +1 @@
|
|||
ums 1 mmc 0.0
|
BIN
TegraRcmGUI/tools/memloader/ums_emmc.scr.img
Normal file
BIN
TegraRcmGUI/tools/memloader/ums_emmc.scr.img
Normal file
Binary file not shown.
1
TegraRcmGUI/tools/memloader/ums_emmc_boot0.scr
Normal file
1
TegraRcmGUI/tools/memloader/ums_emmc_boot0.scr
Normal file
|
@ -0,0 +1 @@
|
|||
ums 1 mmc 0.1
|
BIN
TegraRcmGUI/tools/memloader/ums_emmc_boot0.scr.img
Normal file
BIN
TegraRcmGUI/tools/memloader/ums_emmc_boot0.scr.img
Normal file
Binary file not shown.
1
TegraRcmGUI/tools/memloader/ums_emmc_boot1.scr
Normal file
1
TegraRcmGUI/tools/memloader/ums_emmc_boot1.scr
Normal file
|
@ -0,0 +1 @@
|
|||
ums 1 mmc 0.2
|
BIN
TegraRcmGUI/tools/memloader/ums_emmc_boot1.scr.img
Normal file
BIN
TegraRcmGUI/tools/memloader/ums_emmc_boot1.scr.img
Normal file
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
[load:PH_0]
|
||||
if=u-boot.elf
|
||||
if=/u-boot.elf
|
||||
skip=0x00010000
|
||||
count=0x0007c1bf
|
||||
dst=0x80110000
|
||||
|
@ -10,3 +10,4 @@ dst=0x80100000
|
|||
|
||||
[boot:ENTRY]
|
||||
pc=0x80110000
|
||||
pwroffHoldTime=4
|
BIN
TegraRcmGUI/tools/memloader/ums_sd.scr.img
Normal file
BIN
TegraRcmGUI/tools/memloader/ums_sd.scr.img
Normal file
Binary file not shown.
1
TegraRcmGUI/tools/src/biskeydump
Submodule
1
TegraRcmGUI/tools/src/biskeydump
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit ed57dd5032840ab7084bcd76e8b9408dd7245958
|
Loading…
Add table
Reference in a new issue