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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x88
mov eax, dword [ebp + 8]
mov dword [ebp - 0x14], eax
mov ecx, dword [eax + 0x13c]
mov edx, dword [eax + 0x138]
mov esi, dword [eax + 0x18]
mov eax, dword [eax + 0x1c]
sub edx, esi
setbe bl
sub ecx, eax
setbe bh
mov dword [ebp - 0x2c], edx
mov byte [ebp - 0x2d], bh
mov dword [ebp - 0x34], ecx
mov byte [ebp - 0x35], bl
je 0x4022f2
mov al, byte [ebp - 0x2d]
mov byte [ebp - 0x35], al
mov al, byte [ebp - 0x35]
test al, al
jne 0x402318
jmp 0x4022fb
lea eax, str.Image_is_bigger_than_SD_card_n
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x3c], eax
jmp 0x402667
mov eax, dword [ebp - 0x14]
cmp dword [eax + 4], 0
je 0x402360
lea eax, str.Copy_image_to_SD_card__Y_or_N__
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x40], eax
call fcn.00401160
cmp eax, 0
jne 0x40235e
lea eax, str.Aborting_n
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x44], eax
jmp 0x402667
jmp 0x402360
mov eax, dword [ebp - 0x14]
mov ecx, eax
add ecx, 0x34
movsx eax, byte [eax + 8]
mov edx, esp
mov dword [edx + 8], eax
mov dword [edx + 4], ecx
mov dword [edx], str.Copying__s_to_SD_card__c_n
call fcn.0040c1c8
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 - 0x48], eax
call sub.KERNEL32.DLL_SetFilePointer
sub esp, 0x10
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 - 0x4c], 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 - 0x50], 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 - 0x54], edx
mov dword [ebp - 0x58], ecx
mov byte [ebp - 0x59], bh
mov byte [ebp - 0x5a], bl
je 0x402464
mov al, byte [ebp - 0x59]
mov byte [ebp - 0x5a], al
mov al, byte [ebp - 0x5a]
test al, al
jne 0x40262f
jmp 0x402471
cmp dword [0x418244], 0
je 0x402482
jmp 0x40262f
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 - 0x5b], bh
mov dword [ebp - 0x60], edx
mov byte [ebp - 0x61], bl
je 0x4024c0
mov al, byte [ebp - 0x5b]
mov byte [ebp - 0x61], al
mov al, byte [ebp - 0x61]
test al, al
jne 0x4024f0
jmp 0x4024c9
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 - 0x68], edx
mov dword [ebp - 0x6c], ecx
jmp 0x4024fd
xor eax, eax
mov ecx, 0x100000
mov dword [ebp - 0x68], ecx
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x6c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x134]
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 - 0x70], ecx
call sub.KERNEL32.DLL_ReadFile
sub esp, 0x14
mov ecx, 0xa
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov dword [esp], 0xa
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [ebp - 0x74], ecx
call fcn.00401330
cmp eax, 0
jne 0x402576
mov dword [ebp - 0x10], 0
jmp 0x402667
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x14]
mov edx, dword [edx + 0x28]
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
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 - 0x78], ecx
call fcn.00401330
cmp eax, 0
jne 0x4025fc
mov dword [ebp - 0x10], 0
jmp 0x402667
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 0x40242b
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 - 0x7c], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 1
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x10]
add esp, 0x88
pop esi
pop edi
pop ebx
pop ebp
ret