Function at 0x46a670
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x60]
mov eax, dword [ebx + 0x1c]
test al, 1
je 0x46a6c0
mov esi, dword [ebx + 8]
mov ecx, dword [ebx]
test al, 8
jne 0x46a7f7
test esi, esi
je 0x46a900
mov dword [esp], ecx
call fcn.004155c0
mov ebp, eax
mov eax, edx
or eax, ebp
jne 0x46a807
mov dword [ebx + 8], 0
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
movzx ecx, byte [ebx + 0x3a]
movzx esi, word [ebx + 0xc8]
mov dword [esp + 0x38], 0
mov byte [esp + 0x20], cl
test si, si
je 0x46a7ee
test al, 0x10
jne 0x46a7ee
lea eax, [esp + 0x38]
mov dword [esp + 8], eax
movzx eax, word [ebx + 0x38]
mov dword [esp], 0
mov dword [esp + 4], eax
call fcn.00427280
movzx ecx, byte [esp + 0x20]
mov ebp, eax
mov eax, edx
or eax, ebp
jne 0x46a9a0
xor edi, edi
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], 0
mov ebp, edi
mov edi, esi
shld ebp, esi, cl
shl edi, cl
xor esi, esi
test cl, 0x20
cmovne ebp, edi
mov dword [esp + 0x10], eax
cmovne edi, esi
movzx eax, word [ebx + 0x38]
mov dword [esp + 8], ebp
mov dword [esp + 0xc], eax
mov dword [esp + 4], edi
mov eax, dword [ebx]
mov dword [esp + 0x24], ebp
mov dword [esp], eax
mov dword [esp + 0x20], edi
call fcn.00415cf0
mov ebp, eax
mov eax, edx
or eax, ebp
jne 0x46aa90
mov eax, dword [esp + 0x38]
mov edx, dword [ebx + 0x90]
cmp edx, dword [eax + 0x1e8]
je 0x46a7db
mov dword [eax + 0x1e8], edx
lea edx, [esp + 0x3c]
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x24]
mov dword [esp + 0x10], eax
movzx eax, word [ebx + 0x38]
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x3c], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call fcn.00415e50
mov ebp, eax
mov eax, edx
or eax, ebp
jne 0x46ac28
movzx edi, word [ebx + 0x38]
mov esi, dword [esp + 0x3c]
cmp edi, esi
jne 0x46ab6c
mov eax, dword [esp + 0x38]
test eax, eax
je 0x46a7eb
lea edi, [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], edi
call fcn.0041d440
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebx]
test al, 8
je 0x46a811
mov esi, dword [ebx + 8]
and dword [ecx + 4], 0xfffffffb
xor ebp, ebp
xor edx, edx
test esi, esi
jne 0x46a697
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], ecx
call fcn.00415630
mov ebp, eax
mov eax, edx
or eax, ebp
jne 0x46a914
mov eax, dword [ebx + 0x1c]
test al, 1
jne 0x46a682
mov ecx, dword [ebx + 0xdc]
mov eax, dword [ecx + 0xc]
mov edx, dword [ecx + 8]
mov esi, dword [ecx + 0x14]
mov edi, eax
mov eax, edx
or eax, edi
mov dword [esp + 0x2c], edi
mov edi, dword [ecx + 0x10]
mov ecx, esi
mov dword [esp + 0x20], eax
setne al
movzx eax, al
mov ebp, eax
or ecx, edi
jne 0x46aae1
mov esi, 1
cmp esi, edx
sbb ecx, dword [esp + 0x2c]
jae 0x46a8d0
mov esi, dword [fcn.004a1b90]
mov dword [esp], 2
call esi
mov dword [esp + 8], 0x546be0
mov dword [esp + 4], str.__s__Dirty_state_not_0_or_1_at_fat_volume_close.
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call esi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call esi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov ecx, dword [ebx + 0x24]
xor edx, edx
test ecx, ecx
setne dl
cmp ebp, edx
je 0x46a8f1
mov eax, ebx
call fcn.0046a3d0
mov esi, eax
mov eax, edx
or eax, esi
jne 0x46ac79
mov eax, dword [ebx + 0x1c]
jmp 0x46a682
mov dword [esp], ecx
call fcn.00415630
add esp, 0x4c
mov ebp, eax
pop ebx
pop esi
mov eax, ebp
pop edi
pop ebp
ret
mov dword [esp + 4], edx
mov dword [esp], ebp
mov dword [esp + 0x20], edx
call fcn.0041d490
mov dword [esp], 2
mov ebx, dword [fcn.004a1b90]
mov esi, eax
call ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebp
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__Failed_to_sync_at_close:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call ebx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call ebx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov edx, dword [esp + 0x20]
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], edx
mov edi, ebp
mov dword [esp], ebp
mov dword [esp + 0x2c], edx
call fcn.0041d490
movzx ecx, word [ebx + 0x38]
mov dword [esp], 2
mov esi, eax
mov ebx, dword [fcn.004a1b90]
mov dword [esp + 0x20], ecx
call ebx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__Error_while_allocating__Iu_byte_temporary_FSInfo_sector_buffer:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call ebx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call ebx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x2c]
test eax, eax
je 0x46aa51
lea ecx, [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 0x20], edx
call fcn.0041d440
mov edx, dword [esp + 0x20]
mov dword [esp + 4], edx
mov dword [esp], ebp
mov dword [esp + 0x20], edx
call fcn.0041d490
mov dword [esp], 2
mov esi, eax
call ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0x546be0
mov dword [esp + 4], str.__s__Error_while_updating_FSInfo_sector:__lu___s_
jmp 0x46a94d
mov dword [esp + 4], edx
mov edi, ebp
mov dword [esp], ebp
mov dword [esp + 0x2c], edx
call fcn.0041d490
movzx esi, word [ebx + 0xc8]
mov dword [esp], 2
mov dword [esp + 0x20], eax
mov ebx, dword [fcn.004a1b90]
call ebx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], ecx
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__Error_while_reading_sector__u_from_device:__lu___s_
jmp 0x46a9eb
mov eax, dword [esp + 0x20]
mov edx, dword [fcn.004a1b90]
mov dword [esp], 2
test eax, eax
mov dword [esp + 0x20], edx
jne 0x46ac09
call edx
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], esi
mov dword [esp + 8], 0x546be0
mov dword [esp + 4], str.__s__Marking_the_volume_as_dirty_because_of__I64u_possible_metadata_inconsistencies_encountered_during_operation.
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov edx, dword [esp + 0x20]
mov dword [esp], 2
call edx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov edx, dword [esp + 0x20]
mov dword [esp], 2
call edx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov edx, 1
jmp 0x46a8da
movzx ebp, word [ebx + 0xc8]
mov ebx, dword [fcn.004a1b90]
mov dword [esp], 2
call ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebp
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__Partial_write_while_writing_sector__u_to_device___Iu____u_bytes_written_.
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call ebx
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call ebx
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [esp + 0x38]
test eax, eax
je 0x46abf8
lea edi, [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], edi
call fcn.0041d440
mov edi, 5
mov ebp, 5
xor edx, edx
jmp 0x46aa51
call edx
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], esi
mov dword [esp + 8], 0x546be0
mov dword [esp + 4], str.__s__Leaving_the_volume_marked_as_dirty_because_of__I64u_possible_metadata_inconsistencies_encountered_during_operation.
jmp 0x46ab18
mov dword [esp + 4], edx
mov edi, ebp
mov dword [esp], ebp
mov dword [esp + 0x2c], edx
call fcn.0041d490
movzx esi, word [ebx + 0xc8]
mov dword [esp], 2
mov dword [esp + 0x20], eax
mov ebx, dword [fcn.004a1b90]
call ebx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], esi
mov dword [esp + 0x14], ecx
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__Error_while_writing_sector__u_to_device:__lu___s_
jmp 0x46a9eb
mov dword [esp + 4], edx
mov dword [esp], esi
call fcn.0041d490
mov edi, dword [fcn.004a1b90]
mov dword [esp], 2
mov ebp, eax
call edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x546ba0
mov dword [esp + 4], str.__s__fat_volume_write_boot_sector_fields_returned_with_error:__lu___s_
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call edi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x546bdd
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call edi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
jmp 0x46a8f1