• WIIIS (Nintendo Wii Image Search)

    Development and Coding image wii c++ search
    1
    0 Votes
    1 Posts
    496 Views
    ScuzzS
    WIIIS (Nintendo Wii Image Search) As computer games consoles become more and more like computers the need for forensic investigation methodologies and software also increases. Many new games console have hard drives that are able to store images, films and music on them and because of this they can be used to store illegal content. Games console can also be modified to run homebrew applications that give access to hidden areas of the storage of the games console, adding further hiding places for illegal files. This report describes different consoles and their method of modification and the implementation of an image carver for two games consoles. The Nintendo Wii Image Search will search for .jpg files stored on an external SD card and display their location on screen. WIIIS requires the homebrew channel to be installed on the Nintendo Wii console #include <iostream> #include <string> #include <vector> #include <gccore.h> #include <wiiuse/wpad.h> #include <fat.h> #include <dirent.h> using namespace std; static void *xfb = NULL; static GXRModeObj *rmode = NULL; void initVideo() { VIDEO_Init(); WPAD_Init(); rmode = VIDEO_GetPreferredMode(NULL); xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); VIDEO_Configure(rmode); VIDEO_SetNextFramebuffer(xfb); VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); cout << "\x1b[2;0H"; } int initFat() { if(!fatInitDefault()) { cout << "Unable to initialise FAT, exiting.\n"; return 1; } DIR *dir; dir = opendir("/"); if(!dir) { cout << "Failed to open dir, exiting.\n"; return 1; } closedir(dir); return 0; } void searchDir(string &rootDir, vector<string> &files) { string filePath; DIR *dir; struct dirent *entry; struct stat statbuf; dir = opendir(rootDir.c_str()); while((entry=readdir(dir)) != 0) { stat(entry->d_name, &statbuf); if(entry->d_name[0] != '.') { filePath.erase(); filePath = rootDir + string(entry->d_name) + "/"; if(S_ISDIR(statbuf.st_mode)) { searchDir(filePath, files); } if(string(entry->d_name).length() > 3) { if(string(entry->d_name).substr(string(entry->d_name).length() - 3, 3) == "jpg") { files.push_back(filePath.substr(0, filePath.size() - 1)); } } } } closedir(dir); } int main(int argc, char **argv) { vector<string> files; initVideo(); initFat(); string rootDir = "/"; cout << "Wii Image Search, press A to start or Home to quit.\n"; while(1) { WPAD_ScanPads(); u32 pressed = WPAD_ButtonsDown(0); if(pressed & WPAD_BUTTON_HOME) { return 0; } if(pressed & WPAD_BUTTON_A) { searchDir(rootDir, files); for(std::vector<string>::const_iterator i = files.begin(); i != files.end(); ++i) { cout << *i << "\n"; } } VIDEO_WaitVSync(); } return 0; }
  • PS3 Image Searcher (C++)

    Development and Coding ps3 image search c++
    1
    1 Votes
    1 Posts
    470 Views
    ScuzzS
    Here is a project I did for my final year at uni. It is a homebrew program for the PS3 that will let you search for images files on the HDD and then transfer them to USB. It’s probably buggy as hell and it only searches for file extension and the copy function is stupidly slow but it did work. It’s coded in C++ with some graphic library i found for the PS3. I can’t remember what it is. #include <NoRSX.h> #include <sys/stat.h> #include <sys/file.h> #include <fstream> #include <iostream> #include <string.h> #include <vector> #include <sysmodule/sysmodule.h> #include <io/pad.h> using namespace std; static NoRSX *GFX; string detectUSB() { int fd; string USB = ""; int usbNum = 0; char path [256]; for(usbNum = 0; usbNum < 11; usbNum++) { sprintf(path, "/dev_usb00%d/", usbNum); if(sysLv2FsOpenDir(path, &fd) == 0) { USB = string(path); } } return USB; } void searchDir(string rootDir, vector<string> &fileNames) { sysFSDirent entry; s32 fd; u64 read; string filePath; if(sysLv2FsOpenDir(rootDir.c_str(), &fd) == 0) { sysLv2FsOpenDir(rootDir.c_str(), &fd); while(!sysLv2FsReadDir(fd,&entry,&read) && strlen(entry.d_name)>0) { if(entry.d_name[0] != '.') { if(entry.d_type == 0x01) { GFX->Flip(); filePath.erase(); filePath = rootDir + string(entry.d_name) + "/"; searchDir(filePath, fileNames); } else { if(string(entry.d_name).substr(string(entry.d_name).length() - 3, 3) == "jpg") { fileNames.push_back(rootDir.substr(0, rootDir.size()) + string(entry.d_name)); } } } } sysLv2FsCloseDir(fd); } } void copyFiles(string destDir, vector<string> files) { string destFilePath = ""; string origFilePath = ""; for(std::vector<string>::const_iterator i = files.begin(); i != files.end(); i++) { origFilePath = *i; destFilePath = destDir + origFilePath.substr(origFilePath.find_last_of("/") + 1); ifstream origFile(origFilePath.c_str()); ofstream destFile(destFilePath.c_str()); destFile << origFile.rdbuf(); } } s32 main(s32 argc, const char* argv[]) { padInfo padinfo; padData paddata; ioPadInit(7); GFX = new NoRSX(); Font F(JPN, GFX); Bitmap BMap(GFX); NoRSX_Bitmap Precalculated_Layer; BMap.GenerateBitmap(&Precalculated_Layer); vector<string> files; int debug = 0; string USBStatus = ""; string HDDStatus = ""; string USBFiles = ""; string HDDFiles = ""; string test = ""; int ImagesFound = 160; F.PrintfToBitmap(100,80,&Precalculated_Layer,COLOR_RED,15,"PS3 Image Search, Press X to start or START to quit"); GFX->AppStart(); while(GFX->GetAppStatus()) { ioPadGetInfo(&padinfo); for(int i = 0; i < MAX_PORT_NUM; i++) { if(padinfo.status[i]) { ioPadGetData(i, &paddata); if(paddata.BTN_START) { GFX->AppExit(); } if(paddata.BTN_CROSS) { HDDStatus = "/dev_hdd0/Forensic/"; searchDir("/dev_hdd0/Forensic/", files); for(std::vector<string>::const_iterator i = files.begin(); i != files.end(); ++i) { BMap.DrawBitmap(&Precalculated_Layer); HDDFiles = "File: " + *i; F.PrintfToBitmap(600,ImagesFound,&Precalculated_Layer,COLOR_WHITE,15,"HDD Files: %s", HDDFiles.c_str()); GFX->Flip(); ImagesFound = ImagesFound + 20; } USBStatus = "No USB"; USBFiles = ""; if(detectUSB() != "") { USBStatus = detectUSB(); copyFiles(USBStatus, files); } } } } BMap.DrawBitmap(&Precalculated_Layer); F.Printf(100,100,COLOR_WHITE,15,"USB Status: %s", USBStatus.c_str()); F.Printf(100,120,COLOR_WHITE,15,"USB Files: %s", USBFiles.c_str()); F.Printf(100,140,COLOR_WHITE,15,"HDD Status: %s", HDDStatus.c_str()); F.Printf(100,160,COLOR_WHITE,15,"HDD Files: %s", HDDFiles.c_str()); F.Printf(100,180,COLOR_WHITE,15,"Images Found: %d", ImagesFound); F.Printf(100,200,COLOR_RED,15,"DEBUG: %d", debug); GFX->Flip(); debug++; } BMap.ClearBitmap(&Precalculated_Layer); GFX->NoRSX_Exit(); ioPadEnd(); return 0; }
  • nodebb-plugin-image-sizer

    Development and Coding nodebb plug image sizer
    1
    1 Votes
    1 Posts
    839 Views
    AlmostA
    I made a plugin so that you can resize images in markdown specifically because of this thread. The syntax is based loosely on the way iOS handles multple image sizes combined with normal markdown image embedding: ![alt text](http://someurl.com/someimage.png@<size> Size can take the following formats: 100x200 - Absolute size 100x x200 - Absolute size where the other dimension is calculated to maintain aspect ratio 50% - Percentage 0.5 - Scalar Multiplier So for example, my original picture: http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG is 1000x750. All of the following would produce the same image at 1/2 size: [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@500x375) [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@500x) [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@x375) [white house](http://cl.ly/image/2L3F1M2E1X3l/IMG_0136.JPG@50%) [white house](http://cl.ly/image/2L3F1M2E1X3l/[email protected]) Install via npm: npm install nodebb-plugin-image-sizer Source: https://github.com/Kern--/nodebb-plugin-image-sizer Known Issues: Images that are set to be wider than their container become elongated (width is set to match the container, but height is not adjusted). This means that mobile can get a bit dicey.