Post: PS4 Update 1.50 + Code to Extract it
10-30-2013, 05:36 PM #1
0xX0R
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Hey hello everyone I release the update 1.50 of Playstation 4

You must login or register to view this content.

and here a script of xerpi to extract the update
    // Copyright (c) 2013  xerpi

/*
Fast and simple PS4 PUP extractor
Thanks to SKFU for the PUP information analysis
Version 2, may have lots of bugs (coded fast)
I'm not even sure this will work on Big Endian machines...

Compiling:
gcc -o ps4pupextractor ps4pupextractor.c
*/

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#define PS4_PUP_MAGIC 0x32424C53
#define PS4_PUP_HEADER_SIZE 32 //Until PUP entries
#define PS4_PUP_ENTRY_SIZE 48 //PUP entry size

struct ps4pup_pup_info {
uint32_t offset;
uint32_t content_size;
uint64_t reserved;
uint8_t filename[32];
} __attribute__((packed));

struct ps4pup_header {
uint32_t magic;
uint64_t version;
uint32_t file_count;
uint32_t block_count;
uint8_t reserved1[12];
struct ps4pup_pup_info *pups;
uint8_t reserved2[288];
} __attribute__((packed));


int ps4pup_read_header(FILE *fd, struct ps4pup_header *header);
void ps4pup_free_header(struct ps4pup_header *header);
int ps4pup_extract(FILE *fd, struct ps4pup_header *header);
void ps4pup_print_header(const struct ps4pup_header *header);

void print_usage(void);

int main (int argc, char *argv[])
{
if (argc < 2) {
print_usage();
goto exit_error;
}

FILE *fd;
if ((fd = fopen(argv[1], "rb")) == NULL ) {
printf ("Could not open %s\n", argv[1]);
goto exit_close;
}

struct ps4pup_header h;

if (!ps4pup_read_header(fd, &h)) {
printf("Error reading PUP file\n");
goto exit_close;
}

ps4pup_print_header(&h);

printf("\nExtracting PUP files...\n");

if (!ps4pup_extract(fd, &h)) {
printf("Error extracting PUP files\n");
ps4pup_free_header(&h);
goto exit_close;
}

printf("Done!\n");


ps4pup_free_header(&h);
return 1;


exit_close:
fclose(fd);
exit_error:
return EXIT_FAILURE;
}

int ps4pup_read_header(FILE *fd, struct ps4pup_header *header)
{
if (fd == NULL || header == NULL) {
return 0;
}

fseek(fd, 0, SEEK_SET);
fread((void*)header, 1, PS4_PUP_HEADER_SIZE, fd);

if (header->magic != PS4_PUP_MAGIC) {
printf("This is not a PUP file!\n");
return 0;
}

header->pups = malloc (header->file_count * sizeof(struct ps4pup_pup_info));

int i;
for (i = 0; i < header->file_count; ++i) {
fread((void*)&header->pups[i], 1, PS4_PUP_ENTRY_SIZE, fd);
}

return 1;
}


void ps4pup_free_header(struct ps4pup_header *header)
{
if (header) {
if (header->pups) {
free(header->pups);
}
}
}

int ps4pup_extract(FILE *fd, struct ps4pup_header *header)
{
if (fd == NULL || header == NULL) {
return 0;
}

FILE *pup_out;
uint8_t copy_buffer[512];
int data_offset = PS4_PUP_HEADER_SIZE + PS4_PUP_ENTRY_SIZE * header->file_count;
data_offset = (data_offset+511) & ~511; //Align to 512 bytes

int i;
for (i = 0; i < header->file_count; ++i) {
fseek(fd, data_offset + header->pups[i].offset, SEEK_SET);
pup_out = fopen(header->pups[i].filename, "wb");
int copy_size = header->pups[i].content_size;

while (copy_size > 0) {
if (copy_size > 512) {
fread(copy_buffer, 1, 512, fd);
fwrite(copy_buffer, 1, 512, pup_out);
copy_size -= 512;
} else {
fread(copy_buffer, 1, copy_size, fd);
fwrite(copy_buffer, 1, copy_size, pup_out);
copy_size = 0;
}
}
fflush(pup_out);
fclose(pup_out);
}


return 1;
}

