Chủ đề: [Hỏi] code này là code gì ạ
-
09-09-2013, 01:34 PM #1Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
[Hỏi] code này là code gì ạ
/*
* Copyright (c) 2005-2011 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#include "asm_help.h"
/**
* boilerplate
*/
.syntax unified
.data
.globl _kernel_code_start
.globl _kernel_code_end
.globl _kernelSlide
.globl _task_for_pid0
.globl _ioLogOffset
.globl _PE_state
.globl _sandboxBuiltin
.globl _vmMapEnter
.globl _vmMapProtect
.globl _procEnforce
.globl _amfiCSEnforcementDisable
.globl _csEnforcementDisable
.globl _PE_I_can_has_debugger
/*
* Helper Macros
*/
#define LoadRegisterSlidden(_Data, _Reg, _Scratch) \
LoadRegister(_Data, _Reg) ; \
#define LoadRegister(_Data, _Reg) \
adr _Reg, _Data ; \
ldr _Reg, [_Reg]
#define CallFunction(_Data) \
LoadRegisterSlidden(_Data, r12, r9) ; \
blx r12
/**
* kernel_code_start
*
* Patch the iOS kernel on runtime.
*/
EnterThumb(kernel_code_start)
push {lr}
cpsid if /* Disable IRQ/FIQs */
/* Enter */
adr r0, _helloString
CallFunction(_ioLogOffset)
/* Patch boot-args */
LoadRegisterSlidden(_PE_state, r1, r9)
add r1, r1, #0x70
ldr r1, [r1]
add r1, r1, #0x38
/* Copy string */
adr r0, _bootArguments
mov r2, #64
copy_loop:
ldrb r3, [r0]
strb r3, [r1]
add r0, r0, #1
add r1, r1, #1
subs r2, r2, #1
cmp r2, #0
bgt copy_loop
/* vm_map_enter */
LoadRegisterSlidden(_vmMapEnter, r0, r9)
LoadRegister(_vmMapEnter_patch, r1)
str r1, [r0]
/* vm_map_protect */
LoadRegisterSlidden(_vmMapProtect, r0, r9)
LoadRegister(_vmMapProtect_patch, r1)
str r1, [r0]
/* amfi bypass */
LoadRegisterSlidden(_amfiCSEnforcementDisable, r0, r9)
mov r1, #1
strb r1, [r0]
/* pe_i_can_has_debugger */
LoadRegisterSlidden(_PE_I_can_has_debugger, r0, r9)
mov r1, #1
str r1, [r0]
/* proc_enforce */
LoadRegisterSlidden(_procEnforce, r0, r9)
mov r1, #0
str r1, [r0]
/* cs_enforcement */
LoadRegisterSlidden(_csEnforcementDisable, r0, r9)
mov r1, #1
str r1, [r0]
/* task-for-pid 0 */
LoadRegisterSlidden(_task_for_pid0, r0, r9)
LoadRegister(_task_for_pid0_patch, r1)
str r1, [r0]
__clean_cache:
mov r0, #0
mcr p15, 0, r0, c7, c5, 4 /* Prefetch Flush */
mcr p15, 0, r0, c8, c7, 0 /* Invalidate TLB (d+i) */
mcr p15, 0, r0, c7, c5, 0 /* Invalidate cache to PoU */
mcr p15, 0, r0, c7, c5, 6 /* Invalidate branch predictor array */
isb sy
dsb sy /* Wait for operation to complete. */
movs r0, #0
cpsie if /* Re-enable IRQs/FIQs */
pop {pc}
.align 4
_ioLogOffset:
.long 0xaaaaaaaa
_PE_state:
.long 0xaaaaaaaa
_task_for_pid0_patch:
.long (0xa802e006)
_task_for_pid0:
.long 0xaaaaaaaa
_vmMapProtect_patch:
.long (0x2000e005)
_vmMapProtect:
.long 0xaaaaaaaa
_vmMapEnter_patch:
.long (0x46c02806)
_vmMapEnter:
.long 0xaaaaaaaa
/* data patches */
_procEnforce:
.long 0xaaaaaaaa
_amfiCSEnforcementDisable:
.long 0xaaaaaaaa
_PE_I_can_has_debugger:
.long 0xaaaaaaaa
_csEnforcementDisable:
.long 0xaaaaaaaa
_PE_initialize_console:
.long 0xaaaaaaaa
_kernelSlide:
.long 0xaaaaaaaa
_helloString:
.asciz "your kernel is now supervised by @winocm.
"
.align 4
_bootArguments:
.asciz "debug=0x14e serial=3 -v cs_enforcement_disable=1 amfi=0xff "
.align 4
/*
* Pad the shellcode out.
*/
.org 512
.align 2
_kernel_code_end:
nopView more random threads:
- nhận xét chất lượng service làm mới vỉ iPhone 6s lên iPhone 8
- Thay màn hình iPad Pro 9.7 chính hãng, giá rẻ tại TPHCM
- đơn giản đến khó tin với service thay vỏ iPhone 8 cho iPhone 6s
- Không vào được Mac os sau khi cài lại win
- Tổng hợp ebooks lập trình iOS mới nhất 2015
- Thay màn hình ipad mini 3 chính hãng, giá rẻ tại TPHCM
- Thay màn hình iPad 4 chính hãng, giá rẻ tại TPHCM
- Thay cáp nguồn iPhone 8 uy tín, GIÁ RẺ, lấy ngay tại TPHCM
- Combo box trong C# là gì trong xcode 5 IOS
- Tài Liệu Tiếng Việt Lập Trình Di Động Trên IOS
-
11-09-2013, 08:49 AM #2Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
code này là code asm(hợp ngữ) [IMG]images/smilies/17.gif[/IMG]
-
12-09-2013, 05:34 PM #3Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Thế à ^.^
Mình không biết nhưng thấy cũng quen quen.
Mấy bữa trước có xem qua mấy cuốn sách C thì thấy cái kernel quen quen hehe ^.^
Pallet nhựa Long An đã trở thành một trong những lựa chọn phổ biến cho nhu cầu vận chuyển và lưu trữ hàng hóa trong nhiều ngành công nghiệp. Với đặc tính nhẹ nhàng, chắc chắn và dễ vận chuyển, các...
Thanh lý pallet nhựa Long An giá rẻ