This source file includes following definitions.
- filewritetask
- sub_FFE15378_my
1
2
3
4 #include "lolevel.h"
5 #include "platform.h"
6
7 typedef struct {
8 unsigned int address;
9 unsigned int length;
10 } cam_ptp_data_chunk;
11
12 #define MAX_CHUNKS_FOR_FWT 3
13
14
15
16
17
18
19
20 typedef struct
21 {
22 int unkn1[5];
23 cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_FWT];
24 char name[32];
25 } fwt_data_struct;
26 #define CAM_HAS_COMPLETEFILEWRITE_REPLACEMENT 1
27
28 #include "../../../generic/filewrite.c"
29
30
31
32 void __attribute__((naked,noinline)) filewritetask() {
33 asm volatile (
34 " STMFD SP!, {R4,LR} \n"
35 " SUB SP, SP, #4 \n"
36 " MOV R4, SP \n"
37 " B loc_FFE15660 \n"
38
39 "loc_FFE15620:\n"
40 " CMP R2, #5 \n"
41 " LDRLS PC, [PC, R2, LSL#2] \n"
42 " B loc_FFE15660 \n"
43 " .long loc_FFE15644 \n"
44 " .long loc_FFE1564C \n"
45 " .long loc_FFE15654 \n"
46 " .long loc_FFE15654 \n"
47 " .long loc_FFE15654 \n"
48 " .long loc_FFE1565C \n"
49
50 "loc_FFE15644:\n"
51 " BL sub_FFE15250 \n"
52 " B loc_FFE15660 \n"
53
54 "loc_FFE1564C:\n"
55 " BL sub_FFE15378_my \n"
56 " B loc_FFE15660 \n"
57
58 "loc_FFE15654:\n"
59 " BL sub_FFE15454 \n"
60 " B loc_FFE15660 \n"
61
62 "loc_FFE1565C:\n"
63 " BL sub_FFE1554C \n"
64 " BL fwt_after_close\n"
65
66 "loc_FFE15660:\n"
67 " LDR R3, =0x54718 \n"
68 " MOV R1, R4 \n"
69 " LDR R0, [R3] \n"
70 " MOV R2, #0 \n"
71 " BL sub_FFE8234C /*_ReceiveMessageQueue*/ \n"
72 " CMP R0, #0 \n"
73 " BNE loc_FFE1569C \n"
74 " LDR R0, [SP] \n"
75 " LDR R3, [R0] \n"
76 " CMP R3, #1 \n"
77 " SUB R2, R3, #2 \n"
78 " BNE loc_FFE15620 \n"
79 " LDR R3, =0x54710 \n"
80 " LDR R0, [R3] \n"
81 " BL _GiveSemaphore \n"
82
83 "loc_FFE1569C:\n"
84 " BL _ExitTask \n"
85 );
86 }
87
88
89
90 void __attribute__((naked,noinline)) sub_FFE15378_my() {
91 asm volatile (
92 " STMFD SP!, {R4,R5,LR} \n"
93 " MOV R5, R0 \n"
94 " ADD R4, R5, #0x2C \n"
95 " MOV R0, R4 \n"
96 " BL sub_FFE1D0FC \n"
97 " MOV R1, #0 \n"
98 " BL sub_FFE1FF1C \n"
99 " LDR R0, [R5, #0xC] \n"
100 " BL sub_FFE20B50 \n"
101 " MOV R2, #0x1B4 \n"
102 " LDR R1, [R5, #8] \n"
103 " ADD R2, R2, #2 \n"
104 " LDR R3, [R5, #0xC] \n"
105
106
107
108
109
110 " STMFD SP!, {R1-R12,LR}\n"
111 " MOV R0, R5\n"
112 " BL filewrite_main_hook\n"
113 " BL filewrite_file_complete\n"
114 " CMP R0, #0\n"
115 " LDRNE R0, =loc_mynull\n"
116 " LDMFD SP!, {R1-R12,LR}\n"
117 " MOVEQ R0, R4\n"
118
119
120 " BL sub_FFE152E4 \n"
121 " LDR R3, =0x54708 \n"
122 " MOV R12, R0 \n"
123 " CMN R12, #1 \n"
124 " MOV R1, R4 \n"
125 " MOV R2, #0x20 \n"
126 " MOV R0, R4 \n"
127 " STR R12, [R3] \n"
128 " BNE loc_FFE15400 \n"
129 " BL sub_FFE1D0FC \n"
130 " BL sub_FFE1FF84 \n"
131 " LDR R3, =0x54828 \n"
132 " LDR R3, [R3] \n"
133 " MOV R0, #0x8000001 \n"
134 " CMP R3, #0 \n"
135 " ADD R0, R0, #0x1200000 \n"
136 " LDMEQFD SP!, {R4,R5,PC} \n"
137 " MOV LR, PC \n"
138 " MOV PC, R3 \n"
139 " LDMFD SP!, {R4,R5,PC} \n"
140
141 "loc_FFE15400:\n"
142 " LDR R0, =0x54808 \n"
143 " BL _memcpy \n"
144 " MOV R0, #4 \n"
145 " MOV R1, R5 \n"
146 " LDMFD SP!, {R4,R5,LR} \n"
147 " B sub_FFE15160 \n"
148
149 "loc_mynull:\n"
150 ".asciz \"/null\" \n"
151
152 );
153 }