1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>buryarg</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9<STYLE type="text/css"> 10<!-- 11.sample_source{ 12 background-color : #e8e8e8; 13} 14H3{ 15 color : teal; 16} 17.command_list{ 18 margin-bottom : 16pt; 19} 20.command_desc{ 21 } 22.command_item{ 23 margin-top : 16pt; 24 background-color : #e8e8e8; 25} 26.blockquoted_table { 27 border : 1px; 28 width : 80%; 29} 30TD,TH{ 31 border-color : #c0d8d8; 32 padding : 1pt 4pt 1pt 4pt; 33 border-width : 1px; 34 border-style : solid; 35} 36--> 37</STYLE> 38</HEAD> 39<BODY> 40<H1 align="left">buryarg <IMG src="../image/NTR.gif" align="middle"></H1> 41<H2>Description</H2> 42<P><B>This command is for NITRO ROMs.</B>See <CODE><A href="buryargTWL.html">buryarg.TWL</A></CODE> for details on TWL ROMs.</P> 43<P>In TWL-SDK, an area for argument data is set up in the ROM image. By rewriting this section before startup, you can pass which parameters are possible to use as C language argc and argv format arguments. The ROM image file can be directly overwritten, so you can test the program under multiple conditions without having to recompile.</P> 44<P><CODE>buryarg</CODE> is a tool for writing argument data to the argument data area for the specified binary data. This tool is used with NITRO ROMs; use <CODE><A href="buryargTWL.html">buryarg.TWL</A></CODE> on NITRO/TWL hybrid ROMs or TWL-exclusive ROMs.</P> 45<P>If the argument data region within the program is not referenced, that region will not be created. The <CODE>buryarg</CODE> tool cannot be used for ROMs for which this area has not been created.</P> 46<H2>Using the Tool</H2> 47<H3>Start Command</H3> 48<P><CODE>% buryarg [OPTION]... NITROSRLFILE [argument]...</CODE></P> 49<P><CODE>NITROSRLFILE</CODE> is the original ROM file for rewriting. Normally, this is a .srl file. However, if you specify a .nlf file, it will be analyzed and the operation will be done on the ARM9 resident module file.</P> 50<P>If the <CODE><B>-r</B> or <B>--remain</B></CODE> options are specified, the original file will remain. By default, the original file will be modified. So if you don't want to change the original file, specify this option. The alias filename is the original filename plus <CODE>.argAdded</CODE>. When the output file is selected with <CODE>-o</CODE> option, the original file will not be changed, even when this option is not specified.</P> 51<P>The <B>-o</B> and <B>--output</B> options take arguments. With this option, the output file is specified as in the following: <CODE>-o=dest.srl</CODE> or <CODE>-o dest.srl</CODE>. <B>Do not specify the same file for the source file and the output file.</B>Also, if "<CODE>-</CODE>" (minus) is specified as the output file, output goes to standard output.( Specify as: <CODE>-o-</CODE>. See <CODE>--stdout</CODE>, which is explained below.</P> 52<P><CODE><B>--stdout</B></CODE> is the same as specifying <CODE>-o-</CODE>. It outputs to standard output.</P> 53<P>The <CODE><B>-f</B></CODE> and <CODE><B>--file</B></CODE> options take arguments. These options are for specifying a file as the data to replace. Specify as: <CODE>-f=rep.dat</CODE> or <CODE> -f rep.dat</CODE>.</P> 54 55<P>If the <CODE><B>-q</B></CODE> or <CODE><B>--quiet</B></CODE> option is specified, quiet mode is used, and only error messages will be output. </P> 56<P>If the <B><CODE>-v</CODE></B> or <B><CODE>--verbose</CODE></B> option is specified, detailed operation descriptions are displayed. Because output is made on the standard output, do not specify these options together when writing ROM data to the standard output.</P> 57<P>The <CODE><B>-h</B></CODE> or <CODE><B>--help</B></CODE> options display simple instructions.</P> 58<P>The <CODE><B>-d</B></CODE> or <CODE><B>--debug</B></CODE> options are for debugging. They dump the data that is to be replaced.</P> 59<P>The <CODE><B>--version</B></CODE> option displays the command version.</P> 60<H3>Argument Data Area</H3> 61<P>Immediately after a NITRO ROM is compiled, a string is written in the argument data region within the ROM data. This string is used to identify that region. <CODE>buryarg</CODE> searches for this text string in the ROM and then reads the argument data. The string used for finding the position is not rewritten, so the argument data can be rewritten over and over again to the same ROM data.</P> 62<BLOCKQUOTE><IMG src="buryarg_image1.gif" border="0"></BLOCKQUOTE> 63<P>The argument area's data can be accessed from your program by using <A href="../os/argument/OS_GetArgc.html"><CODE>OS_GetArgc()</CODE></A> and <CODE><A href="../os/argument/OS_GetArgv.html">OS_GetArgv()</A></CODE>. <BR> 64</P> 65<BLOCKQUOTE><IMG src="buryarg_image2.gif" border="0"></BLOCKQUOTE> 66<P><BR> <BR> <BR> <B>Caution:</B> Be careful to avoid the following errors.</P> 67<BLOCKQUOTE>- You specified the same file as the input file with the <CODE>-o</CODE> option. <BR>&rarr; This specification is not required if you want to overwrite the argument data. This is the default behavior.</BLOCKQUOTE> 68<BLOCKQUOTE>- You overwrote the argument data for the SRL file. Then started up from the NLF file. <BR>&rarr; When an application is started from an NLF file, the modules included in the NLF file are read by the debugger. Even if the SRL file is overwritten, those changes are not applied. If starting an application from an NLF file, be sure to specify the NLF file with <CODE>buryarg</CODE> and overwrite the necessary data.</BLOCKQUOTE> 69<BLOCKQUOTE>- You overwrote the argument data for the NLF file. Then started up the SRL file. <BR>&rarr; This is the opposite of the example above. Overwrite the argument data for the SRL file.</BLOCKQUOTE> 70<BLOCKQUOTE>- You tried to overwrite the argument data of an image that does not have an argument data area. <BR>&rarr; ROM images created with old versions of the SDK do not have an area to store the argument data. When the <CODE>buryarg</CODE> command is run on these images, it will display an error that indicates the string for the argument data area could not be found, and the command then terminates. <FONT color="#ff0000">&rarr; If the argument data region is not referenced at least once within the program, the argument data region will be deadstripped at compile time. </FONT>For example, if the <CODE>OS_GetArgc</CODE> or <CODE>OS_GetArgv</CODE> function has never been called, an error occurs.</BLOCKQUOTE> 71<BLOCKQUOTE>- You tried to overwrite the argument data on a FINALROM build image. <BR> <FONT color="#ff0000">&rarr; The FINALROM build image does not have an area to store the argument data.</FONT></BLOCKQUOTE> 72<BLOCKQUOTE>- You tried to overwrite the argument data on a TWL mode ROM. <BR> <FONT color="#ff0000">&rarr; Only NITRO ROMs can be overwritten with this command. </FONT>For TWL mode ROMs, use the <A href="buryargTWL.html"><CODE>buryarg.TWL</CODE></A> command instead of <CODE>buryarg</CODE>.</BLOCKQUOTE> 73<H3>FINALROM and Argument Data</H3> 74<P>Argument data cannot be handled with a FINALROM. There is no memory for storing argument data. The<A href="../os/argument/OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A> function always returns 0. The <A href="../os/argument/OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A> always returns <CODE>NULL</CODE>. The reason that argument data cannot be handled for FINALROM builds is that a security hole may develop if a program depends on data that can be provided externally.</P> 75<P>Even in the case of a FINALROM build, the check routine in the program remains as long as it is not deleted. Attention is required because this code is meaningless in the case of FINALROM builds. (For example, for a game with 30 stages, analysis is made of a check routine such as "if argument data is STAGE > 30" may lead to the assumption that there may be a hidden stage.)</P> 76<H2>Location</H2> 77<P><CODE>$TwlSDK/tools/bin/buryarg.exe</CODE></P> 78<H2>See Also</H2> 79<P> <A href="buryargTWL.html"><CODE>buryarg.TWL</CODE></A><BR> <A href="../os/argument/OS_GetArgc.html"><CODE>OS_GetArgc</CODE></A><BR> <A href="../os/argument/OS_GetArgv.html"><CODE>OS_GetArgv</CODE></A><BR> <A href="../os/argument/OS_GetOpt.html"><CODE>OS_GetOpt*</CODE></A></P> 80<H2>Revision History</H2> 81<P>2008/07/08 Added information so that <A href="buryargTWL.html"><CODE>buryarg.TWL</CODE></A> is used for TWL.<BR> 2008/06/24 Added the fact that this mechanism cannot be used with TWL.<BR> 2005/08/30 Added <CODE>OS_GetOpt*</CODE> to <B>See Also</B>. Added <CODE>--stdout</CODE>. <BR> 2005/07/22 Support for NLF files. <BR> 2005/07/21 Initial version.</P> 82<hr><p>CONFIDENTIAL</p></body> 83</HTML>