ninjhax/source/brahma.c
int map_arm9_payload(void) {
	extern u32 arm9_start[];
	extern u32 arm9_end[];

	u32 *src, *src_end;
	
	
	src = payload_bin;
	src_end = payload_bin + payload_bin_size;
	
	u32 *dst = (u32 *)(ed.va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD);
	while (src != src_end) {
		*dst = *src;
		src++;
		dst++;				
	}	
	unsigned int *buf = (u32 *)(ed.va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD); 
	unsigned int base = 0x12832738; 
	unsigned int seed = 0x76298987;
	int i;
	for(i = 0; i < 400*1024/4; i++){
		buf[i] ^= base;
		base += seed;
	}
}
/* copies externally loaded ARM9 payload to FCRAM
   - Please note that the ARM11 payload copies
     the original ARM9 entry point from the mapped
	 FIRM header to offset 4 of the ARM9 payload.
	 Thus, the ARM9 payload should consist of
	 - a branch instruction at offset 0 and
	 - a placeholder (u32) at offset 4 (=ARM9 entrypoint)  
*/
copies externally loaded ARM9 payload to FCRAM
Please note that the ARM11 payload copies
the original ARM9 entry point from the mapped
FIRM header to offset 4 of the ARM9 payload.
Thus, the ARM9 payload should consist of
a branch instruction at offset 0 and
a placeholder (u32) at offset 4 (=ARM9 entrypoint)
copies externally loaded ARM9 payload to FCRAM Please note that the ARM11 payload copies the original ARM9 entry point from the mapped FIRM header to offset 4 of the ARM9 payload . Thus the ARM9 payload should consist of a branch instruction at offset 0 and a placeholder ( u32 ) at offset 4 ( = ARM9 entrypoint )
int map_arm9_payload(void) {
	extern u32 arm9_start[];
	extern u32 arm9_end[];
	u32 *src, *src_end;
	src = payload_bin;
	src_end = payload_bin + payload_bin_size;
	u32 *dst = (u32 *)(ed.va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD);
	while (src != src_end) {
		*dst = *src;
		src++;
		dst++;				
	}	
	unsigned int *buf = (u32 *)(ed.va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD); 
	unsigned int base = 0x12832738; 
	unsigned int seed = 0x76298987;
	int i;
	for(i = 0; i < 400*1024/4; i++){
		buf[i] ^= base;
		base += seed;
	}
}
int map_arm9_payload ( void ) { extern u32 arm9_start [ ] ; extern u32 arm9_end [ ] ; u32 * src , * src_end ; src = payload_bin ; src_end = payload_bin + payload_bin_size ; u32 * dst = ( u32 * ) ( ed . va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD ) ; while ( src != src_end ) { * dst = * src ; src ++ ; dst ++ ; } unsigned int * buf = ( u32 * ) ( ed . va_fcram_base + OFFS_FCRAM_ARM9_PAYLOAD ) ; unsigned int base = 0x12832738 ; unsigned int seed = 0x76298987 ; int i ; for ( i = 0 ; i < 400 * 1024 / 4 ; i ++ ) { buf [ i ] ^= base ; base += seed ; } }
copies externally loaded ARM9 payload to FCRAM
 Please note that the ARM11 payload copies
the original ARM9 entry point from the mapped
FIRM header to offset 4 of the ARM9 payload.
copies externally loaded ARM9 payload to FCRAM Please note that the ARM11 payload copies the original ARM9 entry point from the mapped FIRM header to offset 4 of the ARM9 payload .