Function at 0x402680
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x6c
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp dword [eax + 4], 0
je 0x4026d7
lea eax, str.Zero_SD_card__Y_or_N__
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x2c], eax
call fcn.00401160
cmp eax, 0
jne 0x4026d5
lea eax, str.Aborting_n
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x30], eax
jmp 0x402953
jmp 0x4026d7
mov eax, dword [ebp - 0x14]
movsx eax, byte [eax + 8]
mov ecx, esp
mov dword [ecx + 4], eax
mov dword [ecx], str.Zeroing_SD_card__c_n
call fcn.0040c1c8
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + 0x24]
mov dword [ebp - 0x24], ecx
lea ecx, [ebp - 0x24]
mov edx, dword [ebp - 0x14]
mov esi, dword [edx + 0x14]
mov edx, dword [edx + 0x20]
mov edi, esp
mov dword [edi + 8], ecx
mov dword [edi + 4], edx
mov dword [edi], esi
mov dword [edi + 0xc], 0
mov dword [ebp - 0x34], eax
call sub.KERNEL32.DLL_SetFilePointer
sub esp, 0x10
mov ecx, esp
mov dword [ecx + 0xc], 4
mov dword [ecx + 8], 0x3000
mov dword [ecx + 4], 0x100000
mov dword [ecx], 0
mov dword [ebp - 0x38], eax
call sub.KERNEL32.DLL_VirtualAlloc
sub esp, 0x10
mov dword [ebp - 0x18], eax
mov ecx, esp
mov dword [ecx], eax
mov dword [ecx + 8], 0x100000
mov dword [ecx + 4], 0
call fcn.0040ab1b
mov eax, dword [ebp - 0x14]
mov ecx, esp
mov dword [ecx], eax
call fcn.00401220
mov eax, dword [ebp - 0x14]
mov dword [eax + 0x144], 0
mov dword [eax + 0x140], 0
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x140]
mov edx, dword [eax + 0x144]
mov esi, dword [eax + 0x14c]
mov eax, dword [eax + 0x148]
sub ecx, eax
setae bl
sub edx, esi
setae bh
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x40], ecx
mov byte [ebp - 0x41], bh
mov byte [ebp - 0x42], bl
je 0x4027bd
mov al, byte [ebp - 0x41]
mov byte [ebp - 0x42], al
mov al, byte [ebp - 0x42]
test al, al
jne 0x40291b
jmp 0x4027ca
cmp dword [0x418244], 0
je 0x4027db
jmp 0x40291b
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x14c]
mov edx, dword [eax + 0x148]
mov esi, dword [eax + 0x140]
mov eax, dword [eax + 0x144]
sub edx, esi
sbb ecx, eax
sub edx, 0xfffff
seta bl
test ecx, ecx
setne bh
mov byte [ebp - 0x43], bh
mov dword [ebp - 0x48], edx
mov byte [ebp - 0x49], bl
je 0x402819
mov al, byte [ebp - 0x43]
mov byte [ebp - 0x49], al
mov al, byte [ebp - 0x49]
test al, al
jne 0x402849
jmp 0x402822
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x14c]
mov edx, dword [eax + 0x148]
mov esi, dword [eax + 0x140]
mov eax, dword [eax + 0x144]
sub edx, esi
sbb ecx, eax
mov dword [ebp - 0x50], edx
mov dword [ebp - 0x54], ecx
jmp 0x402856
xor eax, eax
mov ecx, 0x100000
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x54]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x14]
mov esi, dword [esi + 0x28]
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 8], esi
mov dword [ebp - 0x58], ecx
call fcn.004016b0
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x14]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x28]
lea esi, [ebp - 0x24]
mov edi, esp
mov dword [edi + 0xc], esi
mov dword [edi + 8], edx
mov dword [edi + 4], ecx
mov dword [edi], eax
mov dword [edi + 0x10], 0
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
mov ecx, 5
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x24]
mov dword [esp], 5
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [ebp - 0x5c], ecx
call fcn.00401330
cmp eax, 0
jne 0x4028e8
mov dword [ebp - 0x10], 0
jmp 0x402953
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x140]
mov edx, dword [eax + 0x144]
mov esi, dword [ebp - 0x20]
add ecx, esi
mov dword [eax + 0x140], ecx
adc edx, 0
mov dword [eax + 0x144], edx
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.00401250
jmp 0x402784
mov eax, dword [ebp - 0x18]
mov ecx, esp
mov dword [ecx], eax
mov dword [ecx + 8], 0x8000
mov dword [ecx + 4], 0
call sub.KERNEL32.DLL_VirtualFree
sub esp, 0xc
lea ecx, str._nFinished_n
mov dword [esp], ecx
mov dword [ebp - 0x60], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x10]
add esp, 0x6c
pop esi
pop edi
pop ebx
pop ebp
ret