This source file includes following definitions.
- filewritetask
- sub_FFA792E0_my
- sub_FFA79414_my
- sub_FFA78E8C_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_FFA78FFC:\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_FFA7902C \n"
40 " LDR R0, [SP, #8] \n"
41 " LDR R1, [R0] \n"
42 " CMP R1, #1 \n"
43 " BNE loc_FFA79034 \n"
44 " LDR R0, [R4, #8] \n"
45 " BL sub_FF8387E8 \n"
46 "loc_FFA7902C:\n"
47 " BL sub_FF81E844 \n"
48 " LDMFD SP!, {R1-R5,PC} \n"
49 "loc_FFA79034:\n"
50 " SUB R1, R1, #2 \n"
51 " CMP R1, #6 \n"
52 " ADDLS PC, PC, R1, LSL #2 \n"
53 " B loc_FFA78FFC \n"
54 " B loc_FFA79060 \n"
55 " B loc_FFA790C4 \n"
56 " B loc_FFA790CC \n"
57 " B loc_FFA790CC \n"
58 " B loc_FFA790CC \n"
59 " B loc_FFA790CC \n"
60 " B loc_FFA790D4 \n"
61 "loc_FFA79060:\n"
62 " MOV R0, #0 \n"
63 " STR R0, [SP] \n"
64 "loc_FFA79068:\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_FFA79094 \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_FFA79068 \n"
76 "loc_FFA79094:\n"
77 " LDR R0, [R4] \n"
78 " CMN R0, #1 \n"
79 " BEQ loc_FFA790B8 \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_FFA790B8:\n"
87 " LDR R0, [R4, #0xC] \n"
88 " BL sub_FF8387E8 \n"
89 " B loc_FFA78FFC \n"
90 "loc_FFA790C4:\n"
91 " BL sub_FFA792E0_my \n"
92 " B loc_FFA78FFC \n"
93 "loc_FFA790CC:\n"
94 " BL sub_FFA79414_my \n"
95 " B loc_FFA78FFC \n"
96 "loc_FFA790D4:\n"
97 " BL sub_FFA78E8C_my \n"
98 " B loc_FFA78FFC \n"
99 );
100 }
101
102
103 void __attribute__((naked,noinline)) sub_FFA792E0_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, =0xffa79324\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 void __attribute__((naked,noinline)) sub_FFA79414_my( ) {
187 asm volatile (
188 " STMFD SP!, {R4-R10,LR} \n"
189 " MOV R4, R0 \n"
190 " LDR R0, [R0] \n"
191 " CMP R0, #4 \n"
192 " LDREQ R6, [R4, #0x18] \n"
193 " LDREQ R7, [R4, #0x14] \n"
194 " BEQ loc_FFA79460 \n"
195 " CMP R0, #5 \n"
196 " LDREQ R6, [R4, #0x20] \n"
197 " LDREQ R7, [R4, #0x1C] \n"
198 " BEQ loc_FFA79460 \n"
199 " CMP R0, #6 \n"
200 " LDREQ R6, [R4, #0x28] \n"
201 " LDREQ R7, [R4, #0x24] \n"
202 " BEQ loc_FFA79460 \n"
203 " CMP R0, #7 \n"
204 " BNE loc_FFA79474 \n"
205 " LDR R6, [R4, #0x30] \n"
206 " LDR R7, [R4, #0x2C] \n"
207 "loc_FFA79460:\n"
208 " CMP R6, #0 \n"
209 " BNE loc_FFA79484 \n"
210 "loc_FFA79468:\n"
211 " MOV R1, R4 \n"
212 " MOV R0, #8 \n"
213 " B loc_FFA79518 \n"
214 "loc_FFA79474:\n"
215 " LDR R1, =0x297 \n"
216 " LDR R0, =0xFFA790E8 \n"
217 " BL sub_FF81E88C \n"
218 " B loc_FFA79468 \n"
219 "loc_FFA79484:\n"
220 " LDR R9, =0xB414 \n"
221 " MOV R5, R6 \n"
222 "loc_FFA7948C:\n"
223 " LDR R0, [R4, #4] \n"
224 " CMP R5, #0x1000000 \n"
225 " MOVLS R8, R5 \n"
226 " MOVHI R8, #0x1000000 \n"
227 " BIC R1, R0, #0xFF000000 \n"
228 " CMP R1, #0 \n"
229 " BICNE R0, R0, #0xFF000000 \n"
230 " RSBNE R0, R0, #0x1000000 \n"
231 " CMPNE R8, R0 \n"
232 " MOVHI R8, R0 \n"
233 " LDR R0, [R9] \n"
234 " MOV R2, R8 \n"
235 " MOV R1, R7 \n"
236 " BL fwt_write\n"
237 " LDR R1, [R4, #4] \n"
238 " CMP R8, R0 \n"
239 " ADD R1, R1, R0 \n"
240 " STR R1, [R4, #4] \n"
241 " BEQ loc_FFA794EC \n"
242 " CMN R0, #1 \n"
243 " LDRNE R0, =0x9200015 \n"
244 " LDREQ R0, =0x9200005 \n"
245 " STR R0, [R4, #0x10] \n"
246 " B loc_FFA79468 \n"
247 "loc_FFA794EC:\n"
248 " SUB R5, R5, R0 \n"
249 " CMP R5, R6 \n"
250 " ADD R7, R7, R0 \n"
251 " LDRCS R0, =0xFFA790E8 \n"
252 " LDRCS R1, =0x2C2 \n"
253 " BLCS sub_FF81E88C \n"
254 " CMP R5, #0 \n"
255 " BNE loc_FFA7948C \n"
256 " LDR R0, [R4] \n"
257 " MOV R1, R4 \n"
258 " ADD R0, R0, #1 \n"
259 "loc_FFA79518:\n"
260 " LDMFD SP!, {R4-R10,LR} \n"
261 " B sub_FFA78DCC \n"
262 );
263 }
264
265
266 void __attribute__((naked,noinline)) sub_FFA78E8C_my( ) {
267 asm volatile (
268 " STMFD SP!, {R4-R6,LR} \n"
269 " LDR R5, =0xB414 \n"
270 " MOV R4, R0 \n"
271 " LDR R0, [R5] \n"
272 " SUB SP, SP, #0x38 \n"
273 " CMN R0, #1 \n"
274
275 "LDREQ PC, =0xFFA78ED4\n"
276 " LDR R1, [R4, #8] \n"
277 " LDR R6, =0x9200003 \n"
278 " TST R1, #0x8000 \n"
279 " BEQ loc_FFA78EC0 \n"
280 " BL sub_FF86B984 \n"
281 " B loc_FFA78EC4 \n"
282 "loc_FFA78EC0:\n"
283 " BL fwt_close\n"
284 "loc_FFA78EC4:\n"
285 "LDR PC, =0xFFA78EC4\n"
286
287
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