This source file includes following definitions.
- filewritetask
- sub_FFA7949C_my
- sub_FFA795D0_my
- sub_FFA79048_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_FFA791B8:\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_FFA791E8 \n"
40 " LDR R0, [SP, #8] \n"
41 " LDR R1, [R0] \n"
42 " CMP R1, #1 \n"
43 " BNE loc_FFA791F0 \n"
44 " LDR R0, [R4, #8] \n"
45 " BL sub_FF8387E8 \n"
46 "loc_FFA791E8:\n"
47 " BL sub_FF81E844 \n"
48 " LDMFD SP!, {R1-R5,PC} \n"
49 "loc_FFA791F0:\n"
50 " SUB R1, R1, #2 \n"
51 " CMP R1, #6 \n"
52 " ADDLS PC, PC, R1, LSL #2 \n"
53 " B loc_FFA791B8 \n"
54 " B loc_FFA7921C \n"
55 " B loc_FFA79280 \n"
56 " B loc_FFA79288 \n"
57 " B loc_FFA79288 \n"
58 " B loc_FFA79288 \n"
59 " B loc_FFA79288 \n"
60 " B loc_FFA79290 \n"
61 "loc_FFA7921C:\n"
62 " MOV R0, #0 \n"
63 " STR R0, [SP] \n"
64 "loc_FFA79224:\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_FFA79250 \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_FFA79224 \n"
76 "loc_FFA79250:\n"
77 " LDR R0, [R4] \n"
78 " CMN R0, #1 \n"
79 " BEQ loc_FFA79274 \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_FFA79274:\n"
87 " LDR R0, [R4, #0xC] \n"
88 " BL sub_FF8387E8 \n"
89 " B loc_FFA791B8 \n"
90 "loc_FFA79280:\n"
91 " BL sub_FFA7949C_my \n"
92 " B loc_FFA791B8 \n"
93 "loc_FFA79288:\n"
94 " BL sub_FFA795D0_my \n"
95 " B loc_FFA791B8 \n"
96 "loc_FFA79290:\n"
97 " BL sub_FFA79048_my \n"
98 " B loc_FFA791B8 \n"
99 );
100 }
101
102
103 void __attribute__((naked,noinline)) sub_FFA7949C_my( ) {
104 asm volatile (
105 " STMFD SP!, {R4-R8,LR} \n"
106 " MOV R4, R0 \n"
107 " ADD R0, R0, #0x38 \n"
108 " SUB SP, SP, #0x38 \n"
109 " BL sub_FF86E540 \n"
110 " MOV R1, #0 \n"
111 " BL sub_FF86C8D4 \n"
112 " LDR R0, [R4, #0xC] \n"
113 " BL sub_FF86B490 \n"
114 " LDR R7, [R4, #8] \n"
115 " LDR R8, =0x1B6 \n"
116 " ADD R6, R4, #0x38 \n"
117 " LDR R5, [R4, #0xC] \n"
118
119 "STMFD SP!, {R4-R12,LR}\n"
120 "MOV R0, R4\n"
121 "BL filewrite_main_hook\n"
122 "LDMFD SP!, {R4-R12,LR}\n"
123
124 " MOV R0, R6 \n"
125 " MOV R1, R7 \n"
126 " MOV R2, R8 \n"
127 " BL fwt_open\n"
128 "LDR PC, =0xffa794e0\n"
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182 );
183 }
184
185
186
187 void __attribute__((naked,noinline)) sub_FFA795D0_my( ) {
188 asm volatile (
189 " STMFD SP!, {R4-R10,LR} \n"
190 " MOV R4, R0 \n"
191 " LDR R0, [R0] \n"
192 " CMP R0, #4 \n"
193 " LDREQ R6, [R4, #0x18] \n"
194 " LDREQ R7, [R4, #0x14] \n"
195 " BEQ loc_FFA7961C \n"
196 " CMP R0, #5 \n"
197 " LDREQ R6, [R4, #0x20] \n"
198 " LDREQ R7, [R4, #0x1C] \n"
199 " BEQ loc_FFA7961C \n"
200 " CMP R0, #6 \n"
201 " LDREQ R6, [R4, #0x28] \n"
202 " LDREQ R7, [R4, #0x24] \n"
203 " BEQ loc_FFA7961C \n"
204 " CMP R0, #7 \n"
205 " BNE loc_FFA79630 \n"
206 " LDR R6, [R4, #0x30] \n"
207 " LDR R7, [R4, #0x2C] \n"
208 "loc_FFA7961C:\n"
209 " CMP R6, #0 \n"
210 " BNE loc_FFA79640 \n"
211 "loc_FFA79624:\n"
212 " MOV R1, R4 \n"
213 " MOV R0, #8 \n"
214 " B loc_FFA796D4 \n"
215 "loc_FFA79630:\n"
216 " LDR R1, =0x297 \n"
217 " LDR R0, =0xFFA792A4 \n"
218 " BL sub_FF81E88C \n"
219 " B loc_FFA79624 \n"
220 "loc_FFA79640:\n"
221 " LDR R9, =0xB414 \n"
222 " MOV R5, R6 \n"
223 "loc_FFA79648:\n"
224 " LDR R0, [R4, #4] \n"
225 " CMP R5, #0x1000000 \n"
226 " MOVLS R8, R5 \n"
227 " MOVHI R8, #0x1000000 \n"
228 " BIC R1, R0, #0xFF000000 \n"
229 " CMP R1, #0 \n"
230 " BICNE R0, R0, #0xFF000000 \n"
231 " RSBNE R0, R0, #0x1000000 \n"
232 " CMPNE R8, R0 \n"
233 " MOVHI R8, R0 \n"
234 " LDR R0, [R9] \n"
235 " MOV R2, R8 \n"
236 " MOV R1, R7 \n"
237 " BL fwt_write\n"
238 " LDR R1, [R4, #4] \n"
239 " CMP R8, R0 \n"
240 " ADD R1, R1, R0 \n"
241 " STR R1, [R4, #4] \n"
242 " BEQ loc_FFA796A8 \n"
243 " CMN R0, #1 \n"
244 " LDRNE R0, =0x9200015 \n"
245 " LDREQ R0, =0x9200005 \n"
246 " STR R0, [R4, #0x10] \n"
247 " B loc_FFA79624 \n"
248 "loc_FFA796A8:\n"
249 " SUB R5, R5, R0 \n"
250 " CMP R5, R6 \n"
251 " ADD R7, R7, R0 \n"
252 " LDRCS R0, =0xFFA792A4 \n"
253 " LDRCS R1, =0x2C2 \n"
254 " BLCS sub_FF81E88C \n"
255 " CMP R5, #0 \n"
256 " BNE loc_FFA79648 \n"
257 " LDR R0, [R4] \n"
258 " MOV R1, R4 \n"
259 " ADD R0, R0, #1 \n"
260 "loc_FFA796D4:\n"
261 " LDMFD SP!, {R4-R10,LR} \n"
262 " B sub_FFA78F88 \n"
263 );
264 }
265
266
267
268 void __attribute__((naked,noinline)) sub_FFA79048_my( ) {
269 asm volatile (
270 " STMFD SP!, {R4-R6,LR} \n"
271 " LDR R5, =0xB414 \n"
272 " MOV R4, R0 \n"
273 " LDR R0, [R5] \n"
274 " SUB SP, SP, #0x38 \n"
275 " CMN R0, #1 \n"
276
277 "LDREQ PC, =0xFFA79090\n"
278 " LDR R1, [R4, #8] \n"
279 " LDR R6, =0x9200003 \n"
280 " TST R1, #0x8000 \n"
281 " BEQ loc_FFA7907C \n"
282 " BL sub_FF86B984 \n"
283 " B loc_FFA79080 \n"
284 "loc_FFA7907C:\n"
285 " BL fwt_close\n"
286 "loc_FFA79080:\n"
287 "LDR PC, =0xFFA79080\n"
288
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 }