Difference between revisions of "Secure Modules"

From Vita Development Wiki
Jump to navigation Jump to search
(Created page with "== sm common code == sm modules are loaded to 0x80B000, then code from that addr is executed. These functions are called: * Init (__libc_init_array?) * main() ** Some unknow...")
 
Line 1: Line 1:
 
== sm common code ==
 
== sm common code ==
  
sm modules are loaded to 0x80B000, then code from that addr is executed. These functions are called:
+
sm modules are loaded to 0x80B000, then code from that addr is executed.
  
* Init (__libc_init_array?)
+
There is a lot of common code shared between sm: entry, cmd handler, cmd setup, etc
* main()
+
 
** Some unknown sub is called.
+
== Entry ==
** Then it registers all cmd handlers creating a list of pairs function id=>function ptr
+
 
** Main loop:
+
This is the first code executed in sm. It's located at 0x80B000. It does the following:
*** Calls syscall 4 to register interrupt 9, this is the command handler
+
 
*** Then it busyloops until some flag is set to 0
+
* Get random value (stack cookie?)
*** Calls syscall 4 to unregister interrupt 9
+
* call_ctors()
** Some other unk func
+
* sm_main()
* Deinit
+
* call_dtors()
* Syscall 1 is executed (unload)
+
* syscall 1: Unload
* Then it infinite loops
+
* while(1) sleep()

Revision as of 02:58, 7 March 2018

sm common code

sm modules are loaded to 0x80B000, then code from that addr is executed.

There is a lot of common code shared between sm: entry, cmd handler, cmd setup, etc

Entry

This is the first code executed in sm. It's located at 0x80B000. It does the following:

  • Get random value (stack cookie?)
  • call_ctors()
  • sm_main()
  • call_dtors()
  • syscall 1: Unload
  • while(1) sleep()