Skip to content

Commit

Permalink
Allow opening by dnd
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-k0 committed Jul 8, 2022
1 parent d72cc1d commit 0c703d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions YYC_ripper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <array>
#include <string>
#include <stdio.h>
#include <conio.h>


using namespace std;
Expand Down Expand Up @@ -55,8 +56,9 @@ void exitOnFileError()
}
}

int main()
int main(int argc, char* argv[])
{

errno = 0;
FILE* fileptr;
unsigned char* buffer;
Expand All @@ -66,18 +68,29 @@ int main()
std::vector<unsigned char> beginSq = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a };
std::vector<unsigned char> endSq = { 0x49, 0x45, 0x4e ,0x44, 0xae, 0x42, 0x60, 0x82 };

// User input filename
string targetfname = "";
cout << "Please input the name of the file to extract from: (Example: data.win)" << endl;
cin >> targetfname;

// default name
if (targetfname == " ")
string path;
if (argc == 2)
{
targetfname = "data.win";
cout << "Opened by drag-and-drop!" << endl;
cout << argv[1] << endl;
path = string(argv[1]);
}
else
{
// User input filename
string targetfname = "";
cout << "Please input the name of the file to extract from in the current directory: (Example: data.win)" << endl;
cin >> targetfname;

// default name
if (targetfname == " ")
{
targetfname = "data.win";
}

string path = getCurrentDir() + "\\" + targetfname;
path = getCurrentDir() + "\\" + targetfname;
}



cout << "-----" << endl;
Expand Down Expand Up @@ -168,5 +181,8 @@ int main()
// Clean up
delete fvec;
cout << "Done! Extracted "<< imgcnt <<" assets" << endl;
cout << "Press any key to close." << endl;
while (!_kbhit());

return 0;
}
Binary file added YYC_ripper.exe
Binary file not shown.

0 comments on commit 0c703d3

Please sign in to comment.