/*---------------------------------------------------------------------------* Project: TwlSDK - stripdebug File: stripdebug.c Copyright 2006-2008 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Date:: 2008-09-17#$ $Rev: 8556 $ $Author: okubata_ryoma $ *---------------------------------------------------------------------------*/ #include #include // atoi() #include #include // getopt() #include #include "types.h" #include "elf.h" #include "elf_loader.h" #include "searcharg.h" #define DS_ROM_HEADER_SIZE 0x4000 char* input_elf_fname = NULL; char* stripped_elf_fname = NULL; char* added_elf_fname = NULL; char c_source_line_str[256]; #define STRIPPED_ELF_FILENAME "stripped-" #define ADDED_ELF_FILENAME "added-" FILE* NewElfFilep; /*---------------------------------------------------------------------------* * *---------------------------------------------------------------------------*/ u32 adr_ALIGN( u32 addr, u32 align_size); void file_write( char* c_str, FILE* Fp); /*---------------------------------------------------------------------------* * *---------------------------------------------------------------------------*/ u16 dbg_print_flag; u16 unresolved_table_block_flag = 0; /*---------------------------------------------------------------------------* * MAIN *---------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { FILE *FHp; u32* newelfbuf; #if (SPECIAL_SECTION_ENABLE == 1) /*Add special section*/ u32* dbgelfbuf; #endif // u32* aligned_newelfbuf; u32 elfsize; ELHandle ElfH, ElfH2; char* elf_filename; u32 elf_namesize; char* slash_pointer; u16 result; /* for( i=0; i