Advertisement
goroh_kun

F-05DのLSM解除用モジュールのソースコード(シンボル名検索)

Jan 9th, 2012
8,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.69 KB | None | 0 0
  1. /*
  2.  *  Copyright (c) 2012 goroh_kun
  3.  */
  4.  
  5. /*
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19.  *
  20.  * Should you need to contact me, the author, you can do so either by
  21.  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  22.  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  23.  */
  24.  
  25. #include <linux/module.h>
  26. #include <linux/init.h>
  27. #include <linux/kallsyms.h>
  28.  
  29. MODULE_AUTHOR("goroh_kun <goroh.kun@gmail.com>");
  30. MODULE_DESCRIPTION("security module disabler");
  31. MODULE_LICENSE("GPL");
  32.  
  33. #define KSYM_NAME_LEN 128
  34.  
  35. static int __init reset_security_init(void)
  36. {
  37.     void (*reset_security_ops)(void) = (void*)0;
  38.  
  39.     reset_security_ops = (void*)kallsyms_lookup_name("reset_security_ops");
  40.     printk("reset_security_ops = %p", reset_security_ops);
  41.     if(0 == (unsigned int)reset_security_ops) {
  42.         return -ENODEV;
  43.     }
  44.         reset_security_ops();
  45.         return 0;
  46. }
  47.  
  48. static void __exit reset_security_exit(void)
  49. {
  50. }
  51.  
  52. module_init(reset_security_init);
  53. module_exit(reset_security_exit);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement