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

Disassembly:
push 0xffffffffffffffff
push 0x4bcceb
mov eax, dword fs:[0]
push eax
sub esp, 0x148
mov eax, dword [0x4e3f80]
xor eax, esp
mov dword [esp + 0x140], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4e3f80]
xor eax, esp
push eax
lea eax, [esp + 0x15c]
mov dword fs:[0], eax
mov eax, dword [esp + 0x16c]
push 0x80000
mov dword [esp + 0x54], eax
mov esi, edx
mov dword [esp + 0x3c], ecx
call fcn.00490828
push 0x80000
mov ebx, eax
push 0xff
push ebx
mov dword [esp + 0x40], ebx
call fcn.004a1210
add esp, 0x10
xor edi, edi
push edi
push edi
push 3
push edi
push edi
push SHChangeNotifyRegister
push esi
mov dword [esp + 0x44], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
push edi
push ebp
mov dword [esp + 0x28], edi
mov dword [esp + 0x44], edi
mov dword [esp + 0x3c], edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x48], eax
mov dword [esp + 0x40], 0x64
cmp ebp, 0xffffffff
je 0x47eaae
mov dword [esp + 0x18], edi
cmp dword [esp + 0x34], 0
jne 0x47ea84
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [esp + 0x1c]
push edx
push 1
lea eax, [esp + 0x60]
push eax
push ebp
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
cmp eax, 1
jne 0x47e98f
cmp byte [esp + 0x54], 0x3a
jne 0x47e98f
push 0
lea ecx, [esp + 0x1c]
push ecx
push 2
lea edx, [esp + 0x60]
push edx
push ebp
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
cmp eax, 2
jne 0x47e98f
push 0x10
lea eax, [esp + 0x58]
push 0
push eax
call fcn.004a08bd
add esp, 0xc
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x60]
push edx
push ebp
mov dword [esp + 0x38], eax
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
cmp eax, 4
jne 0x47e98f
push 0x10
lea eax, [esp + 0x58]
push 0
push eax
call fcn.004a08bd
add esp, 0xc
push 0
lea edx, [esp + 0x1c]
push edx
movzx ecx, al
add ecx, dword [esp + 0x2c]
mov esi, eax
mov dword [esp + 0x4c], eax
push 2
lea eax, [esp + 0x60]
push eax
shr esi, 8
push ebp
add esi, ecx
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
cmp eax, 2
jne 0x47e98f
push 0x10
lea ecx, [esp + 0x58]
push 0
push ecx
call fcn.004a08bd
xor ecx, ecx
add esp, 0xc
add esi, eax
sub eax, ecx
je 0x47e89b
sub eax, 1
je 0x47e88e
sub eax, 3
jne 0x47e949
push ecx
lea edx, [esp + 0x1c]
push edx
push 4
lea eax, [esp + 0x60]
push eax
push ebp
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
cmp eax, 4
jne 0x47e949
push 0x10
lea ecx, [esp + 0x58]
push 0
push ecx
call fcn.004a08bd
mov ecx, eax
shr ecx, 8
movzx edx, al
add ecx, esi
add esp, 0xc
shl eax, 0x10
lea esi, [ecx + edx]
mov dword [esp + 0x20], eax
jmp 0x47e949
mov dword [esp + 0x34], 1
jmp 0x47e949
mov edx, dword [esp + 0x20]
add edx, 0xe3000000
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x2c], ecx
cmp edx, 0x80000
ja 0x47e8bd
mov dword [esp + 0x2c], 1
cmp dword [esp + 0x24], ecx
jbe 0x47e928
push 0
lea eax, [esp + 0x1c]
push eax
push 2
lea ecx, [esp + 0x60]
push ecx
push ebp
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
test eax, eax
je 0x47e928
push 0x10
lea edx, [esp + 0x58]
push 0
push edx
call fcn.004a08bd
movzx ecx, al
add esp, 0xc
add esi, ecx
cmp dword [esp + 0x2c], 0
je 0x47e919
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x1c]
add edx, ecx
add edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
mov byte [edx + ecx - 0x1d000000], al
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x1c], eax
cmp eax, dword [esp + 0x24]
jb 0x47e8c3
cmp dword [esp + 0x2c], 0
je 0x47e949
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
add eax, edx
add eax, ecx
cmp dword [esp + 0x28], eax
jae 0x47e949
mov dword [esp + 0x28], eax
push 0
lea edx, [esp + 0x1c]
push edx
push 2
lea eax, [esp + 0x60]
push eax
push ebp
call ebx
mov eax, dword [esp + 0x18]
add edi, eax
mov byte [esp + eax + 0x54], 0
cmp eax, 2
jne 0x47e98f
push 0x10
lea ecx, [esp + 0x58]
push 0
push ecx
call fcn.004a08bd
neg esi
and esi, 0xff
add esp, 0xc
cmp esi, eax
je 0x47e98f
mov dword [esp + 0x3c], 1
push 0
lea edx, [esp + 0x1c]
push edx
push 2
lea eax, [esp + 0x60]
push eax
push ebp
call ebx
add edi, dword [esp + 0x18]
xor edx, edx
mov eax, edi
imul eax, eax, 0x64
div dword [esp + 0x48]
lea ecx, [eax + eax*4]
mov eax, 0x66666667
imul ecx
sar edx, 2
mov esi, edx
shr esi, 0x1f
add esi, edx
cmp dword [esp + 0x40], esi
je 0x47ea79
mov ebx, dword [esp + 0x50]
push 1
push 1
push 0x4d2374
mov ecx, ebx
call fcn.004809b0
push 1
push 0xa
push str.DOWNLOADING
mov ecx, ebx
call fcn.004809b0
push 1
mov ecx, 0x64
sub ecx, esi
push ecx
push str.UPGRADEFIRMWARE_PERCENT
mov ecx, ebx
call fcn.004809b0
push str.UPGRADEFIRMWARE_PERCENT
lea ecx, [esp + 0x50]
call fcn.004019b0
mov dword [esp + 0x164], 0
mov edx, dword [0x4ee750]
mov ecx, dword [edx + 0x1c]
mov ecx, dword [ecx + 0x5c]
mov eax, dword [eax]
cmp ecx, dword [ebx + 0x174]
jne 0x47ea42
push 0
mov ebx, 0x12
call fcn.0040dea0
mov dword [esp + 0x164], 0xffffffff
mov eax, dword [esp + 0x4c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x47ea6d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x40], esi
cmp dword [esp + 0x3c], 0
je 0x47e736
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x28]
test eax, eax
je 0x47eaaa
mov ecx, dword [esp + 0x38]
add eax, 0xe3000400
shr eax, 9
shl eax, 9
mov dword [ecx], eax
mov eax, dword [esp + 0x30]
jmp 0x47eaba
mov ebx, dword [esp + 0x30]
mov edx, dword [esp + 0x38]
mov dword [edx], 0
mov eax, ebx
mov ecx, dword [esp + 0x15c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x140]
xor ecx, esp
call fcn.0049dc2a
add esp, 0x154
ret 4