This source file includes following definitions.
- filewritetask
- sub_FFA7928C_my
- sub_FFA793C0_my
- sub_FFA78E38_my
1 #include "lolevel.h"
2 #include "platform.h"
3
4 typedef struct {
5 unsigned int address;
6 unsigned int length;
7 } cam_ptp_data_chunk;
8
9 #define MAX_CHUNKS_FOR_FWT 4
10
11
12
13
14
15
16
17 typedef struct
18 {
19 int unkn1, unkn2, unkn3, unkn4, unkn5;
20 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
21 int unkn6;
22 char name[32];
23 } fwt_data_struct;
24
25 #include "../../../generic/filewrite.c"
26
27
28
29 void __attribute__((naked,noinline)) filewritetask () {
30 asm volatile (
31 " STMFD SP!, {R1-R5,LR} \n"
32 " LDR R4, =0xB414 \n"
33 "loc_FFA78FA8:\n"
34 " LDR R0, [R4, #0x10] \n"
35 " MOV R2, #0 \n"
36 " ADD R1, SP, #8 \n"
37 " BL sub_FF8382FC \n"
38 " CMP R0, #0 \n"
39 " BNE loc_FFA78FD8 \n"
40 " LDR R0, [SP, #8] \n"
41 " LDR R1, [R0] \n"
42 " CMP R1, #1 \n"
43 " BNE loc_FFA78FE0 \n"
44 " LDR R0, [R4, #8] \n"
45 " BL sub_FF8387E8 \n"
46 "loc_FFA78FD8:\n"
47 " BL sub_FF81E844 \n"
48 " LDMFD SP!, {R1-R5,PC} \n"
49 "loc_FFA78FE0:\n"
50 " SUB R1, R1, #2 \n"
51 " CMP R1, #6 \n"
52 " ADDLS PC, PC, R1, LSL #2 \n"
53 " B loc_FFA78FA8 \n"
54 " B loc_FFA7900C \n"
55 " B loc_FFA79070 \n"
56 " B loc_FFA79078 \n"
57 " B loc_FFA79078 \n"
58 " B loc_FFA79078 \n"
59 " B loc_FFA79078 \n"
60 " B loc_FFA79080 \n"
61 "loc_FFA7900C:\n"
62 " MOV R0, #0 \n"
63 " STR R0, [SP] \n"
64 "loc_FFA79014:\n"
65 " LDR R0, [R4, #0x10] \n"
66 " MOV R1, SP \n"
67 " BL sub_FF838540 \n"
68 " LDR R0, [SP] \n"
69 " CMP R0, #0 \n"
70 " BEQ loc_FFA79040 \n"
71 " LDR R0, [R4, #0x10] \n"
72 " MOV R2, #0 \n"
73 " ADD R1, SP, #4 \n"
74 " BL sub_FF8382FC \n"
75 " B loc_FFA79014 \n"
76 "loc_FFA79040:\n"
77 " LDR R0, [R4] \n"
78 " CMN R0, #1 \n"
79 " BEQ loc_FFA79064 \n"
80 " BL fwt_close\n"
81 " MVN R0, #0 \n"
82 " STR R0, [R4] \n"
83 " LDR R0, =0xD1D1C \n"
84 " BL sub_FF86E540 \n"
85 " BL sub_FF86C924 \n"
86 "loc_FFA79064:\n"
87 " LDR R0, [R4, #0xC] \n"
88 " BL sub_FF8387E8 \n"
89 " B loc_FFA78FA8 \n"
90 "loc_FFA79070:\n"
91 " BL sub_FFA7928C_my \n"
92 " B loc_FFA78FA8 \n"
93 "loc_FFA79078:\n"
94 " BL sub_FFA793C0_my \n"
95 " B loc_FFA78FA8 \n"
96 "loc_FFA79080:\n"
97 " BL sub_FFA78E38_my \n"
98 " B loc_FFA78FA8 \n"
99 );
100 }
101
102
103
104 void __attribute__((naked,noinline)) sub_FFA7928C_my( ) {
105 asm volatile (
106 " STMFD SP!, {R4-R8,LR} \n"
107 " MOV R4, R0 \n"
108 " ADD R0, R0, #0x38 \n"
109 " SUB SP, SP, #0x38 \n"
110 " BL sub_FF86E540 \n"
111 " MOV R1, #0 \n"
112 " BL sub_FF86C8D4 \n"
113 " LDR R0, [R4, #0xC] \n"
114 " BL sub_FF86B490 \n"
115 " LDR R7, [R4, #8] \n"
116 " LDR R8, =0x1B6 \n"
117 " ADD R6, R4, #0x38 \n"
118 " LDR R5, [R4, #0xC] \n"
119
120 "STMFD SP!, {R4-R12,LR}\n"
121 "MOV R0, R4\n"
122 "BL filewrite_main_hook\n"
123 "LDMFD SP!, {R4-R12,LR}\n"
124
125 " MOV R0, R6 \n"
126 " MOV R1, R7 \n"
127 " MOV R2, R8 \n"
128 " BL fwt_open\n"
129 "LDR PC, =0xffa792d0\n"
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183 );
184 }
185
186
187
188 void __attribute__((naked,noinline)) sub_FFA793C0_my( ) {
189 asm volatile (
190 " STMFD SP!, {R4-R10,LR} \n"
191 " MOV R4, R0 \n"
192 " LDR R0, [R0] \n"
193 " CMP R0, #4 \n"
194 " LDREQ R6, [R4, #0x18] \n"
195 " LDREQ R7, [R4, #0x14] \n"
196 " BEQ loc_FFA7940C \n"
197 " CMP R0, #5 \n"
198 " LDREQ R6, [R4, #0x20] \n"
199 " LDREQ R7, [R4, #0x1C] \n"
200 " BEQ loc_FFA7940C \n"
201 " CMP R0, #6 \n"
202 " LDREQ R6, [R4, #0x28] \n"
203 " LDREQ R7, [R4, #0x24] \n"
204 " BEQ loc_FFA7940C \n"
205 " CMP R0, #7 \n"
206 " BNE loc_FFA79420 \n"
207 " LDR R6, [R4, #0x30] \n"
208 " LDR R7, [R4, #0x2C] \n"
209 "loc_FFA7940C:\n"
210 " CMP R6, #0 \n"
211 " BNE loc_FFA79430 \n"
212 "loc_FFA79414:\n"
213 " MOV R1, R4 \n"
214 " MOV R0, #8 \n"
215 " B loc_FFA794C4 \n"
216 "loc_FFA79420:\n"
217 " LDR R1, =0x297 \n"
218 " LDR R0, =0xFFA79094 \n"
219 " BL sub_FF81E88C \n"
220 " B loc_FFA79414 \n"
221 "loc_FFA79430:\n"
222 " LDR R9, =0xB414 \n"
223 " MOV R5, R6 \n"
224 "loc_FFA79438:\n"
225 " LDR R0, [R4, #4] \n"
226 " CMP R5, #0x1000000 \n"
227 " MOVLS R8, R5 \n"
228 " MOVHI R8, #0x1000000 \n"
229 " BIC R1, R0, #0xFF000000 \n"
230 " CMP R1, #0 \n"
231 " BICNE R0, R0, #0xFF000000 \n"
232 " RSBNE R0, R0, #0x1000000 \n"
233 " CMPNE R8, R0 \n"
234 " MOVHI R8, R0 \n"
235 " LDR R0, [R9] \n"
236 " MOV R2, R8 \n"
237 " MOV R1, R7 \n"
238 " BL fwt_write\n"
239 " LDR R1, [R4, #4] \n"
240 " CMP R8, R0 \n"
241 " ADD R1, R1, R0 \n"
242 " STR R1, [R4, #4] \n"
243 " BEQ loc_FFA79498 \n"
244 " CMN R0, #1 \n"
245 " LDRNE R0, =0x9200015 \n"
246 " LDREQ R0, =0x9200005 \n"
247 " STR R0, [R4, #0x10] \n"
248 " B loc_FFA79414 \n"
249 "loc_FFA79498:\n"
250 " SUB R5, R5, R0 \n"
251 " CMP R5, R6 \n"
252 " ADD R7, R7, R0 \n"
253 " LDRCS R0, =0xFFA79094 \n"
254 " LDRCS R1, =0x2C2 \n"
255 " BLCS sub_FF81E88C \n"
256 " CMP R5, #0 \n"
257 " BNE loc_FFA79438 \n"
258 " LDR R0, [R4] \n"
259 " MOV R1, R4 \n"
260 " ADD R0, R0, #1 \n"
261 "loc_FFA794C4:\n"
262 " LDMFD SP!, {R4-R10,LR} \n"
263 " B sub_FFA78D78 \n"
264 );
265 }
266
267
268
269 void __attribute__((naked,noinline)) sub_FFA78E38_my( ) {
270 asm volatile (
271 " STMFD SP!, {R4-R6,LR} \n"
272 " LDR R5, =0xB414 \n"
273 " MOV R4, R0 \n"
274 " LDR R0, [R5] \n"
275 " SUB SP, SP, #0x38 \n"
276 " CMN R0, #1 \n"
277
278 "LDREQ PC, =0xFFA78E80\n"
279 " LDR R1, [R4, #8] \n"
280 " LDR R6, =0x9200003 \n"
281 " TST R1, #0x8000 \n"
282 " BEQ loc_FFA78E6C \n"
283 " BL sub_FF86B984 \n"
284 " B loc_FFA78E70 \n"
285 "loc_FFA78E6C:\n"
286 " BL fwt_close\n"
287 "loc_FFA78E70:\n"
288 "LDR PC, =0xffa78e70\n"
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369 );
370 }