Function at 0x401f50
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x70
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp dword [eax + 4], 0
je 0x401fb2
lea eax, str.Copy_SD_card__c_to_image__Y_or_N__
mov ecx, dword [ebp - 0x14]
movsx ecx, byte [ecx + 8]
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.0040c1c8
mov dword [ebp - 0x28], eax
call fcn.00401160
cmp eax, 0
jne 0x401fb0
lea eax, str.Aborting_n
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x2c], eax
jmp 0x40229a
jmp 0x401fb2
mov eax, dword [ebp - 0x14]
mov ecx, eax
add ecx, 0x34
movsx eax, byte [eax + 8]
mov edx, esp
mov dword [edx + 8], ecx
mov dword [edx + 4], eax
mov dword [edx], str.Copying_SD_card__c_to__s_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 - 0x30], eax
call sub.KERNEL32.DLL_SetFilePointer
sub esp, 0x10
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + 0x134]
mov edx, esp
mov dword [edx], ecx
mov dword [edx + 0xc], 0
mov dword [edx + 8], 0
mov dword [edx + 4], 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 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 0x4020b6
mov al, byte [ebp - 0x41]
mov byte [ebp - 0x42], al
mov al, byte [ebp - 0x42]
test al, al
jne 0x402262
jmp 0x4020c3
cmp dword [0x418244], 0
je 0x4020d4
jmp 0x402262
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 0x402112
mov al, byte [ebp - 0x43]
mov byte [ebp - 0x49], al
mov al, byte [ebp - 0x49]
test al, al
jne 0x402142
jmp 0x40211b
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 0x40214f
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 - 0x14]
mov eax, dword [eax + 0x14]
mov edx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x20]
lea edi, [ebp - 0x24]
mov ebx, esp
mov dword [ebx + 0xc], edi
mov dword [ebx + 8], esi
mov dword [ebx + 4], edx
mov dword [ebx], eax
mov dword [ebx + 0x10], 0
mov dword [ebp - 0x58], ecx
call sub.KERNEL32.DLL_ReadFile
sub esp, 0x14
mov ecx, 9
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov dword [esp], 9
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 0x4021c5
mov dword [ebp - 0x10], 0
jmp 0x40229a
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x134]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x20]
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, 6
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov dword [esp], 6
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [ebp - 0x60], ecx
call fcn.00401330
cmp eax, 0
jne 0x40222f
mov dword [ebp - 0x10], 0
jmp 0x40229a
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 0x40207d
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 - 0x64], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x10]
add esp, 0x70
pop esi
pop edi
pop ebx
pop ebp
ret