void ps4pup_print_header(const struct ps4pup_header *header)
{
char magic_string[5];
strncpy(magic_string, (char*)(uintptr_t)(&header->magic), 4);
magic_string[4] = '\0';
printf("Magic: 0x%X %s\n", header->magic, magic_string);
printf("Version: %lu\n", header->version);
printf("File count: %i\n", header->file_count);
printf("Block count: %i\n", header->block_count);

int i;
for (i = 0; i < header->file_count; ++i) {
printf("PUP %i:\n", i+1);
printf(" Offset: 0x%X\n", header->pups[i].offset);
printf(" Size: %i\n", header->pups[i].content_size);
printf(" Filename: %s\n", header->pups[i].filename);

}
}

void print_usage(void)
{
printf("Usage:\nps4pupextractor <PS4UPDATE.PUP>\n");
printf("It will extract the PUPs as: PS4UPDATEX.PUP being X the PUP number\n");
}


and some picture for show the update structure

You must login or register to view this content.

You must login or register to view this content.

You must login or register to view this content.

source : ps3news

for the code you need to compile it for use
(adsbygoogle = window.adsbygoogle || []).push({});
10-30-2013, 05:52 PM #2
inb4 1.50 cfw. Anyways nice guide
10-30-2013, 05:53 PM #3
Master0wn3r
I’m too L33T
Originally posted by 0xX0R View Post
Hey hello everyone I you release the update 1.50 of Playstation 4

You must login or register to view this content.

and here a script of xerpi to extract the update
    // Copyright (c) 2013  xerpi

/*
Fast and simple PS4 PUP extractor
Thanks to SKFU for the PUP information analysis
Version 2, may have lots of bugs (coded fast)
I'm not even sure this will work on Big Endian machines...

Compiling:
gcc -o ps4pupextractor ps4pupextractor.c
*/

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#define PS4_PUP_MAGIC 0x32424C53
#define PS4_PUP_HEADER_SIZE 32 //Until PUP entries
#define PS4_PUP_ENTRY_SIZE 48 //PUP entry size

struct ps4pup_pup_info {
uint32_t offset;
uint32_t content_size;
uint64_t reserved;
uint8_t filename[32];
} __attribute__((packed));

struct ps4pup_header {
uint32_t magic;
uint64_t version;
uint32_t file_count;
uint32_t block_count;
uint8_t reserved1[12];
struct ps4pup_pup_info *pups;
uint8_t reserved2[288];
} __attribute__((packed));


int ps4pup_read_header(FILE *fd, struct ps4pup_header *header);
void ps4pup_free_header(struct ps4pup_header *header);
int ps4pup_extract(FILE *fd, struct ps4pup_header *header);
void ps4pup_print_header(const struct ps4pup_header *header);

void print_usage(void);

int main (int argc, char *argv[])
{
if (argc < 2) {
print_usage();
goto exit_error;
}

FILE *fd;
if ((fd = fopen(argv[1], "rb")) == NULL ) {
printf ("Could not open %s\n", argv[1]);
goto exit_close;
}

struct ps4pup_header h;

if (!ps4pup_read_header(fd, &h)) {
printf("Error reading PUP file\n");
goto exit_close;
}

ps4pup_print_header(&h);

printf("\nExtracting PUP files...\n");

if (!ps4pup_extract(fd, &h)) {
printf("Error extracting PUP files\n");
ps4pup_free_header(&h);
goto exit_close;
}

printf("Done!\n");


ps4pup_free_header(&h);
return 1;


exit_close:
fclose(fd);
exit_error:
return EXIT_FAILURE;
}

