allow http local link to start with /

This commit is contained in:
mrdude2478 2023-09-07 10:24:01 +01:00
parent 7f52663841
commit aa7d7bed4c
3 changed files with 20 additions and 14 deletions

View File

@ -41,8 +41,8 @@ namespace Crypto
u8 headerKekSource[0x10] = { 0x1F, 0x12, 0x91, 0x3A, 0x4A, 0xCB, 0xF0, 0x0D, 0x4C, 0xDE, 0x3A, 0xF6, 0xD5, 0x23, 0x88, 0x2A }; u8 headerKekSource[0x10] = { 0x1F, 0x12, 0x91, 0x3A, 0x4A, 0xCB, 0xF0, 0x0D, 0x4C, 0xDE, 0x3A, 0xF6, 0xD5, 0x23, 0x88, 0x2A };
u8 headerKeySource[0x20] = { 0x5A, 0x3E, 0xD8, 0x4F, 0xDE, 0xC0, 0xD8, 0x26, 0x31, 0xF7, 0xE2, 0x5D, 0x19, 0x7B, 0xF5, 0xD0, 0x1C, 0x9B, 0x7B, 0xFA, 0xF6, 0x28, 0x18, 0x3D, 0x71, 0xF6, 0x4D, 0x73, 0xF1, 0x50, 0xB9, 0xD2 }; u8 headerKeySource[0x20] = { 0x5A, 0x3E, 0xD8, 0x4F, 0xDE, 0xC0, 0xD8, 0x26, 0x31, 0xF7, 0xE2, 0x5D, 0x19, 0x7B, 0xF5, 0xD0, 0x1C, 0x9B, 0x7B, 0xFA, 0xF6, 0x28, 0x18, 0x3D, 0x71, 0xF6, 0x4D, 0x73, 0xF1, 0x50, 0xB9, 0xD2 };
//u8 headerKey[0x20] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; u8 headerKey[0x20] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
u8 headerKey[0x20] = { 0xAE, 0xAA, 0xB1, 0xCA, 0x08, 0xAD, 0xF9, 0xBE, 0xF1, 0x29, 0x91, 0xF3, 0x69, 0xE3, 0xC5, 0x67, 0xD6, 0x88, 0x1E, 0x4E, 0x4A, 0x6A, 0x47, 0xA5, 0x1F, 0x6E, 0x48, 0x77, 0x06, 0x2D, 0x54, 0x2D }; //u8 headerKey[0x20] = { 0xAE, 0xAA, 0xB1, 0xCA, 0x08, 0xAD, 0xF9, 0xBE, 0xF1, 0x29, 0x91, 0xF3, 0x69, 0xE3, 0xC5, 0x67, 0xD6, 0x88, 0x1E, 0x4E, 0x4A, 0x6A, 0x47, 0xA5, 0x1F, 0x6E, 0x48, 0x77, 0x06, 0x2D, 0x54, 0x2D };
}; };
void calculateMGF1andXOR(unsigned char* data, size_t data_size, const void* source, size_t source_size); void calculateMGF1andXOR(unsigned char* data, size_t data_size, const void* source, size_t source_size);

View File

@ -431,8 +431,13 @@ namespace netInstStuff {
*/ */
if (link.find("http") == std::string::npos) { if (link.find("http") == std::string::npos) {
std::string before_strip = stripfilename(url); std::string before_strip = stripfilename(url);
if (link[0] == '/'){
tmp_array.push_back(before_strip + link);
}
else{
tmp_array.push_back(before_strip + "/" + link); tmp_array.push_back(before_strip + "/" + link);
} }
}
else { else {
tmp_array.push_back(link); tmp_array.push_back(link);
} }

View File

@ -66,12 +66,13 @@ bool NcaBodyWriter::isOpen() const
//https://www.w3schools.com/cpp/cpp_classes.asp //https://www.w3schools.com/cpp/cpp_classes.asp
//https://github.com/minetest/minetestmapper/blob/master/ZstdDecompressor.cpp //https://github.com/minetest/minetestmapper/blob/master/ZstdDecompressor.cpp
//https://github.com/nicoboss/nsz/blob/master/nsz/BlockDecompressorReader.py //https://github.com/nicoboss/nsz/blob/master/nsz/BlockDecompressorReader.py
//https://switchbrew.org/wiki/NCA
class NczHeader class NczHeader
{ {
public: public:
static const u64 MAGIC = 0x4E544345535A434E; static const u64 MAGIC = 0x4E544345535A434E; //NTCESZCN
static const u64 BLOCK = 0x4E435A424C4F434B; //at 0xD0 from magic address static const u64 BLOCK = 0x4E435A424C4F434B; //NCZBLOCK at 0x40D0
class Section class Section
{ {