obfuscated.test
6.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
REQUIRES: system-darwin
RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.map %p/../Inputs/obfuscated.arm64 -f -o - \
RUN: | llvm-dwarfdump -v - \
RUN: | FileCheck %s
RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.map %p/../Inputs/obfuscated.arm64 -f -o - \
RUN: | llvm-dwarfdump -v - \
RUN: | FileCheck --check-prefix=NOHIDDEN %s
RUN: dsymutil --symbol-map %p/../Inputs/obfuscated.2.map %p/../Inputs/obfuscated.2.arm64 -f -o - \
RUN: | llvm-dwarfdump -v - \
RUN: | FileCheck --check-prefix=NOHIDDEN %s
// Run with plist and make sure dsymutil finds it.
RUN: mkdir -p %t.dSYM/Contents/Resources/DWARF/
RUN: mkdir -p %t.mapdir
RUN: cp %p/../Inputs/obfuscated.arm64 %t.dSYM/Contents/Resources/DWARF/
RUN: cp %p/../Inputs/E828A486-8433-3A5E-B6DB-A6294D28133D.plist %t.dSYM/Contents/Resources/
RUN: cp %p/../Inputs/obfuscated.map %t.mapdir/506AA50A-6B26-3B37-86D2-DC6EBD57B720.bcsymbolmap
RUN: dsymutil --symbol-map %t.mapdir %t.dSYM 2>&1 | FileCheck --check-prefix=OBFUSCATING %s
// Run without plist and make sure dsymutil doesn't crash.
RUN: rm %t.dSYM/Contents/Resources/E828A486-8433-3A5E-B6DB-A6294D28133D.plist
RUN: dsymutil --symbol-map %t.mapdir %t.dSYM 2>&1 | FileCheck --check-prefix=NOTOBFUSCATING %s
OBFUSCATING-NOT: not unobfuscating
NOTOBFUSCATING: not unobfuscating
NOHIDDEN-NOT: __hidden#
CHECK: .debug_info contents:
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "main.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "main")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "one.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "one")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "two.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "two")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "three.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "three")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "four.c")
CHECK: DW_AT_stmt_list [DW_FORM_data4] (0x0000011e)
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "four")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "five.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "five")
CHECK: DW_TAG_compile_unit [1] *
CHECK: DW_AT_producer [DW_FORM_strp] ( {{.*}} "Apple LLVM version 7.0.0 (clang-700.2.38.2)")
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "six.c")
CHECK: DW_AT_comp_dir [DW_FORM_strp] ( {{.*}} "/Users/steven/dev/alpena/tests/src")
CHECK: DW_TAG_subprogram [2]
CHECK: DW_AT_name [DW_FORM_strp] ( {{.*}} "six")
CHECK: .debug_line contents:
CHECK: file_names[ 1]:
CHECK: name: "main.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "one.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "two.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "three.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "four.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "five.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: file_names[ 1]:
CHECK: name: "six.c"
CHECK: dir_index: 0
CHECK: mod_time: 0x00000000
CHECK: length: 0x00000000
CHECK: .debug_pubnames contents:
CHECK: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000044
CHECK: 0x0000002e "main"
CHECK: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000044, unit_size = 0x00000044
CHECK: 0x0000002e "one"
CHECK: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000088, unit_size = 0x00000044
CHECK: 0x0000002e "two"
CHECK: length = 0x00000018, format = DWARF32, version = 0x0002, unit_offset = 0x000000cc, unit_size = 0x00000044
CHECK: 0x0000002e "three"
CHECK: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000110, unit_size = 0x00000044
CHECK: 0x0000002e "four"
CHECK: length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000154, unit_size = 0x00000044
CHECK: 0x0000002e "five"
CHECK: length = 0x00000016, format = DWARF32, version = 0x0002, unit_offset = 0x00000198, unit_size = 0x00000044
CHECK: 0x0000002e "six"
CHECK: .apple_names contents:
CHECK: String: 0x00000091 "five"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x00000182
CHECK-NEXT: ]
CHECK: String: 0x0000009c "six"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x000001c6
CHECK-NEXT: ]
CHECK: String: 0x00000078 "three"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x000000fa
CHECK-NEXT: ]
CHECK: String: 0x0000006c "two"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x000000b6
CHECK-NEXT: ]
CHECK: String: 0x00000057 "main"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x0000002e
CHECK-NEXT: ]
CHECK: String: 0x00000085 "four"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x0000013e
CHECK-NEXT: ]
CHECK: String: 0x00000062 "one"
CHECK-NEXT: Data 0 [
CHECK-NEXT: Atom[0]: 0x00000072
CHECK-NEXT: ]