Function at 0x409e4c
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff64
push ebx
push esi
push edi
mov ebx, eax
lea esi, [ebp - 0x84]
mov eax, 0x49ccdc
call fcn.0047a12c
mov word [ebp - 0x86], 0
xor edx, edx
xor ecx, ecx
mov dword [ebp - 0x8c], edx
mov dword [ebp - 0x90], ecx
mov word [esi + 0x10], 8
mov edx, str.Starting_eeprom_write
lea eax, [ebp - 4]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.0040758c
dec dword [esi + 0x1c]
lea eax, [ebp - 4]
mov edx, 2
call fcn.00485dbc
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
cmp dword [0x4a598c], 0
je 0x409ed5
mov ecx, dword [0x4a598c]
jmp 0x409eda
mov ecx, 0x49bfae
push ecx
call sub.KERNEL32.DLL_CreateFileA
mov edi, eax
mov dword [ebx + 0x10050], edi
push 0
push edi
call sub.KERNEL32.DLL_GetFileSize
mov ecx, eax
mov dword [ebp - 0x98], pe_nt_image_headers32
mov dword [ebp - 0x9c], 3
mov eax, ecx
xor edx, edx
div dword [ebp - 0x98]
mov dword [ebp - 0x94], eax
mov eax, ecx
xor edx, edx
div dword [ebp - 0x98]
test edx, edx
je 0x409f2a
inc dword [ebp - 0x94]
push 2
call sub.KERNEL32.DLL_Sleep
mov ecx, dword [0x4a5984]
mov edx, dword [ebp - 0x94]
mov eax, dword [ecx + 0x2f4]
call fcn.00456998
xor ecx, ecx
mov dword [ebp - 0x90], ecx
mov byte [ebx + 0x8038], 0xde
lea edx, [ebx + 0x8038]
mov ecx, 1
mov eax, ebx
call fcn.0040b6dc
mov dword [ebx + 0x100c8], eax
mov al, byte [ebx + 0x8038]
cmp al, 0x21
je 0x409f86
cmp al, 0x15
je 0x409f86
cmp dword [ebx + 0x100d8], 0
je 0x409f57
cmp dword [ebx + 0x100d8], 0
jne 0x40a328
cmp al, 0x21
jne 0x40a1b8
push 0
lea edx, [ebp - 0x90]
push edx
mov ecx, dword [ebp - 0x98]
push ecx
mov eax, dword [ebp - 0x9c]
add eax, ebx
add eax, 0x30
push eax
mov edx, dword [ebx + 0x10050]
push edx
call sub.KERNEL32.DLL_ReadFile
test eax, eax
jne 0x409ff6
mov word [esi + 0x10], 0x14
mov edx, str.Could_not_read_from_BIN_file
lea eax, [ebp - 8]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.00407798
dec dword [esi + 0x1c]
lea eax, [ebp - 8]
mov edx, 2
call fcn.00485dbc
cmp dword [ebp - 0x90], 0
je 0x40a303
mov ecx, dword [ebp - 0x90]
mov edx, 3
shr ecx, 8
and cl, 0xff
mov byte [ebx + 0x30], cl
mov al, byte [ebp - 0x90]
and al, 0xff
xor edi, edi
mov byte [ebx + 0x31], al
lea eax, [ebx + 0x33]
jmp 0x40a032
xor ecx, ecx
inc edx
mov cl, byte [eax]
add di, cx
inc eax
mov ecx, dword [ebp - 0x90]
add ecx, 3
cmp edx, ecx
jb 0x40a029
add word [ebp - 0x86], di
mov eax, edi
and al, 0xff
mov byte [ebx + 0x32], al
inc dword [ebp - 0x8c]
mov edx, dword [0x4a5984]
mov eax, dword [edx + 0x2f4]
mov edi, dword [ebp - 0x8c]
mov edx, edi
call fcn.004569a8
mov word [esi + 0x10], 0x20
lea eax, [ebp - 0x10]
mov edx, edi
call fcn.00485d34
push eax
inc dword [esi + 0x1c]
mov edx, str.Sending_block
lea eax, [ebp - 0xc]
call fcn.00485c64
inc dword [esi + 0x1c]
xor ecx, ecx
mov dword [ebp - 0x14], ecx
lea ecx, [ebp - 0x14]
inc dword [esi + 0x1c]
pop edx
call fcn.00485e14
lea eax, [ebp - 0x14]
push eax
mov edx, 0x49bfdb
lea eax, [ebp - 0x18]
call fcn.00485c64
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x1c], eax
lea edx, [ebp - 0x18]
inc dword [esi + 0x1c]
lea ecx, [ebp - 0x1c]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x20]
mov edx, dword [ebp - 0x94]
call fcn.00485d34
mov edx, eax
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x24], eax
lea ecx, [ebp - 0x24]
inc dword [esi + 0x1c]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x24]
push edx
mov edx, 0x49bfde
lea eax, [ebp - 0x28]
call fcn.00485c64
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x2c], eax
lea edx, [ebp - 0x28]
inc dword [esi + 0x1c]
lea ecx, [ebp - 0x2c]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x2c]
mov eax, ebx
call fcn.0040758c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x2c]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x28]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x24]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x20]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x18]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.00485dbc
jmp 0x40a303
mov word [esi + 0x10], 0x2c
lea eax, [ebp - 0x34]
mov edx, dword [ebp - 0x8c]
call fcn.00485d34
push eax
inc dword [esi + 0x1c]
mov edx, str.Re_sending_block
lea eax, [ebp - 0x30]
call fcn.00485c64
inc dword [esi + 0x1c]
xor ecx, ecx
mov dword [ebp - 0x38], ecx
lea ecx, [ebp - 0x38]
inc dword [esi + 0x1c]
pop edx
call fcn.00485e14
lea eax, [ebp - 0x38]
push eax
mov edx, 0x49bff2
lea eax, [ebp - 0x3c]
call fcn.00485c64
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x40], eax
lea edx, [ebp - 0x3c]
inc dword [esi + 0x1c]
lea ecx, [ebp - 0x40]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x40]
push edx
lea eax, [ebp - 0x44]
mov edx, dword [ebp - 0x94]
call fcn.00485d34
mov edx, eax
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x48], eax
lea ecx, [ebp - 0x48]
inc dword [esi + 0x1c]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x48]
push edx
mov edx, 0x49bff5
lea eax, [ebp - 0x4c]
call fcn.00485c64
inc dword [esi + 0x1c]
xor eax, eax
mov dword [ebp - 0x50], eax
lea edx, [ebp - 0x4c]
inc dword [esi + 0x1c]
lea ecx, [ebp - 0x50]
pop eax
call fcn.00485e14
lea edx, [ebp - 0x50]
mov eax, ebx
call fcn.0040758c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x50]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x4c]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x48]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x40]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x3c]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x38]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.00485dbc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x30]
mov edx, 2
call fcn.00485dbc
cmp dword [ebp - 0x90], 0
je 0x40a328
mov ecx, dword [ebp - 0x90]
add ecx, dword [ebp - 0x9c]
lea edx, [ebx + 0x30]
mov eax, ebx
call fcn.0040b65c
mov dword [ebx + 0x100cc], eax
mov ecx, dword [ebp - 0x90]
cmp ecx, dword [ebp - 0x98]
jne 0x40a34c
cmp dword [ebx + 0x100d0], 0
jne 0x40a34c
cmp dword [ebx + 0x100d8], 0
je 0x409f50
cmp dword [ebx + 0x100d0], 0
jne 0x40a431
cmp dword [ebx + 0x100d8], 0
jne 0x40a431
mov byte [ebx + 0x30], 0
mov byte [ebx + 0x31], 0
mov al, byte [ebp - 0x86]
lea edx, [ebx + 0x30]
and al, 0xff
mov ecx, 3
mov byte [ebx + 0x32], al
mov eax, ebx
call fcn.0040b65c
mov dword [ebx + 0x100cc], eax
test eax, eax
jbe 0x40a3c1
mov word [esi + 0x10], 0x38
mov edx, str.Waiting_for_checksum_confirmation
lea eax, [ebp - 0x54]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.0040758c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x54]
mov edx, 2
call fcn.00485dbc
mov byte [ebx + 0x8038], 0xde
lea edx, [ebx + 0x8038]
mov ecx, 1
mov eax, ebx
call fcn.0040b6dc
mov dword [ebx + 0x100c8], eax
mov al, byte [ebx + 0x8038]
cmp al, 0x21
je 0x40a3f7
cmp al, 0x15
je 0x40a3f7
cmp dword [ebx + 0x100d8], 0
je 0x40a3c8
cmp al, 0x15
jne 0x40a431
push 0xd
call sub.KERNEL32.DLL_SetLastError
mov word [esi + 0x10], 0x44
mov edx, str.EEPROM_checksum_failed
lea eax, [ebp - 0x58]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.004075bc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x58]
mov edx, 2
call fcn.00485dbc
mov eax, dword [ebx + 0x10050]
cmp eax, 0xffffffff
je 0x40a485
push eax
call sub.KERNEL32.DLL_CloseHandle
cmp dword [ebx + 0x100d0], 0
jne 0x40a4b4
cmp dword [ebx + 0x100d8], 0
jne 0x40a4b4
mov word [esi + 0x10], 0x50
mov edx, str.Download_complete
lea eax, [ebp - 0x5c]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.0040758c
dec dword [esi + 0x1c]
lea eax, [ebp - 0x5c]
mov edx, 2
call fcn.00485dbc
jmp 0x40a4b4
mov word [esi + 0x10], 0x5c
mov edx, str.Could_not_open_BIN_file
lea eax, [ebp - 0x60]
call fcn.00485c64
mov edx, eax
inc dword [esi + 0x1c]
mov eax, ebx
call fcn.004075bc
dec dword [esi + 0x1c]
lea eax, [ebp - 0x60]
mov edx, 2
call fcn.00485dbc
mov ecx, dword [esi]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret