#include <pspdebug.h>
#include <pspiofilemgr.h>
#include <string.h>
#include "stdio.h"
#include "stdioo.h"

int ReadPassword(const char *password_path, char *comparison, int file_size)
{
    int res;
    int i = 0;
    char buf[file_size];
    FILE *pp = fopen(password_path, "r");
    
    sprintf(buf, "%s", fgets(buf, file_size, pp));
    
    
    Encrypt_Numbers(4, 4);
   /* while(i)
    {
          buf[i] = buf[i] - 20;
          i++;
          if(i == 5)
          { goto continue_here; }
    }*/
    /*continue_here :*/
    //pspDebugScreenPrintf("%s | ", buf);
    
    
    if(buf)
    { fclose(pp); }
    
    if(strcmp(buf, comparison) == 0)
    res = 0;
    else
    res = -1;
    
    
    return res;
}

int ReadFileReturn(const char *file)
{
    int ftr = sceIoOpen(file, PSP_O_RDONLY, 0777);
    
    return ftr;
}


