Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions include/bls.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#ifndef __BLSHEADER_H__
#define __BLSHEADER_H__
#pragma once
#include <stdint.h>
#include <types.h>

typedef struct _bls_entry
{
typedef struct _bls_entry {
uint32_t block_offset;
uint32_t size;
uint8_t reserved[8];
char name[32];
}
bls_entry;

typedef struct _bls_header
{
typedef struct _bls_header {
uint32_t magic;
uint32_t version;
uint32_t flags;
Expand All @@ -21,5 +20,3 @@ typedef struct _bls_header
struct _bls_entry entry_list[0];
}
bls_header;

#endif
21 changes: 0 additions & 21 deletions include/debug.h

This file was deleted.

3 changes: 3 additions & 0 deletions include/decrypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

void decrypt_pups(const char *InputPath, const char *OutputPath);
22 changes: 8 additions & 14 deletions include/decryptio.h
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
#ifndef __DECRYPTIO_H__
#define __DECRYPTIO_H__
#include <ps4.h>

#include "ps4.h"

typedef struct _decrypt_state
{
char * input_path;
typedef struct _decrypt_state {
char *input_path;
ssize_t input_base_offset;
int input_file;

char * output_path;
char *output_path;
ssize_t output_base_offset;
int output_file;

int device_fd;

char * entryname;
char *entryname;
int entryid;
int totalentries;
int pup_type;

char * notifystr;
char *notifystr;
}
decrypt_state;

#define DIO_NOSEEK 0
#define DIO_RESET -1
#define DIO_BASEOFFSET -2

ssize_t readbytes(const decrypt_state* state, size_t offset, size_t bytes, void* buffer, size_t buffersize);
ssize_t writebytes(const decrypt_state* state, size_t offset, size_t bytes, void* buffer, size_t buffersize);

#endif
ssize_t readbytes(const decrypt_state *state, size_t offset, size_t bytes, void *buffer, size_t buffersize);
ssize_t writebytes(const decrypt_state *state, size_t offset, size_t bytes, void *buffer, size_t buffersize);
11 changes: 2 additions & 9 deletions include/defines.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#ifndef __DEFINES_H__
#define __DEFINES_H__
#pragma once

#define OUTPUTPATH "/mnt/usb0/%s.dec"
#define INPUTPATH "/mnt/usb0/safe.PS4UPDATE.PUP"

#define DEBUG_SOCKET
#define DEBUG_ADDR IP(192,168,1,100);
#define DEBUG_PORT 9023

#endif
#define INPUTPATH "/mnt/usb0/safe.PS4UPDATE.PUP"
17 changes: 7 additions & 10 deletions include/encryptsrv.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#ifndef __ENCRYPTSERVICE_H__
#define __ENCRYPTSERVICE_H__
#pragma once

int encsrv_verify_blsheader(int fd, void* buffer, size_t length, int type);
int encsrv_verify_blsheader(int fd, void *buffer, uint64_t length, uint64_t unknown);

int encsrv_decrypt_header(int fd, void* buffer, size_t length, int type);
int encsrv_decrypt_header(int fd, void *buffer, size_t length, int type);

int encsrv_verify_segment(int fd, uint16_t index, void* buffer, size_t length, int additional);
int encsrv_verify_segment(int fd, uint16_t index, void *buffer, size_t length, int additional);

int encsrv_decrypt_segment(int fd, uint16_t index, void* buffer, size_t length);
int encsrv_decrypt_segment(int fd, uint16_t index, void *buffer, size_t length);

int encsrv_decrypt_segment_block(int fd, uint16_t entry_index, uint16_t block_index, void* block_buffer,
size_t block_length, void* table_buffer, size_t table_length);

#endif
int encsrv_decrypt_segment_block(int fd, uint16_t entry_index, uint16_t block_index, void *block_buffer,
size_t block_length, void *table_buffer, size_t table_length);
41 changes: 17 additions & 24 deletions include/encryptsrv_args.h
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
#ifndef __ENCRYPTSERVICEARGS_H__
#define __ENCRYPTSERVICEARGS_H__
#pragma once
#include <stdint.h>
#include <types.h>

typedef struct _verify_blsheader_args
{
void* buffer; //rbx (rsi)
uint64_t length; //r14 (rdx)
uint64_t unknown; //rax
typedef struct _verify_blsheader_args {
void *buffer; // rbx (rsi)
uint64_t length; // r14 (rdx)
uint64_t unknown; // rax
}
verify_blsheader_args;

typedef struct _decrypt_header_args
{
void* buffer;
typedef struct _decrypt_header_args {
void *buffer;
size_t length;
int type;
}
decrypt_header_args;


typedef struct _verify_segment_args
{
typedef struct _verify_segment_args {
uint16_t index;
void* buffer;
void *buffer;
size_t length;
}
verify_segment_args;

typedef struct _decrypt_segment_args
{
typedef struct _decrypt_segment_args {
uint16_t index;
void* buffer;
void *buffer;
size_t length;
}
decrypt_segment_args;

typedef struct _decrypt_segment_block_args
{
typedef struct _decrypt_segment_block_args {
uint16_t entry_index;
uint16_t block_index;
void* block_buffer;
void *block_buffer;
size_t block_length;
void* table_buffer;
void *table_buffer;
size_t table_length;
}
decrypt_segment_block_args;

#endif
decrypt_segment_block_args;
Loading