Function at 0x402960
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xe0
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 - 0x54], edx
mov byte [ebp - 0x55], bh
mov dword [ebp - 0x5c], ecx
mov byte [ebp - 0x5d], bl
je 0x4029a2
mov al, byte [ebp - 0x55]
mov byte [ebp - 0x5d], al
mov al, byte [ebp - 0x5d]
test al, al
jne 0x4029c8
jmp 0x4029ab
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 - 0x64], eax
jmp 0x402f40
mov eax, dword [ebp - 0x14]
mov eax, dword [eax]
and eax, 4
cmp eax, 0
jne 0x402a51
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x13c]
mov edx, dword [eax + 0x138]
mov esi, dword [eax + 0x18]
mov eax, dword [eax + 0x1c]
sub edx, esi
setae bl
sub ecx, eax
setae bh
mov dword [ebp - 0x68], edx
mov byte [ebp - 0x69], bh
mov dword [ebp - 0x70], ecx
mov byte [ebp - 0x71], bl
je 0x402a0c
mov al, byte [ebp - 0x69]
mov byte [ebp - 0x71], al
mov al, byte [ebp - 0x71]
test al, al
jne 0x402a51
jmp 0x402a15
lea eax, str.Image_is_smaller_than_SD_card_n
mov dword [esp], eax
call fcn.0040c1c8
lea ecx, str.Do_you_still_want_to_compare_them__Y_or_N__
mov dword [esp], ecx
mov dword [ebp - 0x78], eax
call fcn.0040c1c8
mov dword [ebp - 0x7c], eax
call fcn.00401160
cmp eax, 0
jne 0x402a4f
mov dword [ebp - 0x10], 0
jmp 0x402f40
jmp 0x402a51
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.Verifying_SD_card__c_and__s_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 - 0x80], eax
call sub.KERNEL32.DLL_SetFilePointer
sub esp, 0x10
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + 0x24]
mov dword [ebp - 0x4c], ecx
lea ecx, [ebp - 0x4c]
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 - 0x84], 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 - 0x88], eax
call sub.KERNEL32.DLL_VirtualAlloc
sub esp, 0x10
mov dword [ebp - 0x18], eax
mov eax, esp
mov dword [eax + 0xc], 4
mov dword [eax + 8], 0x3000
mov dword [eax + 4], 0x100000
mov dword [eax], 0
call sub.KERNEL32.DLL_VirtualAlloc
sub esp, 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
mov dword [eax + 0x154], 0
mov dword [eax + 0x150], 0
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 - 0x8c], edx
mov dword [ebp - 0x90], ecx
mov byte [ebp - 0x91], bh
mov byte [ebp - 0x92], bl
je 0x402bac
mov al, byte [ebp - 0x91]
mov byte [ebp - 0x92], al
mov al, byte [ebp - 0x92]
test al, al
jne 0x402e5c
jmp 0x402bbc
cmp dword [0x418244], 0
je 0x402bcd
jmp 0x402e5c
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 - 0x93], bh
mov dword [ebp - 0x98], edx
mov byte [ebp - 0x99], bl
je 0x402c1a
mov al, byte [ebp - 0x93]
mov byte [ebp - 0x99], al
mov al, byte [ebp - 0x99]
test al, al
jne 0x402c53
jmp 0x402c26
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 - 0xa0], edx
mov dword [ebp - 0xa4], ecx
jmp 0x402c66
xor eax, eax
mov ecx, 0x100000
mov dword [ebp - 0xa0], ecx
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 0xa4]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x48]
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 - 0xa8], ecx
call fcn.004016b0
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x14]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x50]
lea esi, [ebp - 0x4c]
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_ReadFile
sub esp, 0x14
mov ecx, 9
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x50]
mov esi, dword [ebp - 0x4c]
mov dword [esp], 9
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [ebp - 0xac], ecx
call fcn.00401330
cmp eax, 0
jne 0x402d07
mov dword [ebp - 0x10], 0
jmp 0x402f40
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x134]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x48]
lea esi, [ebp - 0x4c]
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_ReadFile
sub esp, 0x14
mov ecx, 0xa
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
mov edx, dword [ebp - 0x48]
mov esi, dword [ebp - 0x4c]
mov dword [esp], 0xa
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [ebp - 0xb0], ecx
call fcn.00401330
cmp eax, 0
jne 0x402d77
mov dword [ebp - 0x10], 0
jmp 0x402f40
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x48]
mov esi, esp
mov dword [esi + 8], edx
mov dword [esi + 4], ecx
mov dword [esi], eax
call fcn.0040a8e4
cmp eax, 0
je 0x402e29
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x150]
mov eax, dword [eax + 0x154]
or ecx, eax
mov dword [ebp - 0xb4], ecx
jne 0x402dc9
jmp 0x402db5
lea eax, str.___Errors_b_b_b_b_b_b_b_b_b
mov dword [esp], eax
call fcn.0040c1c8
mov dword [ebp - 0xb8], eax
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x44], 0
mov eax, dword [ebp - 0x44]
cmp eax, dword [ebp - 0x48]
jae 0x402e27
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x18]
movzx eax, byte [ecx + eax]
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x1c]
movzx ecx, byte [edx + ecx]
cmp eax, ecx
je 0x402e18
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x150]
mov edx, dword [eax + 0x154]
add ecx, 1
mov dword [eax + 0x150], ecx
adc edx, 0
mov dword [eax + 0x154], edx
jmp 0x402e1a
mov eax, dword [ebp - 0x44]
add eax, 1
mov dword [ebp - 0x44], eax
jmp 0x402dd7
jmp 0x402e29
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x140]
mov edx, dword [eax + 0x144]
mov esi, dword [ebp - 0x48]
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 0x402b61
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0x150]
mov eax, dword [eax + 0x154]
or ecx, eax
mov dword [ebp - 0xbc], ecx
je 0x402edf
jmp 0x402e77
mov eax, 8
mov ecx, 0x2c
lea edx, [ebp - 0x3c]
mov esi, dword [ebp - 0x14]
add esi, 0x150
mov dword [esp], esi
mov dword [esp + 4], 8
mov dword [esp + 8], 0x2c
mov dword [esp + 0xc], edx
mov dword [ebp - 0xc0], eax
mov dword [ebp - 0xc4], ecx
call fcn.004064ac
lea ecx, str._nErrors:__s_bytes_n
lea edx, [ebp - 0x3c]
mov dword [esp], ecx
mov dword [esp + 4], edx
mov dword [ebp - 0xc8], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xcc], eax
jmp 0x402f40
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
mov ecx, dword [ebp - 0x1c]
mov edx, esp
mov dword [edx], ecx
mov dword [edx + 8], 0x8000
mov dword [edx + 4], 0
mov dword [ebp - 0xd0], eax
call sub.KERNEL32.DLL_VirtualFree
sub esp, 0xc
lea ecx, str._nFinished_n
mov dword [esp], ecx
mov dword [ebp - 0xd4], eax
call fcn.0040c1c8
mov dword [ebp - 0x10], 1
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp - 0x10]
add esp, 0xe0
pop esi
pop edi
pop ebx
pop ebp
ret