File tree Expand file tree Collapse file tree 2 files changed +1
-20
lines changed
Expand file tree Collapse file tree 2 files changed +1
-20
lines changed Original file line number Diff line number Diff line change 33# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
44#
55
6- """
7- set_tls
8- """
9- def ql_arm_init_get_tls (ql ):
10- ql .mem .map (0xFFFF0000 , 0x1000 , info = "[arm_tls]" )
11- """
12- 'adr r0, data; ldr r0, [r0]; mov pc, lr; data:.ascii "\x00 \x00 "'
13- """
14- sc = b'\x04 \x00 \x8f \xe2 \x00 \x00 \x90 \xe5 \x0e \xf0 \xa0 \xe1 \x00 \x00 \x00 \x00 '
156
16- # if ql.archendian == QL_ENDIAN.EB:
17- # sc = swap_endianess(sc)
18-
19- ql .mem .write (ql .arch .arm_get_tls_addr , sc )
20- ql .log .debug ("Set init_kernel_get_tls" )
21-
22- def swap_endianess (s : bytes , blksize = 4 ) -> bytes :
23- blocks = (s [i :i + blksize ] for i in range (0 , len (s ), blksize ))
24-
25- return b'' .join (bytes (reversed (b )) for b in blocks )
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def run_function_after_load(self):
101101 f ()
102102
103103
104- def hook_sigtrap (self , intno = None , int = None ):
104+ def hook_sigtrap (self , intno = None , int = None ):
105105 self .ql .log .info ("Trap Found" )
106106 self .emu_error ()
107107 exit (1 )
You can’t perform that action at this time.
0 commit comments