int ps4pup_read_header(FILE *fd, struct ps4pup_header *header)
{
if (fd == NULL || header == NULL) {
return 0;
}

fseek(fd, 0, SEEK_SET);
fread((void*)header, 1, PS4_PUP_HEADER_SIZE, fd);

if (header->magic != PS4_PUP_MAGIC) {
printf("This is not a PUP file!\n");
return 0;
}

header->pups = malloc (header->file_count * sizeof(struct ps4pup_pup_info));

int i;
for (i = 0; i < header->file_count; ++i) {
fread((void*)&header->pups[i], 1, PS4_PUP_ENTRY_SIZE, fd);
}

return 1;
}


void ps4pup_free_header(struct ps4pup_header *header)
{
if (header) {
if (header->pups) {
free(header->pups);
}
}
}

int ps4pup_extract(FILE *fd, struct ps4pup_header *header)
{
if (fd == NULL || header == NULL) {
return 0;
}

FILE *pup_out;
uint8_t copy_buffer[512];
int data_offset = PS4_PUP_HEADER_SIZE + PS4_PUP_ENTRY_SIZE * header->file_count;
data_offset = (data_offset+511) & ~511; //Align to 512 bytes

int i;
for (i = 0; i < header->file_count; ++i) {
fseek(fd, data_offset + header->pups[i].offset, SEEK_SET);
pup_out = fopen(header->pups[i].filename, "wb");
int copy_size = header->pups[i].content_size;

while (copy_size > 0) {
if (copy_size > 512) {
fread(copy_buffer, 1, 512, fd);
fwrite(copy_buffer, 1, 512, pup_out);
copy_size -= 512;
} else {
fread(copy_buffer, 1, copy_size, fd);
fwrite(copy_buffer, 1, copy_size, pup_out);
copy_size = 0;
}
}
fflush(pup_out);
fclose(pup_out);
}


return 1;
}

void ps4pup_print_header(const struct ps4pup_header *header)
{
char magic_string[5];
strncpy(magic_string, (char*)(uintptr_t)(&header->magic), 4);
magic_string[4] = '\0';
printf("Magic: 0x%X %s\n", header->magic, magic_string);
printf("Version: %lu\n", header->version);
printf("File count: %i\n", header->file_count);
printf("Block count: %i\n", header->block_count);

int i;
for (i = 0; i < header->file_count; ++i) {
printf("PUP %i:\n", i+1);
printf(" Offset: 0x%X\n", header->pups[i].offset);
printf(" Size: %i\n", header->pups[i].content_size);
printf(" Filename: %s\n", header->pups[i].filename);

}
}

void print_usage(void)
{
printf("Usage:\nps4pupextractor <PS4UPDATE.PUP>\n");
printf("It will extract the PUPs as: PS4UPDATEX.PUP being X the PUP number\n");
}


and some picture for show the update structure

You must login or register to view this content.

You must login or register to view this content.

You must login or register to view this content.


dont you have toadd a source?
as i read this a few hours ago somewhere else lol!
BTW how to use that code lol wanna look in the firmware
10-30-2013, 05:54 PM #4
Master0wn3r
I’m too L33T
wow double post sorry
10-30-2013, 09:08 PM #5
Glad this got re-uploaded. The other thread's link doesn't work. Lol. I want to be able to have this on a flashdrive as I'm gonna upgrade the HDD in my PS4 on day 1 to a 1TB 7200 HDD or a 1TB SSD. Haven't decided yet. Gotta see how much $$ I have. Obviously the SSD is a shit ton more expensive in terms of price/GB.
11-01-2013, 12:53 PM #6
iTruceFret
[move]From now on, call me DRAGON.[/move]
I'm not going to wait with the massive amounts of people tryin to download this, so I'm putnig it on my flash drive now. It's the same format as the PS3 I assume?

PS4>UPDATE>PS4UPDAT.PUP ?
11-02-2013, 06:46 AM #7
QATAR♛
Error… Cat invasion!
So you mean this is a jailbreak i still didn't understand the thread LOL :P

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo