View Single Post
Old 07-21-2012   #19
checko
Apprentice
 
Join Date: Jul 2012
Posts: 12
Likes: 3
Liked 9 Times in 4 Posts
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Originally Posted by Medox View Post
maybe naehrwert can help you:





Code:
ldr.ld

ENTRY(_start)

SECTIONS
{
	. = 0x25800;
	.text :
	{
		*(.text)
	}
	.data :
	{
		*(.data)
		*(.rodata)
	}
	.bss :
	{
		bss = .;
		*(.bss)
	}
}
Code:
types.h

#ifndef _TYPES_H_
#define _TYPES_H_

typedef char s8;
typedef unsigned char u8;
typedef short s16;
typedef unsigned short u16;
typedef int s32;
typedef unsigned int u32;
typedef long long int s64;
typedef unsigned long long int u64;

#endif
Code:
start.S

.text

/* Loader entry. */
.global _start
_start:
	/* Setup stack pointer. */
	ila sp, 0x3DFA0
	
	/* Well... */
	brsl lr, main

	_hang:
		br _hang
Code:
main.c

#include "types.h"

void *_memcpy(void *dst, void *src, u32 len);

void main()
{
	//Copy eid root key/iv to shared LS.
	_memcpy((u8 *)0x3E000, (u8 *)0x00000, 0x30);
	//Hang (the PPU should copy the key/iv from shared LS now).
	while(1);
}

void *_memcpy(void *dst, void *src, u32 len)
{
	u8 *d = (u8 *)dst;
	u8 *s = (u8 *)src;
	u32 i;
	
	for(i = 0; i < len; i++)
		d[i] = s[i];
	
	return dst;
}
https://twitter.com/naehrwert/status/226682478373531648
https://twitter.com/naehrwert/status/226686257005203456
thanks but we have it right now ready, long before naehrwert said this.

Last edited by checko; 07-21-2012 at 06:49 PM.
checko is offline   Reply With Quote