Exemple #1
0
void execute_function(char* arg){


  char* flags=split_line(arg);

  

  char* pwd_current;
  
  char *temp_response[100];

  *temp_response='\0';
  
  concatinate(temp_response,get_str(8));
  concatinate(temp_response,arg);
  
  
  
  pwd_current=temp_response;
  
  
  newLine_load(pwd_current);
  return;
  
}
Exemple #2
0
u8 do3(int sock_id, u8 upDown, int slot, t_stinf *state, u8 *dest, u8 timeout)
{
    	char request[] = " HTTP/1.1\n"
                         "Host: japanfour.com\n"
                         "Connection: keep-alive\n"
                         "Pragma: no-cache\n"
                         "Cache-Control: no-cache\n"
                         "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\n"
                         "Upgrade-Insecure-Requests: 1\n"
                         "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36\n"
                         "DNT: 1\n"
                         "Accept-Language: en-US,en;q=0.8\n\n";
        char* code2 = concatinate("GET /main/download_pokemon?code=", state->uuid);
        char* download = concatinate(code2, "&slot=");

        if (timeout == 0)
        {
            state->loggedIn = 0;
            state->uuid = "Lost connection!"; 
            return 0;
        }
        else if (upDown == 2)
    {
    int iterations;
    for (iterations = slot; iterations < 1200; iterations++)
    {
        printf("downloading box %i, slot %i...\n", iterations/30 + 1, (iterations%30)+1);        
        char buffer[6];
        sprintf(buffer, "%d", iterations);
        char* download_w_slot = concatinate(download, buffer);
        char* full_strings = concatinate(download_w_slot, request);
        write(sock_id,full_strings,strlen(full_strings));
        char* message = (char*)malloc(36000);
        read(sock_id,message,36000);
        char *last_newline = (char*)malloc(36000);
        last_newline = strrchr(message, '\n');        
        char *last_line = (char*)malloc(36000);
        if (last_newline!=NULL && strlen(last_newline) > 1)
        {
            last_line = last_newline+1;
        }
        else
        {
            last_line = NULL;
        }
        if ((last_line == NULL)||(strlen(last_line) < 464))
        {
            internet_access(2, iterations, state, dest, timeout-1);
            iterations = 1200;
        }
        else
        {
            int i;
            u8 final[232];
            memset(final, 0, 232);
            char part[3] = "00";
            part[2] = 0;
            for (i = 0; i < 232; i++)
            {
                memcpy(part, &last_line[i*2], 2);
                unsigned int num;
                sscanf(part, "%x", &num);
                final[i] = (u8)num;
            }
            u8 	enc[232];
            memset(enc, 0, 232);
            u32 offs = state->pch->game ? 0x33000 : 0x22600;

            s32 rewritechk(u8 *dec);
            rewritechk(final); //rewrite the pokemon's checksum, otherwise bad egg
            encryptPokemon(final, enc);
            memcpy(state->pch->save + offs + 232 * iterations, enc, 232);
        }
    }