Rev 6019 | Rev 6107 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6019 | Rev 6080 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 6019 $ |
8 | $Revision: 6080 $ |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | ; NTFS driver |
10 | ; NTFS driver |
Line 46... | Line 46... | ||
46 | nonResidentFlag = 8 |
46 | nonResidentFlag = 8 |
47 | nameLength = 9 |
47 | nameLength = 9 |
48 | nameOffset = 10 |
48 | nameOffset = 10 |
49 | attributeFlags = 12 |
49 | attributeFlags = 12 |
50 | attributeID = 14 |
50 | attributeID = 14 |
- | 51 | ; resident attribute header |
|
51 | sizeWithoutHeader = 16 |
52 | sizeWithoutHeader = 10h |
- | 53 | ; attributeOffset = 14h |
|
52 | indexedFlag = 16h |
54 | indexedFlag = 16h |
53 | ; non resident attribute header |
55 | ; non resident attribute header |
- | 56 | firstVCN = 10h |
|
54 | lastVCN = 18h |
57 | lastVCN = 18h |
55 | dataRunsOffset = 20h |
58 | dataRunsOffset = 20h |
56 | attributeAllocatedSize = 28h |
59 | attributeAllocatedSize = 28h |
57 | attributeRealSize = 30h |
60 | attributeRealSize = 30h |
58 | initialDataSize = 38h |
61 | initialDataSize = 38h |
Line 1068... | Line 1071... | ||
1068 | mov [ebp+NTFS.ntfs_bCanContinue], 1 |
1071 | mov [ebp+NTFS.ntfs_bCanContinue], 1 |
1069 | ret |
1072 | ret |
Line 1070... | Line 1073... | ||
1070 | 1073 | ||
1071 | ntfs_read_file_record: |
1074 | ntfs_read_file_record: |
1072 | ; in: eax = iRecord |
1075 | ; in: eax = iRecord |
1073 | ; out: [ebp+NTFS.frs_buffer] = record data |
1076 | ; out: [ebp+NTFS.frs_buffer] -> file record |
1074 | ; CF=1 -> failed, eax = disk error code, eax=0 -> something with FS |
1077 | ; CF=1 -> failed, eax = disk error code, eax=0 -> something with FS |
1075 | ; Read attr $DATA of $Mft, starting from eax*[ebp+NTFS.frs_size] |
1078 | ; Read attr $DATA of $Mft, starting from eax*[ebp+NTFS.frs_size] |
1076 | push ecx edx |
1079 | push ecx edx |
1077 | mov ecx, [ebp+NTFS.frs_size] |
1080 | mov ecx, [ebp+NTFS.frs_size] |
Line 1133... | Line 1136... | ||
1133 | ret |
1136 | ret |
Line 1134... | Line 1137... | ||
1134 | 1137 | ||
1135 | ntfs_restore_usa_frs: |
1138 | ntfs_restore_usa_frs: |
1136 | mov eax, [ebp+NTFS.frs_size] |
1139 | mov eax, [ebp+NTFS.frs_size] |
- | 1140 | ntfs_restore_usa: |
|
- | 1141 | ; in: |
|
- | 1142 | ; ebx -> record |
|
1137 | ntfs_restore_usa: |
1143 | ; eax = size in bytes |
1138 | pushad |
1144 | pushad |
1139 | shr eax, 9 |
1145 | shr eax, 9 |
1140 | mov ecx, eax |
1146 | mov ecx, eax |
1141 | inc eax |
1147 | inc eax |
Line 1161... | Line 1167... | ||
1161 | stc |
1167 | stc |
1162 | ret |
1168 | ret |
Line 1163... | Line 1169... | ||
1163 | 1169 | ||
1164 | ntfs_decode_mcb_entry: |
1170 | ntfs_decode_mcb_entry: |
1165 | ; in: |
1171 | ; in: |
1166 | ; esi -> mcb entry |
1172 | ; esi -> MCB entry |
1167 | ; esp -> buffer (16 bytes) |
1173 | ; esp -> buffer (16 bytes) |
1168 | ; out: |
1174 | ; out: |
1169 | ; esi -> next mcb entry |
1175 | ; esi -> next MCB entry |
1170 | ; esp -> data run size |
1176 | ; esp -> data run size |
1171 | ; esp+8 -> cluster (delta) |
1177 | ; esp+8 -> cluster (delta) |
1172 | ; CF=0 -> mcb end |
1178 | ; CF=0 -> MCB end |
1173 | push eax ecx edi |
1179 | push eax ecx edi |
1174 | lea edi, [esp+16] |
1180 | lea edi, [esp+16] |
1175 | xor eax, eax |
1181 | xor eax, eax |
1176 | lodsb |
1182 | lodsb |
Line 1997... | Line 2003... | ||
1997 | movi eax, ERROR_ACCESS_DENIED |
2003 | movi eax, ERROR_ACCESS_DENIED |
1998 | ret |
2004 | ret |
1999 | @@: ; 1. Search file |
2005 | @@: ; 1. Search file |
2000 | call ntfs_lock |
2006 | call ntfs_lock |
2001 | stdcall ntfs_find_lfn, [esp+4] |
2007 | stdcall ntfs_find_lfn, [esp+4] |
2002 | jnc .found |
- | |
2003 | cmp [ebp+NTFS.ntfsFragmentCount], 1 |
- | |
2004 | jnz ntfsUnsupported ; record fragmented |
- | |
2005 | test eax, eax |
- | |
2006 | jz ntfsFail |
- | |
2007 | jmp .notFound |
2008 | jc .notFound |
2008 | - | ||
2009 | .found: ; rewrite |
2009 | ; found, rewrite |
2010 | cmp [ebp+NTFS.ntfs_cur_iRecord], 16 |
2010 | cmp [ebp+NTFS.ntfs_cur_iRecord], 16 |
2011 | jc ntfsDenied |
2011 | jc ntfsDenied |
2012 | cmp [ebp+NTFS.ntfsFolder], 1 |
2012 | cmp [ebp+NTFS.ntfsFolder], 1 |
2013 | jz ntfsDenied |
2013 | jz .folder |
- | 2014 | xor ecx, ecx |
|
- | 2015 | mov edx, [ebx+12] |
|
- | 2016 | mov [ebp+NTFS.nodeLastRead], ecx |
|
- | 2017 | cmp [eax+fileRealSize+4], ecx |
|
- | 2018 | jnz @f |
|
- | 2019 | cmp [eax+fileRealSize], edx |
|
- | 2020 | jz .readAttribute |
|
- | 2021 | @@: ; set file size in the directory |
|
- | 2022 | cmp [ebp+NTFS.ntfsFragmentCount], 1 |
|
- | 2023 | jnz ntfsUnsupported ; record fragmented |
|
- | 2024 | mov edi, [ebp+NTFS.cur_index_buf] |
|
- | 2025 | cmp dword [edi], 'INDX' |
|
- | 2026 | jz @f |
|
- | 2027 | mov esi, [ebp+NTFS.frs_buffer] |
|
- | 2028 | mov ecx, [esi+recordRealSize] |
|
- | 2029 | shr ecx, 2 |
|
- | 2030 | rep movsd |
|
- | 2031 | mov esi, [ebp+NTFS.ntfs_attr_offs] |
|
- | 2032 | mov cl, [esi+attributeOffset] |
|
- | 2033 | sub esi, [ebp+NTFS.frs_buffer] |
|
- | 2034 | add eax, ecx |
|
- | 2035 | add eax, esi |
|
- | 2036 | xor ecx, ecx |
|
- | 2037 | @@: |
|
- | 2038 | mov [eax+fileRealSize], edx |
|
- | 2039 | mov [eax+fileRealSize+4], ecx |
|
- | 2040 | mov eax, [ebp+NTFS.ntfsLastRead] |
|
- | 2041 | mov [ebp+NTFS.nodeLastRead], eax |
|
- | 2042 | .readAttribute: |
|
2014 | mov [ebp+NTFS.ntfs_cur_attr], 0x80 |
2043 | mov [ebp+NTFS.ntfs_cur_attr], 0x80 |
2015 | mov [ebp+NTFS.ntfs_cur_offs], 0 |
2044 | mov [ebp+NTFS.ntfs_cur_offs], 0 |
2016 | mov [ebp+NTFS.ntfs_cur_size], 0 |
2045 | mov [ebp+NTFS.ntfs_cur_size], 0 |
2017 | call ntfs_read_attr |
2046 | call ntfs_read_attr |
2018 | jc ntfsDenied |
2047 | jc ntfsFail |
2019 | mov eax, [ebp+NTFS.frs_buffer] |
2048 | mov ecx, [ebp+NTFS.frs_buffer] |
- | 2049 | mov eax, edx |
|
- | 2050 | xor edx, edx |
|
2020 | cmp word [eax+baseRecordReuse], 0 |
2051 | cmp word [ecx+baseRecordReuse], 0 |
2021 | jnz ntfsUnsupported ; auxiliary record |
2052 | jnz ntfsUnsupported ; auxiliary record |
2022 | cmp byte [eax+hardLinkCounter], 1 |
2053 | cmp byte [ecx+hardLinkCounter], 1 |
2023 | jnz ntfsUnsupported ; file copying required |
2054 | jnz ntfsUnsupported ; file copying required |
2024 | mov ecx, [ebp+NTFS.ntfs_attr_offs] |
2055 | mov ecx, [ebp+NTFS.ntfs_attr_offs] |
2025 | cmp byte [ecx+nonResidentFlag], 1 |
2056 | cmp byte [ecx+nonResidentFlag], 1 |
2026 | jnz ntfsUnsupported ; resident $DATA |
2057 | jnz ntfsUnsupported ; resident $DATA |
2027 | mov eax, [ebx+4] |
2058 | test eax, eax |
2028 | mov edx, [ebx+8] |
- | |
2029 | add eax, [ebx+12] |
2059 | jz ntfsUnsupported |
2030 | adc edx, 0 |
- | |
2031 | cmp edx, [ecx+attributeRealSize+4] |
2060 | cmp [ecx+attributeRealSize+4], edx |
2032 | jnz ntfsUnsupported |
2061 | jnz @f |
2033 | cmp [ecx+attributeRealSize], eax |
2062 | cmp [ecx+attributeRealSize], eax |
2034 | jnz ntfsUnsupported |
2063 | jz ntfs_WriteFile.writeNode |
- | 2064 | @@: |
|
2035 | jmp ntfs_WriteFile.write |
2065 | jmp ntfs_WriteFile.resizeAttribute |
Line -... | Line 2066... | ||
- | 2066 | ||
2036 | 2067 | .folder: |
|
2037 | .notFound: ; create; check path folders |
2068 | bt dword [eax+fileFlags], 28 |
- | 2069 | jnc ntfsDenied |
|
2038 | cmp dword [esp+4], 0 |
2070 | push 0 |
- | 2071 | jmp ntfsOut |
|
- | 2072 | ||
2039 | jnz ntfsNotFound |
2073 | .notFound: ; create |
2040 | cmp byte [esi], 0 |
2074 | test eax, eax |
- | 2075 | jz ntfsFail |
|
- | 2076 | cmp [ebp+NTFS.ntfsFragmentCount], 1 |
|
2041 | jz ntfsNotFound |
2077 | jnz ntfsUnsupported ; record fragmented |
2042 | ; 2. Prepare directory record |
2078 | ; 2. Prepare directory record |
2043 | mov ecx, esi |
2079 | mov ecx, esi |
2044 | @@: ; count characters |
2080 | @@: ; count characters |
2045 | inc ecx |
2081 | inc ecx |
2046 | cmp byte [ecx], '/' |
2082 | cmp byte [ecx], '/' |
2047 | jz ntfsNotFound |
2083 | jz ntfsNotFound ; path folder not found |
2048 | cmp byte [ecx], 0 |
2084 | cmp byte [ecx], 0 |
2049 | jnz @b |
2085 | jnz @b |
2050 | sub ecx, esi |
2086 | sub ecx, esi |
2051 | push ecx |
2087 | push ecx |
2052 | lea ecx, [ecx*2+52h] ; precalculate index length |
2088 | lea ecx, [ecx*2+52h+7] ; precalculate index length |
2053 | add ecx, 7 ; align 8 |
- | |
2054 | and ecx, not 7 |
2089 | and ecx, not 7 ; align 8 |
2055 | mov edi, [ebp+NTFS.cur_index_buf] |
2090 | mov edi, [ebp+NTFS.cur_index_buf] |
2056 | push esi |
2091 | push esi |
2057 | push ecx |
2092 | push ecx |
2058 | cmp dword [edi], 'INDX' |
2093 | cmp dword [edi], 'INDX' |
Line 2113... | Line 2148... | ||
2113 | add edi, 4 |
2148 | add edi, 4 |
2114 | pop eax |
2149 | pop eax |
2115 | pop esi |
2150 | pop esi |
2116 | mov [edi+indexAllocatedSize], ax ; fill index with data |
2151 | mov [edi+indexAllocatedSize], ax ; fill index with data |
2117 | mov eax, [esp] |
2152 | mov eax, [esp] |
- | 2153 | shl eax, 1 |
|
2118 | lea eax, [eax*2+42h] |
2154 | add eax, 42h |
2119 | mov [edi+indexRawSize], ax |
2155 | mov [edi+indexRawSize], ax |
2120 | mov eax, [ebp+NTFS.ntfs_attr_iRecord] |
2156 | mov eax, [ebp+NTFS.ntfs_attr_iRecord] |
2121 | mov [edi+directoryRecordReference], eax |
2157 | mov [edi+directoryRecordReference], eax |
2122 | mov eax, [ebp+NTFS.frs_buffer] |
2158 | mov eax, [ebp+NTFS.frs_buffer] |
2123 | mov eax, [eax+reuseCounter] |
2159 | mov eax, [eax+reuseCounter] |
Line 2147... | Line 2183... | ||
2147 | mov eax, [ebp+NTFS.ntfsLastRead] |
2183 | mov eax, [ebp+NTFS.ntfsLastRead] |
2148 | mov [ebp+NTFS.nodeLastRead], eax |
2184 | mov [ebp+NTFS.nodeLastRead], eax |
2149 | cmp [ebp+NTFS.ntfsFolder], 0 |
2185 | cmp [ebp+NTFS.ntfsFolder], 0 |
2150 | jz @f |
2186 | jz @f |
2151 | mov edi, [ebp+NTFS.indexOffset] |
2187 | mov edi, [ebp+NTFS.indexOffset] |
2152 | mov byte [edi+fileFlags+3], 16 |
2188 | bts dword [edi+fileFlags], 28 |
2153 | jmp .mftBitmap |
2189 | jmp .mftBitmap |
Line 2154... | Line 2190... | ||
2154 | 2190 | ||
2155 | @@: ; 3. File data |
2191 | @@: ; 3. File data |
2156 | cmp [ebp+NTFS.fileRealSize], 0 |
2192 | cmp [ebp+NTFS.fileRealSize], 0 |
2157 | jz .mftBitmap |
- | |
2158 | ; One piece free space bitmap search engine |
- | |
2159 | mov edi, [ebp+NTFS.BitmapBuffer] |
2193 | jz .mftBitmap |
2160 | add edi, [ebp+NTFS.BitmapStart] |
- | |
2161 | mov eax, [ebp+NTFS.fileDataSize] |
- | |
2162 | shr eax, 5 |
- | |
2163 | jz .small |
- | |
2164 | push eax ; bitmap dwords |
- | |
2165 | add edi, 4 |
- | |
2166 | .start: |
- | |
2167 | mov ecx, [ebp+NTFS.BitmapSize] |
- | |
2168 | add ecx, [ebp+NTFS.BitmapBuffer] |
- | |
2169 | sub ecx, edi |
- | |
2170 | shr ecx, 2 |
- | |
2171 | @@: |
- | |
2172 | xor eax, eax |
- | |
2173 | repnz scasd ; search for empty dword |
- | |
2174 | jz @f |
- | |
2175 | call bitmapBuffering |
- | |
2176 | jmp @b |
- | |
2177 | @@: |
- | |
2178 | cmp ecx, [esp] |
- | |
2179 | jnc @f |
- | |
2180 | call bitmapBuffering |
- | |
2181 | jmp @b |
- | |
2182 | @@: |
- | |
2183 | sub edi, 4 |
- | |
2184 | mov ecx, [esp] |
- | |
2185 | mov esi, edi |
- | |
2186 | xor eax, eax |
- | |
2187 | repz scasd ; check following dwords |
- | |
2188 | jnz .start |
- | |
2189 | sub esi, 4 |
- | |
2190 | mov eax, [esi] |
- | |
2191 | xor edx, edx |
- | |
2192 | bsr edx, eax |
- | |
2193 | inc edx |
- | |
2194 | push edx ; starting bit |
- | |
2195 | push esi ; starting dword |
- | |
2196 | add esi, 4 |
- | |
2197 | neg edx |
- | |
2198 | add edx, 32 |
- | |
2199 | mov eax, [ebp+NTFS.fileDataSize] |
- | |
2200 | sub eax, edx |
- | |
2201 | mov edx, eax |
- | |
2202 | shr eax, 5 |
- | |
2203 | shl eax, 2 |
- | |
2204 | add esi, eax |
- | |
2205 | mov eax, [esi] |
- | |
2206 | bsf ecx, eax ; last dword |
- | |
2207 | jz .done |
- | |
2208 | and edx, 31 |
- | |
2209 | cmp ecx, edx |
- | |
2210 | jnc .done |
- | |
2211 | add esp, 8 |
- | |
2212 | jmp .start |
- | |
2213 | - | ||
2214 | .small: ; less than 32 clusters |
- | |
2215 | mov ecx, [ebp+NTFS.BitmapSize] |
- | |
2216 | sub ecx, [ebp+NTFS.BitmapStart] |
- | |
2217 | shr ecx, 2 |
- | |
2218 | .smStart: |
- | |
2219 | mov eax, -1 |
- | |
2220 | repz scasd ; search for zero bits |
- | |
2221 | push ecx |
- | |
2222 | test ecx, ecx |
- | |
2223 | jnz @f |
2194 | mov edi, [ebp+NTFS.BitmapStart] |
2224 | call bitmapBuffering |
- | |
2225 | pop eax |
- | |
2226 | jmp .smStart |
- | |
2227 | @@: |
- | |
2228 | sub edi, 4 |
- | |
2229 | mov eax, [edi] |
- | |
2230 | not eax |
- | |
2231 | @@: |
- | |
2232 | bsf ecx, eax ; first 0 |
- | |
2233 | jz .again |
- | |
2234 | not eax |
- | |
2235 | shr eax, cl |
- | |
2236 | shl eax, cl |
- | |
2237 | bsf edx, eax ; next 1 |
- | |
2238 | jz @f |
- | |
2239 | sub edx, ecx |
- | |
2240 | cmp edx, [ebp+NTFS.fileDataSize] |
- | |
2241 | jnc .got ; fits inside |
- | |
2242 | bsf ecx, eax |
- | |
2243 | not eax |
- | |
2244 | shr eax, cl |
- | |
2245 | shl eax, cl |
- | |
2246 | jmp @b |
- | |
2247 | @@: ; next dword |
- | |
2248 | mov eax, [edi+4] |
- | |
2249 | bsf edx, eax |
- | |
2250 | jz .got ; empty |
- | |
2251 | add edx, 32 |
- | |
2252 | sub edx, ecx |
- | |
2253 | cmp edx, [ebp+NTFS.fileDataSize] |
- | |
2254 | jnc .got ; share between dwords |
- | |
2255 | .again: |
- | |
2256 | add edi, 4 |
- | |
2257 | pop ecx |
- | |
2258 | jmp .smStart |
- | |
2259 | - | ||
2260 | .got: |
- | |
2261 | push ecx ; starting bit |
- | |
2262 | push edi ; starting dword |
- | |
2263 | .done: ; mark space |
- | |
2264 | mov ecx, [esp+4] |
- | |
2265 | cmp ecx, 32 |
- | |
2266 | jc @f |
- | |
2267 | xor ecx, ecx |
- | |
2268 | add dword [esp], 4 |
- | |
2269 | mov [esp+4], ecx |
- | |
2270 | @@: |
- | |
2271 | mov edi, [esp] |
- | |
2272 | xor eax, eax |
- | |
2273 | dec eax |
- | |
2274 | shr eax, cl |
- | |
2275 | shl eax, cl |
- | |
2276 | neg ecx |
- | |
2277 | add ecx, 32 |
- | |
2278 | sub ecx, [ebp+NTFS.fileDataSize] |
2195 | call ntfsSpaceAlloc |
2279 | jc @f |
- | |
2280 | shl eax, cl ; fits inside dword |
- | |
2281 | shr eax, cl |
- | |
2282 | or [edi], eax |
- | |
2283 | jmp .writeData |
- | |
2284 | - | ||
2285 | @@: |
- | |
2286 | or [edi], eax |
- | |
2287 | neg ecx |
- | |
2288 | push ecx |
- | |
2289 | shr ecx, 5 |
- | |
2290 | add edi, 4 |
- | |
2291 | xor eax, eax |
- | |
2292 | dec eax |
- | |
2293 | rep stosd |
- | |
2294 | pop ecx |
- | |
2295 | and ecx, 31 |
- | |
2296 | shr eax, cl |
- | |
2297 | shl eax, cl |
- | |
2298 | not eax |
- | |
2299 | or [edi], eax |
- | |
2300 | .writeData: |
- | |
2301 | pop edx |
- | |
2302 | sub edx, [ebp+NTFS.BitmapBuffer] |
- | |
2303 | shl edx, 3 |
- | |
2304 | pop eax |
- | |
2305 | add eax, edx |
- | |
2306 | pop edx |
2196 | jc ntfsDiskFull |
2307 | mov [ebp+NTFS.fileDataStart], eax |
2197 | mov [ebp+NTFS.fileDataStart], eax |
2308 | mul [ebp+NTFS.sectors_per_cluster] |
2198 | mul [ebp+NTFS.sectors_per_cluster] |
2309 | mov ecx, [ebp+NTFS.fileRealSize] |
2199 | mov ecx, [ebp+NTFS.fileRealSize] |
2310 | add ecx, 511 |
2200 | add ecx, 511 |
Line 2450... | Line 2340... | ||
2450 | mov dword[edi], 'FILE' |
2340 | mov dword[edi], 'FILE' |
2451 | mov byte [edi+updateSequenceOffset], 2ah |
2341 | mov byte [edi+updateSequenceOffset], 2ah |
2452 | mov byte [edi+updateSequenceSize], 3 |
2342 | mov byte [edi+updateSequenceSize], 3 |
2453 | mov byte [edi+hardLinkCounter], 1 |
2343 | mov byte [edi+hardLinkCounter], 1 |
2454 | mov byte [edi+attributeOffset], 30h |
2344 | mov byte [edi+attributeOffset], 30h |
2455 | pop dword[edi+recordRealSize] |
2345 | popd [edi+recordRealSize] |
2456 | mov word [edi+recordAllocatedSize], 1024 |
2346 | mov word [edi+recordAllocatedSize], 1024 |
2457 | mov byte [edi+newAttributeID], 3 |
2347 | mov byte [edi+newAttributeID], 3 |
2458 | rdtsc |
2348 | rdtsc |
2459 | mov [edi+2ah], ax |
2349 | mov [edi+2ah], ax |
2460 | add edi, 30h |
2350 | add edi, 30h |
Line 2477... | Line 2367... | ||
2477 | add edi, 18h |
2367 | add edi, 18h |
2478 | add esi, 16 |
2368 | add esi, 16 |
2479 | sub ecx, 18h |
2369 | sub ecx, 18h |
2480 | shr ecx, 2 |
2370 | shr ecx, 2 |
2481 | rep movsd |
2371 | rep movsd |
- | 2372 | mov byte [edi+sizeWithHeader], 50h |
|
- | 2373 | mov byte [edi+attributeID], 2 |
|
- | 2374 | mov dword[edi+50h], -1 ; $End |
|
2482 | cmp [ebp+NTFS.ntfsFolder], 0 |
2375 | cmp [ebp+NTFS.ntfsFolder], 0 |
2483 | jnz @f |
2376 | jnz @f |
2484 | ; $Data |
2377 | ; $Data |
2485 | mov byte [edi+attributeType], 80h |
2378 | mov byte [edi+attributeType], 80h |
2486 | cmp [ebp+NTFS.fileRealSize], 0 |
2379 | cmp [ebp+NTFS.fileRealSize], 0 |
2487 | jz .zeroSize |
2380 | jz .zeroSize |
2488 | mov esi, [ebp+NTFS.indexOffset] |
2381 | mov esi, [ebp+NTFS.indexOffset] |
- | 2382 | mov eax, [ebp+NTFS.fileDataSize] |
|
- | 2383 | dec eax |
|
- | 2384 | mov [edi+lastVCN], eax |
|
2489 | mov byte [edi+nonResidentFlag], 1 |
2385 | mov byte [edi+nonResidentFlag], 1 |
2490 | mov byte [edi+dataRunsOffset], 40h |
2386 | mov byte [edi+dataRunsOffset], 40h |
2491 | mov eax, [esi+fileAllocatedSize] |
2387 | mov eax, [esi+fileAllocatedSize] |
2492 | mov [edi+attributeAllocatedSize], eax |
2388 | mov [edi+attributeAllocatedSize], eax |
2493 | mov eax, [esi+fileRealSize] |
2389 | mov eax, [esi+fileRealSize] |
2494 | mov [edi+attributeRealSize], eax |
2390 | mov [edi+attributeRealSize], eax |
2495 | mov [edi+initialDataSize], eax |
2391 | mov [edi+initialDataSize], eax |
2496 | mov byte [edi+40h], 44h |
- | |
2497 | mov eax, [ebp+NTFS.fileDataSize] |
- | |
2498 | mov [edi+41h], eax |
2392 | mov esi, edi |
2499 | dec eax |
2393 | add edi, 40h |
2500 | mov [edi+lastVCN], eax |
- | |
2501 | mov eax, [ebp+NTFS.fileDataStart] |
- | |
2502 | mov [edi+45h], eax |
2394 | call createMcbEntry |
2503 | mov al, 1 |
2395 | mov al, 1 |
2504 | jmp .writeMftRecord |
2396 | jmp .writeMftRecord |
Line 2505... | Line 2397... | ||
2505 | 2397 | ||
2506 | .zeroSize: |
2398 | .zeroSize: |
Line 2527... | Line 2419... | ||
2527 | mov byte [edi+30h+nodeAllocatedSize], 32 |
2419 | mov byte [edi+30h+nodeAllocatedSize], 32 |
2528 | mov byte [edi+40h+indexAllocatedSize], 16 |
2420 | mov byte [edi+40h+indexAllocatedSize], 16 |
2529 | mov byte [edi+40h+indexFlags], 2 |
2421 | mov byte [edi+40h+indexFlags], 2 |
2530 | mov al, 3 |
2422 | mov al, 3 |
2531 | .writeMftRecord: |
2423 | .writeMftRecord: |
2532 | mov byte [edi+sizeWithHeader], 50h |
- | |
2533 | mov byte [edi+attributeID], 2 |
- | |
2534 | mov dword[edi+50h], -1 ; $End |
- | |
2535 | mov edi, [ebp+NTFS.frs_buffer] |
2424 | mov edi, [ebp+NTFS.frs_buffer] |
2536 | mov [edi+recordFlags], al |
- | |
2537 | mov [ebp+NTFS.ntfs_cur_buf], edi |
2425 | mov [ebp+NTFS.ntfs_cur_buf], edi |
- | 2426 | mov [edi+recordFlags], al |
|
2538 | call writeRecord |
2427 | call writeRecord |
2539 | test eax, eax |
2428 | test eax, eax |
2540 | jnz ntfsDevice |
2429 | jnz ntfsDevice |
2541 | mov esi, [ebp+PARTITION.Disk] |
- | |
2542 | call disk_sync |
- | |
2543 | ; write MFT bitmap |
2430 | ; write MFT bitmap |
2544 | mov eax, [ebp+NTFS.newMftRecord] |
2431 | mov eax, [ebp+NTFS.newMftRecord] |
2545 | shr eax, 3+9 |
2432 | shr eax, 3+9 |
2546 | mov ebx, eax |
2433 | mov ebx, eax |
2547 | shl ebx, 9 |
2434 | shl ebx, 9 |
Line 2555... | Line 2442... | ||
2555 | ; 5. Write partition bitmap |
2442 | ; 5. Write partition bitmap |
2556 | cmp [ebp+NTFS.ntfsFolder], 0 |
2443 | cmp [ebp+NTFS.ntfsFolder], 0 |
2557 | jnz @f |
2444 | jnz @f |
2558 | cmp [ebp+NTFS.fileRealSize], 0 |
2445 | cmp [ebp+NTFS.fileRealSize], 0 |
2559 | jz @f |
2446 | jz @f |
2560 | mov ecx, [ebp+NTFS.fileDataStart] |
2447 | mov eax, [ebp+NTFS.fileDataStart] |
2561 | mov eax, ecx |
2448 | mov ecx, [ebp+NTFS.fileDataSize] |
2562 | add ecx, [ebp+NTFS.fileDataSize] |
2449 | add ecx, eax |
2563 | add ecx, 4095 |
2450 | add ecx, 4095 |
2564 | shr ecx, 3+9 |
2451 | shr ecx, 3+9 |
2565 | shr eax, 3+9 |
2452 | shr eax, 3+9 |
2566 | sub ecx, eax |
2453 | sub ecx, eax |
2567 | mov ebx, eax |
2454 | mov ebx, eax |
Line 2571... | Line 2458... | ||
2571 | xor edx, edx |
2458 | xor edx, edx |
2572 | call fs_write64_app |
2459 | call fs_write64_app |
2573 | test eax, eax |
2460 | test eax, eax |
2574 | jnz ntfsDevice |
2461 | jnz ntfsDevice |
2575 | @@: |
2462 | @@: |
2576 | mov esi, [ebp+PARTITION.Disk] |
- | |
2577 | call disk_sync |
- | |
2578 | mov edi, [ebp+NTFS.indexOffset] |
2463 | mov edi, [ebp+NTFS.indexOffset] |
2579 | mov eax, [ebp+NTFS.newMftRecord] |
2464 | mov eax, [ebp+NTFS.newMftRecord] |
2580 | mov [edi+fileRecordReference], eax |
2465 | mov [edi+fileRecordReference], eax |
2581 | ; 6. Write directory node |
2466 | ; 6. Write directory node |
2582 | mov eax, [ebp+NTFS.nodeLastRead] |
2467 | mov eax, [ebp+NTFS.nodeLastRead] |
2583 | mov [ebp+NTFS.ntfsLastRead], eax |
2468 | mov [ebp+NTFS.ntfsLastRead], eax |
2584 | mov eax, [ebp+NTFS.cur_index_buf] |
2469 | mov eax, [ebp+NTFS.cur_index_buf] |
2585 | mov [ebp+NTFS.ntfs_cur_buf], eax |
2470 | mov [ebp+NTFS.ntfs_cur_buf], eax |
2586 | call writeRecord |
2471 | call writeRecord |
2587 | test eax, eax |
- | |
2588 | jnz ntfsDevice |
- | |
2589 | mov ebx, [ebp+NTFS.fileRealSize] |
2472 | mov ebx, [ebp+NTFS.fileRealSize] |
2590 | ntfsDone: |
2473 | ntfsDone: |
2591 | mov esi, [ebp+PARTITION.Disk] |
2474 | mov esi, [ebp+PARTITION.Disk] |
2592 | call disk_sync |
2475 | call disk_sync |
2593 | call ntfs_unlock |
2476 | call ntfs_unlock |
2594 | xor eax, eax |
2477 | xor eax, eax |
2595 | ret |
2478 | ret |
Line 2596... | Line 2479... | ||
2596 | 2479 | ||
- | 2480 | writeRecord: |
|
2597 | writeRecord: |
2481 | ; make updateSequence and write to disk |
2598 | ; in: |
2482 | ; in: |
2599 | ; [ebp+NTFS.ntfs_cur_buf] = record |
2483 | ; [ebp+NTFS.ntfs_cur_buf] -> record |
2600 | ; [ebp+NTFS.ntfsLastRead] = partition sector |
- | |
2601 | ; making updateSequence |
2484 | ; [ebp+NTFS.ntfsLastRead] = partition sector |
2602 | mov esi, [ebp+NTFS.ntfs_cur_buf] |
2485 | mov esi, [ebp+NTFS.ntfs_cur_buf] |
2603 | mov edi, esi |
2486 | mov edi, esi |
2604 | movzx ecx, word [esi+updateSequenceOffset] |
2487 | movzx ecx, word [esi+updateSequenceOffset] |
2605 | add edi, ecx |
2488 | add edi, ecx |
2606 | mov ax, [edi] |
2489 | mov ax, [edi] |
- | 2490 | inc ax |
|
2607 | add edi, 2 |
2491 | stosw |
2608 | mov cx, [esi+updateSequenceSize] |
2492 | mov cx, [esi+updateSequenceSize] |
2609 | dec ecx |
2493 | dec ecx |
2610 | push ecx |
2494 | push ecx |
2611 | @@: |
2495 | @@: |
2612 | add esi, 510 |
2496 | add esi, 510 |
2613 | movsw |
2497 | movsw |
2614 | mov [esi-2], ax |
2498 | mov [esi-2], ax |
2615 | dec ecx |
2499 | dec ecx |
2616 | jnz @b |
- | |
2617 | ; writing to disk |
2500 | jnz @b |
2618 | mov eax, [ebp+NTFS.ntfsLastRead] |
2501 | mov eax, [ebp+NTFS.ntfsLastRead] |
2619 | mov ebx, [ebp+NTFS.ntfs_cur_buf] |
2502 | mov ebx, [ebp+NTFS.ntfs_cur_buf] |
2620 | pop ecx |
2503 | pop ecx |
2621 | xor edx, edx |
2504 | xor edx, edx |
Line -... | Line 2505... | ||
- | 2505 | jmp fs_write64_sys |
|
- | 2506 | ||
- | 2507 | createMcbEntry: |
|
- | 2508 | ; in: |
|
- | 2509 | ; [ebp+NTFS.fileDataStart] = position value |
|
- | 2510 | ; [ebp+NTFS.fileDataSize] = size value |
|
- | 2511 | ; edi -> destination |
|
- | 2512 | ; esi -> attribute header |
|
- | 2513 | mov eax, [ebp+NTFS.fileDataStart] |
|
- | 2514 | xor edx, edx |
|
- | 2515 | shl eax, 1 |
|
- | 2516 | jnc @f |
|
- | 2517 | not eax |
|
- | 2518 | @@: |
|
- | 2519 | inc edx |
|
- | 2520 | shr eax, 8 |
|
- | 2521 | jnz @b |
|
- | 2522 | mov eax, [ebp+NTFS.fileDataSize] |
|
- | 2523 | shl eax, 1 |
|
- | 2524 | xor ecx, ecx |
|
- | 2525 | @@: |
|
- | 2526 | inc ecx |
|
- | 2527 | shr eax, 8 |
|
- | 2528 | jnz @b |
|
- | 2529 | lea eax, [edi+edx+1] |
|
- | 2530 | add eax, ecx |
|
- | 2531 | sub eax, esi |
|
- | 2532 | sub ax, [esi+sizeWithHeader] |
|
- | 2533 | jc @f |
|
- | 2534 | add word [esi+sizeWithHeader], 8 ; extend attribute |
|
- | 2535 | mov esi, [ebp+NTFS.frs_buffer] |
|
- | 2536 | mov eax, [esi+recordRealSize] |
|
- | 2537 | add eax, 8 |
|
- | 2538 | cmp [esi+recordAllocatedSize], eax |
|
- | 2539 | jc .end ; no space in the record |
|
- | 2540 | mov [esi+recordRealSize], eax |
|
- | 2541 | push ecx edi |
|
- | 2542 | add esi, eax |
|
- | 2543 | mov ecx, esi |
|
- | 2544 | sub ecx, edi |
|
- | 2545 | sub ecx, 8 |
|
- | 2546 | shr ecx, 2 |
|
- | 2547 | mov edi, esi |
|
- | 2548 | sub edi, 4 |
|
- | 2549 | sub esi, 12 |
|
- | 2550 | std |
|
- | 2551 | rep movsd |
|
- | 2552 | cld |
|
- | 2553 | pop edi ecx |
|
- | 2554 | @@: |
|
- | 2555 | mov eax, edx |
|
- | 2556 | shl eax, 4 |
|
- | 2557 | add eax, ecx |
|
- | 2558 | stosb |
|
- | 2559 | lea esi, [ebp+NTFS.fileDataSize] |
|
- | 2560 | rep movsb |
|
- | 2561 | lea esi, [ebp+NTFS.fileDataStart] |
|
- | 2562 | mov ecx, edx |
|
- | 2563 | rep movsb |
|
- | 2564 | .end: |
|
- | 2565 | ret |
|
- | 2566 | ||
- | 2567 | resizeAttribute: |
|
- | 2568 | ; in: |
|
- | 2569 | ; [ebp+NTFS.frs_buffer] -> file record |
|
- | 2570 | ; [ebp+NTFS.ntfs_attr_offs] -> attribute |
|
- | 2571 | ; edx:eax = new size |
|
- | 2572 | ; out: |
|
- | 2573 | ; CF=1 -> eax = error code |
|
- | 2574 | mov esi, [ebp+NTFS.ntfs_attr_offs] |
|
- | 2575 | mov ecx, [ebp+NTFS.sectors_per_cluster] |
|
- | 2576 | shl ecx, 9 |
|
- | 2577 | mov dword [ebp+NTFS.ntfs_attr_size], eax |
|
- | 2578 | mov dword [ebp+NTFS.ntfs_attr_size+4], edx |
|
- | 2579 | mov [esi+attributeRealSize], eax |
|
- | 2580 | mov [esi+attributeRealSize+4], edx |
|
- | 2581 | mov [esi+initialDataSize], eax |
|
- | 2582 | mov [esi+initialDataSize+4], edx |
|
- | 2583 | sub eax, 1 |
|
- | 2584 | sbb edx, 0 |
|
- | 2585 | div ecx |
|
- | 2586 | mov edi, eax |
|
- | 2587 | inc eax |
|
- | 2588 | mul ecx |
|
- | 2589 | mov [esi+attributeAllocatedSize], eax |
|
- | 2590 | mov [esi+attributeAllocatedSize+4], edx |
|
- | 2591 | mov ecx, [esi+lastVCN] |
|
- | 2592 | mov [esi+lastVCN], edi |
|
- | 2593 | movzx eax, byte [esi+dataRunsOffset] |
|
- | 2594 | sub edi, ecx |
|
- | 2595 | jz .done |
|
- | 2596 | jc .shrinkAttribute |
|
- | 2597 | ; extend attribute |
|
- | 2598 | mov [ebp+NTFS.fileDataSize], edi |
|
- | 2599 | xor edi, edi |
|
- | 2600 | add esi, eax |
|
- | 2601 | push edi edi edi edi |
|
- | 2602 | @@: |
|
- | 2603 | mov edx, eax |
|
- | 2604 | mov eax, esi |
|
- | 2605 | add edi, [esp+8] |
|
- | 2606 | call ntfs_decode_mcb_entry |
|
- | 2607 | jc @b |
|
- | 2608 | mov [esp+4], edx |
|
- | 2609 | mov [esp+12], edi |
|
- | 2610 | add edi, [esp] |
|
- | 2611 | push edi |
|
- | 2612 | shr edi, 5 |
|
- | 2613 | shl edi, 2 |
|
- | 2614 | push eax |
|
- | 2615 | cmp edi, [ebp+NTFS.BitmapStart] |
|
- | 2616 | jc .err1 |
|
- | 2617 | call ntfsSpaceAlloc |
|
- | 2618 | jc .err1 |
|
- | 2619 | pop edi |
|
- | 2620 | pop edx |
|
- | 2621 | cmp edx, eax |
|
- | 2622 | jnz .newEntry |
|
- | 2623 | pop edx |
|
- | 2624 | pop edi |
|
- | 2625 | pop [ebp+NTFS.fileDataStart] |
|
- | 2626 | mov [esp], eax |
|
- | 2627 | push [ebp+NTFS.fileDataSize] |
|
- | 2628 | add [ebp+NTFS.fileDataSize], edx |
|
- | 2629 | jmp @f |
|
- | 2630 | ||
- | 2631 | .newEntry: |
|
- | 2632 | add esp, 12 |
|
- | 2633 | pop edx |
|
- | 2634 | push eax |
|
- | 2635 | push [ebp+NTFS.fileDataSize] |
|
- | 2636 | sub eax, edx |
|
- | 2637 | mov [ebp+NTFS.fileDataStart], eax |
|
- | 2638 | @@: |
|
- | 2639 | mov esi, [ebp+NTFS.ntfs_attr_offs] |
|
- | 2640 | call createMcbEntry |
|
- | 2641 | pop ecx |
|
- | 2642 | pop eax |
|
- | 2643 | jc .err2 |
|
- | 2644 | mov byte [edi], 0 |
|
- | 2645 | add ecx, eax |
|
- | 2646 | add ecx, 4095 |
|
- | 2647 | shr ecx, 3+9 |
|
- | 2648 | shr eax, 3+9 |
|
- | 2649 | sub ecx, eax |
|
- | 2650 | mov ebx, eax |
|
- | 2651 | shl ebx, 9 |
|
- | 2652 | add eax, [ebp+NTFS.BitmapLocation] |
|
- | 2653 | add ebx, [ebp+NTFS.BitmapBuffer] |
|
- | 2654 | xor edx, edx |
|
- | 2655 | call fs_write64_app |
|
- | 2656 | test eax, eax |
|
- | 2657 | jz .done |
|
- | 2658 | movi eax, ERROR_DEVICE |
|
- | 2659 | stc |
|
- | 2660 | .done: |
|
- | 2661 | ret |
|
- | 2662 | ||
- | 2663 | .err1: |
|
- | 2664 | movi eax, ERROR_DISK_FULL |
|
- | 2665 | add esp, 24 |
|
- | 2666 | stc |
|
- | 2667 | ret |
|
- | 2668 | ||
- | 2669 | .err2: |
|
- | 2670 | movi eax, ERROR_UNSUPPORTED_FS |
|
- | 2671 | ret |
|
- | 2672 | ||
- | 2673 | .shrinkAttribute: |
|
- | 2674 | add ecx, edi |
|
- | 2675 | inc ecx |
|
- | 2676 | add esi, eax |
|
- | 2677 | xor edi, edi |
|
- | 2678 | sub esp, 20 |
|
- | 2679 | @@: |
|
- | 2680 | mov [esp+16], esi |
|
- | 2681 | call ntfs_decode_mcb_entry |
|
- | 2682 | jnc .err3 |
|
- | 2683 | add edi, [esp+8] |
|
- | 2684 | sub ecx, [esp] |
|
- | 2685 | jnc @b |
|
- | 2686 | mov ebx, ecx |
|
- | 2687 | add ecx, [esp] |
|
- | 2688 | mov eax, [esp+8] |
|
- | 2689 | mov [ebp+NTFS.fileDataSize], ecx |
|
- | 2690 | mov [ebp+NTFS.fileDataStart], eax |
|
- | 2691 | push edi |
|
- | 2692 | add edi, ecx |
|
- | 2693 | neg ebx |
|
- | 2694 | call ntfsSpaceFree |
|
- | 2695 | pop edi |
|
- | 2696 | jc .end |
|
- | 2697 | @@: |
|
- | 2698 | call ntfs_decode_mcb_entry |
|
- | 2699 | jnc .end |
|
- | 2700 | cmp dword[esp+8], 0 |
|
- | 2701 | jz @b |
|
- | 2702 | add edi, [esp+8] |
|
- | 2703 | mov ebx, [esp] |
|
- | 2704 | call ntfsSpaceFree |
|
- | 2705 | jnc @b |
|
- | 2706 | .end: |
|
- | 2707 | add esp, 16 |
|
- | 2708 | pop edi |
|
- | 2709 | cmp [ebp+NTFS.fileDataSize], 0 |
|
- | 2710 | jz @f |
|
- | 2711 | mov esi, [ebp+NTFS.ntfs_attr_offs] |
|
- | 2712 | call createMcbEntry |
|
- | 2713 | @@: |
|
- | 2714 | mov byte [edi], 0 |
|
- | 2715 | ret |
|
- | 2716 | ||
- | 2717 | .err3: |
|
- | 2718 | movi eax, ERROR_FS_FAIL |
|
- | 2719 | add esp, 20 |
|
- | 2720 | stc |
|
- | 2721 | ret |
|
- | 2722 | ||
- | 2723 | ntfsSpaceAlloc: |
|
- | 2724 | ; find and mark block of free space in bitmap buffer |
|
- | 2725 | ; in: |
|
- | 2726 | ; edi = offset in bitmap to start search from |
|
- | 2727 | ; [ebp+NTFS.fileDataSize] = block size in clusters |
|
- | 2728 | ; out: |
|
- | 2729 | ; eax = allocated block starting cluster |
|
- | 2730 | ; CF=1 -> disk full |
|
- | 2731 | mov ecx, [ebp+NTFS.BitmapBuffer] |
|
- | 2732 | add edi, ecx |
|
- | 2733 | add ecx, [ebp+NTFS.BitmapSize] |
|
- | 2734 | sub ecx, edi |
|
- | 2735 | jnc @f |
|
- | 2736 | call bitmapBuffering |
|
- | 2737 | shl ecx, 2 |
|
- | 2738 | @@: |
|
- | 2739 | shr ecx, 2 |
|
- | 2740 | mov eax, [ebp+NTFS.fileDataSize] |
|
- | 2741 | shr eax, 5 |
|
- | 2742 | jz .small |
|
- | 2743 | push eax ; bitmap dwords |
|
- | 2744 | .start: |
|
- | 2745 | mov ecx, [ebp+NTFS.BitmapBuffer] |
|
- | 2746 | add ecx, [ebp+NTFS.BitmapSize] |
|
- | 2747 | sub ecx, edi |
|
- | 2748 | shr ecx, 2 |
|
- | 2749 | @@: |
|
- | 2750 | xor eax, eax |
|
- | 2751 | repnz scasd ; search for empty dword |
|
- | 2752 | jz @f |
|
- | 2753 | call bitmapBuffering |
|
- | 2754 | jmp @b |
|
- | 2755 | @@: |
|
- | 2756 | cmp ecx, [esp] |
|
- | 2757 | jnc @f |
|
- | 2758 | call bitmapBuffering |
|
- | 2759 | jmp @b |
|
- | 2760 | @@: |
|
- | 2761 | sub edi, 4 |
|
- | 2762 | mov ecx, [esp] |
|
- | 2763 | mov esi, edi |
|
- | 2764 | xor eax, eax |
|
- | 2765 | repz scasd ; check following dwords |
|
- | 2766 | jnz .start |
|
- | 2767 | sub esi, 4 |
|
- | 2768 | mov eax, [esi] |
|
- | 2769 | xor edx, edx |
|
- | 2770 | bsr edx, eax |
|
- | 2771 | inc edx |
|
- | 2772 | push edx ; starting bit |
|
- | 2773 | push esi ; starting dword |
|
- | 2774 | add esi, 4 |
|
- | 2775 | neg edx |
|
- | 2776 | add edx, 32 |
|
- | 2777 | mov eax, [ebp+NTFS.fileDataSize] |
|
- | 2778 | sub eax, edx |
|
- | 2779 | mov edx, eax |
|
- | 2780 | shr eax, 5 |
|
- | 2781 | shl eax, 2 |
|
- | 2782 | add esi, eax |
|
- | 2783 | mov eax, [esi] |
|
- | 2784 | bsf ecx, eax ; check last dword |
|
- | 2785 | jz .done |
|
- | 2786 | and edx, 31 |
|
- | 2787 | cmp ecx, edx |
|
- | 2788 | jnc .done |
|
- | 2789 | add esp, 8 |
|
- | 2790 | jmp .start |
|
- | 2791 | ||
- | 2792 | .small: ; less than 32 clusters |
|
- | 2793 | mov eax, -1 |
|
- | 2794 | repz scasd ; search for zero bits |
|
- | 2795 | push ecx |
|
- | 2796 | test ecx, ecx |
|
- | 2797 | jnz @f |
|
- | 2798 | call bitmapBuffering |
|
- | 2799 | pop eax |
|
- | 2800 | jmp .small |
|
- | 2801 | @@: |
|
- | 2802 | sub edi, 4 |
|
- | 2803 | mov eax, [edi] |
|
- | 2804 | not eax |
|
- | 2805 | @@: |
|
- | 2806 | bsf ecx, eax ; first 0 |
|
- | 2807 | jz .again |
|
- | 2808 | not eax |
|
- | 2809 | shr eax, cl |
|
- | 2810 | shl eax, cl |
|
- | 2811 | bsf edx, eax ; next 1 |
|
- | 2812 | jz @f |
|
- | 2813 | sub edx, ecx |
|
- | 2814 | cmp edx, [ebp+NTFS.fileDataSize] |
|
- | 2815 | jnc .got ; fits inside |
|
- | 2816 | bsf ecx, eax |
|
- | 2817 | not eax |
|
- | 2818 | shr eax, cl |
|
- | 2819 | shl eax, cl |
|
- | 2820 | jmp @b |
|
- | 2821 | @@: ; next dword |
|
- | 2822 | mov eax, [edi+4] |
|
- | 2823 | bsf edx, eax |
|
- | 2824 | jz .got ; empty |
|
- | 2825 | add edx, 32 |
|
- | 2826 | sub edx, ecx |
|
- | 2827 | cmp edx, [ebp+NTFS.fileDataSize] |
|
- | 2828 | jnc .got ; share between dwords |
|
- | 2829 | .again: |
|
- | 2830 | add edi, 4 |
|
- | 2831 | pop ecx |
|
- | 2832 | jmp .small |
|
- | 2833 | ||
- | 2834 | .got: |
|
- | 2835 | push ecx ; starting bit |
|
- | 2836 | push edi ; starting dword |
|
- | 2837 | .done: ; mark space |
|
- | 2838 | mov ecx, [esp+4] |
|
- | 2839 | cmp ecx, 32 |
|
- | 2840 | jc @f |
|
- | 2841 | xor ecx, ecx |
|
- | 2842 | add dword [esp], 4 |
|
- | 2843 | mov [esp+4], ecx |
|
- | 2844 | @@: |
|
- | 2845 | mov edi, [esp] |
|
- | 2846 | xor eax, eax |
|
- | 2847 | dec eax |
|
- | 2848 | shr eax, cl |
|
- | 2849 | shl eax, cl |
|
- | 2850 | neg ecx |
|
- | 2851 | add ecx, 32 |
|
- | 2852 | sub ecx, [ebp+NTFS.fileDataSize] |
|
- | 2853 | jc @f |
|
- | 2854 | shl eax, cl ; fits inside dword |
|
- | 2855 | shr eax, cl |
|
- | 2856 | or [edi], eax |
|
- | 2857 | jmp .end |
|
- | 2858 | ||
- | 2859 | @@: |
|
- | 2860 | or [edi], eax |
|
- | 2861 | neg ecx |
|
- | 2862 | push ecx |
|
- | 2863 | shr ecx, 5 |
|
- | 2864 | add edi, 4 |
|
- | 2865 | xor eax, eax |
|
- | 2866 | dec eax |
|
- | 2867 | rep stosd |
|
- | 2868 | pop ecx |
|
- | 2869 | and ecx, 31 |
|
- | 2870 | shr eax, cl |
|
- | 2871 | shl eax, cl |
|
- | 2872 | not eax |
|
- | 2873 | or [edi], eax |
|
- | 2874 | .end: |
|
- | 2875 | pop eax |
|
- | 2876 | sub eax, [ebp+NTFS.BitmapBuffer] |
|
- | 2877 | shl eax, 3 |
|
- | 2878 | pop edx |
|
- | 2879 | add eax, edx |
|
- | 2880 | pop edx |
|
- | 2881 | ret |
|
- | 2882 | ||
- | 2883 | ntfsSpaceFree: |
|
- | 2884 | ; free disk space |
|
- | 2885 | ; in: |
|
- | 2886 | ; edi = starting cluster |
|
- | 2887 | ; ebx = size in clusters |
|
- | 2888 | mov eax, edi |
|
- | 2889 | add eax, ebx |
|
- | 2890 | shr eax, 3 |
|
- | 2891 | inc eax |
|
- | 2892 | cmp eax, [ebp+NTFS.BitmapSize] |
|
- | 2893 | jc @f |
|
- | 2894 | add eax, [ebp+NTFS.BitmapBuffer] |
|
- | 2895 | push edi |
|
- | 2896 | mov edi, eax |
|
- | 2897 | call bitmapBuffering |
|
- | 2898 | pop edi |
|
- | 2899 | @@: |
|
- | 2900 | push edi |
|
- | 2901 | mov ecx, edi |
|
- | 2902 | shr edi, 5 |
|
- | 2903 | shl edi, 2 |
|
- | 2904 | add edi, [ebp+NTFS.BitmapBuffer] |
|
- | 2905 | and ecx, 31 |
|
- | 2906 | xor eax, eax |
|
- | 2907 | dec eax |
|
- | 2908 | shr eax, cl |
|
- | 2909 | shl eax, cl |
|
- | 2910 | neg ecx |
|
- | 2911 | add ecx, 32 |
|
- | 2912 | sub ecx, ebx |
|
- | 2913 | jc @f |
|
- | 2914 | shl eax, cl ; fits inside dword |
|
- | 2915 | shr eax, cl |
|
- | 2916 | not eax |
|
- | 2917 | and [edi], eax |
|
- | 2918 | jmp .writeBitmap |
|
- | 2919 | ||
- | 2920 | @@: |
|
- | 2921 | not eax |
|
- | 2922 | and [edi], eax |
|
- | 2923 | neg ecx |
|
- | 2924 | push ecx |
|
- | 2925 | shr ecx, 5 |
|
- | 2926 | add edi, 4 |
|
- | 2927 | xor eax, eax |
|
- | 2928 | rep stosd |
|
- | 2929 | pop ecx |
|
- | 2930 | and ecx, 31 |
|
- | 2931 | dec eax |
|
- | 2932 | shr eax, cl |
|
- | 2933 | shl eax, cl |
|
- | 2934 | and [edi], eax |
|
- | 2935 | .writeBitmap: |
|
- | 2936 | pop eax |
|
- | 2937 | mov edi, eax |
|
- | 2938 | lea ecx, [eax+ebx+4095] |
|
- | 2939 | shr eax, 3+9 |
|
- | 2940 | shr ecx, 3+9 |
|
- | 2941 | sub ecx, eax |
|
- | 2942 | mov ebx, eax |
|
- | 2943 | shl ebx, 9 |
|
- | 2944 | add eax, [ebp+NTFS.BitmapLocation] |
|
- | 2945 | add ebx, [ebp+NTFS.BitmapBuffer] |
|
- | 2946 | xor edx, edx |
|
2622 | jmp fs_write64_sys |
2947 | jmp fs_write64_app |
2623 | 2948 | ||
2624 | bitmapBuffering: |
2949 | bitmapBuffering: |
2625 | ; Extend BitmapBuffer and read next 32kb of bitmap |
2950 | ; Extend BitmapBuffer and read next 32kb of bitmap |
2626 | ; Warning: $Bitmap fragmentation is not foreseen |
2951 | ; Warning: $Bitmap fragmentation is not foreseen |
2627 | ; if edi -> position in bitmap buffer, |
2952 | ; in: edi -> position in bitmap buffer |
2628 | ; then ecx = number of buffered dwords left |
2953 | ; out: ecx = number of buffered dwords left |
2629 | push ebx |
2954 | push ebx |
2630 | mov eax, [ebp+NTFS.BitmapTotalSize] |
2955 | mov eax, [ebp+NTFS.BitmapTotalSize] |
2631 | cmp eax, [ebp+NTFS.BitmapSize] |
2956 | cmp eax, [ebp+NTFS.BitmapSize] |
Line 2652... | Line 2977... | ||
2652 | mov eax, [ebp+NTFS.BitmapTotalSize] |
2977 | mov eax, [ebp+NTFS.BitmapTotalSize] |
2653 | cmp eax, [ebp+NTFS.BitmapSize] |
2978 | cmp eax, [ebp+NTFS.BitmapSize] |
2654 | jnc @f |
2979 | jnc @f |
2655 | mov [ebp+NTFS.BitmapSize], eax |
2980 | mov [ebp+NTFS.BitmapSize], eax |
2656 | @@: |
2981 | @@: |
- | 2982 | pop ebx |
|
2657 | mov ecx, [ebp+NTFS.BitmapSize] |
2983 | mov ecx, [ebp+NTFS.BitmapBuffer] |
2658 | add ecx, [ebp+NTFS.BitmapBuffer] |
2984 | add ecx, [ebp+NTFS.BitmapSize] |
2659 | sub ecx, edi |
2985 | sub ecx, edi |
- | 2986 | jc bitmapBuffering |
|
2660 | shr ecx, 2 |
2987 | shr ecx, 2 |
2661 | pop ebx |
- | |
2662 | ret |
2988 | ret |
Line 2663... | Line 2989... | ||
2663 | 2989 | ||
2664 | .err: |
2990 | .err: |
2665 | mov eax, [ebp+NTFS.BitmapBuffer] |
2991 | mov eax, [ebp+NTFS.BitmapBuffer] |
2666 | add eax, [ebp+NTFS.BitmapSize] |
2992 | add eax, [ebp+NTFS.BitmapSize] |
2667 | mov ecx, 8 |
2993 | mov ecx, 8 |
2668 | call release_pages |
2994 | call release_pages |
2669 | .end: |
2995 | .end: |
2670 | add esp, 12 ; double ret |
2996 | pop ebx |
2671 | push ERROR_DISK_FULL |
2997 | pop eax ; ret |
- | 2998 | pop eax |
|
- | 2999 | stc |
|
Line 2672... | Line 3000... | ||
2672 | jmp ntfsOut |
3000 | ret |
2673 | 3001 | ||
2674 | ;---------------------------------------------------------------- |
3002 | ;---------------------------------------------------------------- |
2675 | ntfs_WriteFile: |
3003 | ntfs_WriteFile: |
Line 2682... | Line 3010... | ||
2682 | call ntfs_lock |
3010 | call ntfs_lock |
2683 | stdcall ntfs_find_lfn, [esp+4] |
3011 | stdcall ntfs_find_lfn, [esp+4] |
2684 | jc ntfsNotFound |
3012 | jc ntfsNotFound |
2685 | cmp [ebp+NTFS.ntfs_cur_iRecord], 16 |
3013 | cmp [ebp+NTFS.ntfs_cur_iRecord], 16 |
2686 | jc ntfsDenied |
3014 | jc ntfsDenied |
- | 3015 | bt dword [eax+fileFlags], 28 |
|
- | 3016 | jc ntfsDenied |
|
- | 3017 | mov ecx, eax |
|
- | 3018 | mov eax, [ebx+4] |
|
- | 3019 | mov edx, [ebx+8] |
|
- | 3020 | add eax, [ebx+12] |
|
- | 3021 | adc edx, 0 |
|
- | 3022 | mov [ebp+NTFS.nodeLastRead], 0 |
|
- | 3023 | cmp edx, [ecx+fileRealSize+4] |
|
- | 3024 | jc .readAttribute |
|
- | 3025 | jnz @f |
|
- | 3026 | cmp [ecx+fileRealSize], eax |
|
- | 3027 | jnc .readAttribute |
|
- | 3028 | @@: ; set file size in the directory |
|
- | 3029 | cmp [ebp+NTFS.ntfsFragmentCount], 1 |
|
- | 3030 | jnz ntfsUnsupported ; record fragmented |
|
- | 3031 | mov edi, [ebp+NTFS.cur_index_buf] |
|
- | 3032 | cmp dword [edi], 'INDX' |
|
- | 3033 | jz @f |
|
- | 3034 | mov esi, [ebp+NTFS.frs_buffer] |
|
- | 3035 | push ecx |
|
- | 3036 | mov ecx, [esi+recordRealSize] |
|
- | 3037 | shr ecx, 2 |
|
- | 3038 | rep movsd |
|
- | 3039 | mov esi, [ebp+NTFS.ntfs_attr_offs] |
|
- | 3040 | mov cl, [esi+attributeOffset] |
|
- | 3041 | sub esi, [ebp+NTFS.frs_buffer] |
|
- | 3042 | add esi, ecx |
|
- | 3043 | pop ecx |
|
- | 3044 | add ecx, esi |
|
- | 3045 | @@: |
|
- | 3046 | mov [ecx+fileRealSize], eax |
|
- | 3047 | mov [ecx+fileRealSize+4], edx |
|
- | 3048 | mov ecx, [ebp+NTFS.ntfsLastRead] |
|
- | 3049 | mov [ebp+NTFS.nodeLastRead], ecx |
|
- | 3050 | .readAttribute: |
|
2687 | mov [ebp+NTFS.ntfs_cur_attr], 0x80 |
3051 | mov [ebp+NTFS.ntfs_cur_attr], 0x80 |
2688 | mov [ebp+NTFS.ntfs_cur_offs], 0 |
3052 | mov [ebp+NTFS.ntfs_cur_offs], 0 |
2689 | mov [ebp+NTFS.ntfs_cur_size], 0 |
3053 | mov [ebp+NTFS.ntfs_cur_size], 0 |
- | 3054 | push eax |
|
2690 | call ntfs_read_attr |
3055 | call ntfs_read_attr |
- | 3056 | pop eax |
|
2691 | jc ntfsDenied |
3057 | jc ntfsFail |
2692 | mov eax, [ebp+NTFS.frs_buffer] |
3058 | mov ecx, [ebp+NTFS.frs_buffer] |
2693 | cmp word [eax+baseRecordReuse], 0 |
3059 | cmp word [ecx+baseRecordReuse], 0 |
2694 | jnz ntfsUnsupported ; auxiliary record |
3060 | jnz ntfsUnsupported ; auxiliary record |
2695 | cmp byte [eax+hardLinkCounter], 1 |
3061 | cmp byte [ecx+hardLinkCounter], 1 |
2696 | jnz ntfsUnsupported ; file copying required |
3062 | jnz ntfsUnsupported ; file copying required |
2697 | mov ecx, [ebp+NTFS.ntfs_attr_offs] |
3063 | mov ecx, [ebp+NTFS.ntfs_attr_offs] |
2698 | cmp byte [ecx+nonResidentFlag], 1 |
3064 | cmp byte [ecx+nonResidentFlag], 1 |
2699 | jnz ntfsUnsupported ; resident $DATA |
3065 | jnz ntfsUnsupported ; resident $DATA |
2700 | cmp word [ecx+attributeFlags], 0 |
- | |
2701 | jnz ntfsUnsupported |
- | |
2702 | mov eax, [ebx+4] |
- | |
2703 | mov edx, [ebx+8] |
- | |
2704 | add eax, [ebx+12] |
- | |
2705 | adc edx, 0 |
- | |
2706 | cmp edx, [ecx+attributeRealSize+4] |
3066 | cmp edx, [ecx+attributeRealSize+4] |
2707 | jc .write |
3067 | jc .writeNode |
2708 | jnz ntfsUnsupported ; end of file |
3068 | jnz .resizeAttribute |
2709 | cmp [ecx+attributeRealSize], eax |
3069 | cmp [ecx+attributeRealSize], eax |
- | 3070 | jnc .writeNode |
|
- | 3071 | .resizeAttribute: |
|
- | 3072 | push ebx |
|
- | 3073 | call resizeAttribute |
|
2710 | jc ntfsUnsupported |
3074 | jc ntfsError |
- | 3075 | mov eax, [ebp+NTFS.frs_buffer] |
|
- | 3076 | mov [ebp+NTFS.ntfs_cur_buf], eax |
|
- | 3077 | call writeRecord ; file |
|
- | 3078 | mov ebx, [ebp+NTFS.frs_buffer] |
|
- | 3079 | call ntfs_restore_usa_frs |
|
- | 3080 | pop ebx |
|
- | 3081 | .writeNode: |
|
- | 3082 | mov eax, [ebp+NTFS.nodeLastRead] |
|
- | 3083 | test eax, eax |
|
- | 3084 | jz .writeData |
|
- | 3085 | mov [ebp+NTFS.ntfsLastRead], eax |
|
- | 3086 | mov eax, [ebp+NTFS.cur_index_buf] |
|
- | 3087 | mov [ebp+NTFS.ntfs_cur_buf], eax |
|
- | 3088 | push ebx |
|
- | 3089 | call writeRecord ; directory |
|
- | 3090 | pop ebx |
|
2711 | .write: |
3091 | .writeData: |
2712 | mov eax, [ebx+4] |
3092 | mov eax, [ebx+4] |
2713 | mov edx, [ebx+8] |
3093 | mov edx, [ebx+8] |
2714 | mov ecx, [ebx+12] |
3094 | mov ecx, [ebx+12] |
2715 | mov esi, [ebx+16] |
3095 | mov esi, [ebx+16] |
2716 | shrd eax, edx, 9 |
3096 | shrd eax, edx, 9 |
Line 2740... | Line 3120... | ||
2740 | mov ecx, 1 |
3120 | mov ecx, 1 |
2741 | xor edx, edx |
3121 | xor edx, edx |
2742 | call fs_write64_app |
3122 | call fs_write64_app |
2743 | pop ebx |
3123 | pop ebx |
2744 | pop ecx |
3124 | pop ecx |
2745 | test eax, eax |
- | |
2746 | jnz ntfsDevice |
- | |
2747 | test ecx, ecx |
3125 | test ecx, ecx |
2748 | jz @f |
3126 | jz @f |
2749 | mov eax, [ebx+4] |
3127 | mov eax, [ebx+4] |
2750 | mov edx, [ebx+8] |
3128 | mov edx, [ebx+8] |
2751 | shrd eax, edx, 9 |
3129 | shrd eax, edx, 9 |
Line 2778... | Line 3156... | ||
2778 | lea ebx, [ebp+NTFS.ntfs_bitmap_buf] |
3156 | lea ebx, [ebp+NTFS.ntfs_bitmap_buf] |
2779 | mov ecx, 1 |
3157 | mov ecx, 1 |
2780 | xor edx, edx |
3158 | xor edx, edx |
2781 | call fs_write64_app |
3159 | call fs_write64_app |
2782 | pop ebx |
3160 | pop ebx |
2783 | test eax, eax |
- | |
2784 | jnz ntfsDevice |
- | |
2785 | @@: |
3161 | @@: |
2786 | mov ebx, [ebx+12] |
3162 | mov ebx, [ebx+12] |
2787 | jmp ntfsDone |
3163 | jmp ntfsDone |
Line 2788... | Line 3164... | ||
2788 | 3164 | ||
Line 2862... | Line 3238... | ||
2862 | jz .writeBitmapMFT |
3238 | jz .writeBitmapMFT |
2863 | movzx eax, byte [esi+dataRunsOffset] |
3239 | movzx eax, byte [esi+dataRunsOffset] |
2864 | add esi, eax |
3240 | add esi, eax |
2865 | xor edi, edi |
3241 | xor edi, edi |
2866 | sub esp, 16 |
3242 | sub esp, 16 |
2867 | .clearBitmap: ; "delete" file data |
3243 | @@: ; "delete" file data |
2868 | call ntfs_decode_mcb_entry |
3244 | call ntfs_decode_mcb_entry |
2869 | jnc .mcbEnd |
3245 | jnc @f |
2870 | cmp dword[esp+8], 0 |
3246 | cmp dword[esp+8], 0 |
2871 | jz .clearBitmap |
3247 | jz @b |
2872 | add edi, [esp+8] |
3248 | add edi, [esp+8] |
2873 | mov ebx, [esp] |
3249 | mov ebx, [esp] |
2874 | mov eax, edi |
- | |
2875 | add eax, ebx |
- | |
2876 | shr eax, 3 |
- | |
2877 | inc eax |
- | |
2878 | cmp eax, [ebp+NTFS.BitmapSize] |
- | |
2879 | jc .buffered |
- | |
2880 | add eax, [ebp+NTFS.BitmapBuffer] |
- | |
2881 | add esp, 16 |
- | |
2882 | push edi |
- | |
2883 | mov edi, eax |
- | |
2884 | @@: |
- | |
2885 | call bitmapBuffering |
3250 | call ntfsSpaceFree |
2886 | shl ecx, 2 |
- | |
2887 | js @b |
3251 | jnc @b |
2888 | pop edi |
- | |
2889 | sub esp, 16 |
- | |
2890 | .buffered: |
- | |
2891 | push edi |
- | |
2892 | mov ecx, edi |
- | |
2893 | shr edi, 5 |
- | |
2894 | shl edi, 2 |
- | |
2895 | add edi, [ebp+NTFS.BitmapBuffer] |
- | |
2896 | and ecx, 31 |
- | |
2897 | xor eax, eax |
- | |
2898 | dec eax |
- | |
2899 | shr eax, cl |
- | |
2900 | shl eax, cl |
- | |
2901 | neg ecx |
- | |
2902 | add ecx, 32 |
- | |
2903 | sub ecx, ebx |
- | |
2904 | jc @f |
- | |
2905 | shl eax, cl ; fits inside dword |
- | |
2906 | shr eax, cl |
- | |
2907 | not eax |
- | |
2908 | and [edi], eax |
- | |
2909 | jmp .writeBitmap |
- | |
2910 | - | ||
2911 | @@: |
3252 | @@: |
2912 | not eax |
- | |
2913 | and [edi], eax |
- | |
2914 | neg ecx |
- | |
2915 | push ecx |
- | |
2916 | shr ecx, 5 |
- | |
2917 | add edi, 4 |
- | |
2918 | xor eax, eax |
- | |
2919 | rep stosd |
- | |
2920 | pop ecx |
- | |
2921 | and ecx, 31 |
- | |
2922 | dec eax |
- | |
2923 | shr eax, cl |
- | |
2924 | shl eax, cl |
- | |
2925 | and [edi], eax |
- | |
2926 | .writeBitmap: |
- | |
2927 | pop edi |
- | |
2928 | mov ecx, edi |
- | |
2929 | add ecx, ebx |
- | |
2930 | add ecx, 4095 |
- | |
2931 | shr ecx, 3+9 |
- | |
2932 | mov eax, edi |
- | |
2933 | shr eax, 3+9 |
- | |
2934 | sub ecx, eax |
- | |
2935 | mov ebx, eax |
- | |
2936 | shl ebx, 9 |
- | |
2937 | add eax, [ebp+NTFS.BitmapLocation] |
- | |
2938 | add ebx, [ebp+NTFS.BitmapBuffer] |
- | |
2939 | xor edx, edx |
- | |
2940 | call fs_write64_app |
- | |
2941 | jmp .clearBitmap |
- | |
2942 | - | ||
2943 | .mcbEnd: |
- | |
2944 | add esp, 16 |
3253 | add esp, 16 |
2945 | jmp .writeBitmapMFT |
3254 | jmp .writeBitmapMFT |
Line 2946... | Line 3255... | ||
2946 | 3255 | ||
2947 | .folder: ; empty? |
3256 | .folder: ; empty? |
Line 2980... | Line 3289... | ||
2980 | mov eax, [ebp+NTFS.nodeLastRead] |
3289 | mov eax, [ebp+NTFS.nodeLastRead] |
2981 | mov [ebp+NTFS.ntfsLastRead], eax |
3290 | mov [ebp+NTFS.ntfsLastRead], eax |
2982 | mov eax, [ebp+NTFS.cur_index_buf] |
3291 | mov eax, [ebp+NTFS.cur_index_buf] |
2983 | mov [ebp+NTFS.ntfs_cur_buf], eax |
3292 | mov [ebp+NTFS.ntfs_cur_buf], eax |
2984 | call writeRecord |
3293 | call writeRecord |
2985 | test eax, eax |
- | |
2986 | jz ntfsDone |
3294 | jmp ntfsDone |
2987 | jmp ntfsDevice |
- | |
Line 2988... | Line 3295... | ||
2988 | 3295 | ||
2989 | ;---------------------------------------------------------------- |
3296 | ;---------------------------------------------------------------- |
2990 | ntfs_SetFileEnd: |
3297 | ntfs_SetFileEnd: |
2991 | ntfs_SetFileInfo: |
3298 | ntfs_SetFileInfo: |
Line 3016... | Line 3323... | ||
3016 | xor eax, eax |
3323 | xor eax, eax |
3017 | ret |
3324 | ret |
Line 3018... | Line 3325... | ||
3018 | 3325 | ||
3019 | ntfsUnsupported: |
3326 | ntfsUnsupported: |
3020 | push ERROR_UNSUPPORTED_FS |
- | |
3021 | ntfsOut: |
3327 | push ERROR_UNSUPPORTED_FS |
3022 | call ntfs_unlock |
- | |
3023 | xor ebx, ebx |
- | |
3024 | pop eax |
- | |
3025 | ret |
3328 | jmp ntfsOut |
3026 | ntfsDevice: |
3329 | ntfsDevice: |
3027 | push ERROR_DEVICE |
3330 | push ERROR_DEVICE |
3028 | jmp ntfsOut |
3331 | jmp ntfsOut |
3029 | ntfsNotFound: |
3332 | ntfsNotFound: |
Line 3036... | Line 3339... | ||
3036 | push ERROR_FS_FAIL |
3339 | push ERROR_FS_FAIL |
3037 | jmp ntfsOut |
3340 | jmp ntfsOut |
3038 | ntfsNoMemory: |
3341 | ntfsNoMemory: |
3039 | push ERROR_OUT_OF_MEMORY |
3342 | push ERROR_OUT_OF_MEMORY |
3040 | jmp ntfsOut>=>=> |
3343 | jmp ntfsOut |
- | 3344 | ntfsDiskFull: |
|
- | 3345 | push ERROR_DISK_FULL |
|
- | 3346 | jmp ntfsOut |
|
- | 3347 | ntfsError: |
|
- | 3348 | pop ebx |
|
- | 3349 | push eax |
|
- | 3350 | ntfsOut: |
|
- | 3351 | call ntfs_unlock |
|
- | 3352 | xor ebx, ebx |
|
- | 3353 | pop eax |
|
- | 3354 | ret>=>=> |