Skip to content
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMPILER= clang-5.0
COMPILER= clang
OUTPUTEXEC= orbisFixElf
SOURCE_FILES= main.c myelf.c toolbox.c logger.c dyngen.c varray.c
CFLAGS= -l elf -o
Expand All @@ -7,4 +7,4 @@ all:
$(COMPILER) $(SOURCE_FILES) $(CFLAGS) $(OUTPUTEXEC)

clean:
rm $(OUTPUTEXEC)
rm $(OUTPUTEXEC)
6 changes: 3 additions & 3 deletions dyngen.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ struct orbis_comment generate_sce_comment(char *path)
void *consolidate_orbis_comment(struct orbis_comment ioc)
{
int size_of_path = strlen(ioc.path);
int projected_size = (size_of_path + 16);
int current_size;
int projected_size = (size_of_path + 16 + 1);
int current_size = 0;

void *tempBuff = malloc(projected_size);

memcpy(tempBuff, &ioc.Magic, sizeof(ioc.Magic)+1);
Expand Down
7 changes: 4 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ int main(int argc, char **argv)
// CREATE SCE COMMENT SECTION
Elf_Scn *testScn = orb_create_section(&importElf, ".sce_comment", oelf_comment_section, (size_t)projected_size_of_section);




// cleanup
if(oelf_comment_section) free(oelf_comment_section), oelf_comment_section = NULL;
varray_destroy(&importElf.fstubs_va);
varray_destroy(&importElf.vstubs_va);
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions toolbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ Elf_Scn *orb_create_section(OrbisElf *inputElf, const char *name, void *scnData,

shdr.sh_name = shstrtab_shdr.sh_size;
shstrtab_shdr.sh_size += shstrtab_data->d_size;

// cleanup
free(shstrtab_data->d_buf), shstrtab_data->d_buf = NULL;

if(!gelf_update_shdr(new_scn, &shdr))
{
Expand Down