Function at 0x479540
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4b94d3
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x4e3f80]
xor eax, esp
mov dword [esp + 0x8c], eax
push ebx
push ebp
push edi
mov eax, dword [0x4e3f80]
xor eax, esp
push eax
lea eax, [esp + 0xa0]
mov dword fs:[0], eax
push 0
push 0
push 3
push 0
push 0
mov edi, ecx
push SHChangeNotifyRegister
push edi
mov ebx, edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
mov dword [esp + 0x14], ebp
push edi
cmp ebp, 0xffffffff
jne 0x4795b2
push str._s_not_found_r_n
call fcn.00477b80
add esp, 8
jmp 0x479924
push str._s_opened_r_n
call fcn.00477b80
add esp, 8
push 0
lea eax, [esp + 0x14]
push eax
push 0xf
push esi
push ebp
mov dword [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esi]
mov al, 0x30
mov byte [esp + 0x38], 0x42
mov byte [esp + 0x39], al
mov byte [esp + 0x3a], al
mov byte [esp + 0x3b], al
cmp ecx, dword [esp + 0x38]
jne 0x479917
mov al, 0x46
cmp byte [esi + 4], al
jne 0x479917
cmp byte [esi + 5], al
jne 0x479917
cmp byte [esi + 6], 0xa
jne 0x479917
push str.Found_header.._r_n
call fcn.00477b80
movzx eax, byte [esi + 0xa]
movzx edx, byte [esi + 9]
movzx ecx, byte [esi + 8]
movzx edi, byte [esi + 0xe]
shl eax, 8
or eax, edx
movzx edx, byte [esi + 7]
shl eax, 8
or eax, ecx
movzx ecx, byte [esi + 0xd]
shl edi, 8
or edi, ecx
movzx ecx, byte [esi + 0xb]
shl eax, 8
or eax, edx
movzx edx, byte [esi + 0xc]
shl edi, 8
or edi, edx
shl edi, 8
push eax
or edi, ecx
push str.Rom_Address___x__r_n
mov dword [esp + 0x30], eax
mov dword [esp + 0x3c], edi
call fcn.00477b80
push edi
push str.Rom_Size___x__r_n
call fcn.00477b80
lea edx, [edi + 0x40008]
push edx
call fcn.00490828
add esp, 0x18
test eax, eax
je 0x479924
mov ecx, dword [esp + 0xb0]
mov dword [eax], ecx
mov dword [eax + 4], edi
mov dword [esp + 0x20], eax
add eax, 8
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], 0
mov dword [ebx], edi
mov eax, dword [esp + 0x18]
imul eax, eax, 0x64
xor edx, edx
div edi
mov ecx, eax
add ecx, ecx
add ecx, ecx
add ecx, ecx
mov eax, 0x66666667
imul ecx
mov ecx, dword [0x4ee750]
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, 0x64
sub edx, eax
push edx
push str.UPGRADEFIRMWARE_PERCENT
call fcn.0046c980
push str.UPGRADEFIRMWARE_PERCENT
lea ecx, [esp + 0x30]
call fcn.004019b0
mov dword [esp + 0xa8], 0
mov eax, dword [eax]
push 0
mov ebx, 0x12
call fcn.0040dea0
mov dword [esp + 0xa8], 0xffffffff
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x479741
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea ecx, [esp + 0x14]
push ecx
push 4
push esi
push ebp
call ebx
movzx edi, byte [esi + 3]
movzx edx, byte [esi + 2]
movzx eax, byte [esi + 1]
movzx ecx, byte [esi]
shl edi, 8
or edi, edx
push 0
lea edx, [esp + 0x14]
push edx
shl edi, 8
push 4
or edi, eax
push esi
shl edi, 8
push ebp
or edi, ecx
call ebx
movzx eax, byte [esi + 3]
movzx ecx, byte [esi + 2]
movzx edx, byte [esi + 1]
shl eax, 8
or eax, ecx
movzx ecx, byte [esi]
shl eax, 8
or eax, edx
push 0
lea edx, [esp + 0x38]
push edx
push 4
shl eax, 8
push esi
or eax, ecx
push ebp
mov dword [esp + 0x24], eax
call ebx
movzx ebp, byte [esi + 3]
movzx eax, byte [esi + 2]
movzx ecx, byte [esi + 1]
movzx edx, byte [esi]
shl ebp, 8
or ebp, eax
shl ebp, 8
or ebp, ecx
shl ebp, 8
or ebp, edx
test edi, edi
jne 0x4797dc
test ebp, ebp
je 0x47984e
sub edi, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
push 0
lea ecx, [esp + 0x14]
push ecx
lea ebx, [edi + eax]
mov eax, dword [esp + 0x1c]
push edx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x10]
add dword [esp + 0x18], ecx
test ecx, ecx
je 0x479832
mov eax, ebx
mov ebx, ecx
call fcn.00479950
mov dword [esp + 0x28], eax
cmp eax, ebp
jne 0x4798ca
push eax
push str.Checksum__0x_x___OK_r_n
call fcn.00477b80
mov ecx, dword [esp + 0x18]
add esp, 8
push ecx
push edi
push str.Record_at_0x_x_length__0x_x_r_n
call fcn.00477b80
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x3c]
add esp, 0xc
jmp 0x4796b3
push str.End_of_record_found.._r_n
call fcn.00477b80
mov ecx, dword [esp + 0x14]
push ecx
push str.Jump_address__0x_x_r_n
call fcn.00477b80
mov ecx, dword [0x4ee750]
add esp, 0xc
push 0x14
push str.UPGRADEFIRMWARE_PERCENT
call fcn.0046c980
push str.UPGRADEFIRMWARE_PERCENT
lea ecx, [esp + 0x20]
call fcn.004019b0
mov dword [esp + 0xa8], 1
mov eax, dword [eax]
push 0
mov ebx, 0x12
call fcn.0040dea0
lea ecx, [esp + 0x1c]
call fcn.00401a70
push str.Wrote_binary_file_r_n
call fcn.00477b80
mov edx, dword [esp + 0x18]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
jmp 0x479926
mov ecx, dword [0x4ee750]
push 1
push str.UPGRADEFIRMWARE_RESULTS
call fcn.0046c980
push 0
mov eax, 0x4c3af8
mov ebx, 0x12
call fcn.0040dea0
mov eax, dword [esp + 0x28]
push ebp
push eax
push str.Checksum__0x_x___FAILED_should_be_0x_x__r_n
call fcn.00477b80
mov ecx, dword [esp + 0x20]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x20]
push edx
call fcn.0049081d
jmp 0x479921
push str.File_isnt_a_.bin_file.._r_n
call fcn.00477b80
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0xa0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x8c]
xor ecx, esp
call fcn.0049dc2a
add esp, 0x9c
ret 4