Guest User

Untitled

a guest
Jun 15th, 2012
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. void switch_to_user_mode() {
  2.    __asm__ volatile(" mov %ax,0x23; \
  3.     mov %ds,%ax; \
  4.     mov %es,%ax;  \
  5.     mov %fs,%ax;  \
  6.     mov %gs,%ax; \
  7.     mov %eax,%esp; \
  8.     push 0x23; \
  9.     push %eax; \
  10.     pushf; \
  11.     push 0x1B; \
  12.     push user_mode; \
  13.     iret; \
  14.     ");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment