Function at 0x40bdf3
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x2f8
mov eax, 0x5f2bfd
call fcn.005c5e27
mov eax, dword [ebp + 8]
mov dword [ebp - 0x21c], eax
call fcn.0040ae81
push eax
push 0x629eb4
lea eax, [ebp - 0x114]
push pe_nt_image_headers32
push eax
call fcn.005be145
add esp, 0x10
xor ebx, ebx
push ebx
push 2
push 3
pop edi
push edi
push ebx
push edi
push 0xc0000000
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x224], eax
cmp eax, 0xffffffff
je 0x40c733
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x40c6fb
push 0xf
pop edi
mov dword [ebp - 0x11c], edi
mov dword [ebp - 0x120], ebx
mov byte [ebp - 0x130], bl
lea ecx, [ebp - 0x130]
mov dword [ebp - 4], ebx
call fcn.004042a7
xor eax, eax
cmp dword [ebp - 0x120], ebx
jbe 0x40beb7
cmp dword [ebp - 0x11c], 0x10
mov ecx, dword [ebp - 0x130]
jae 0x40beab
lea ecx, [ebp - 0x130]
mov byte [ecx + eax], bl
inc eax
cmp eax, dword [ebp - 0x120]
jb 0x40be96
cmp dword [ebp - 0x11c], 0x10
mov eax, dword [ebp - 0x130]
jae 0x40becc
lea eax, [ebp - 0x130]
push ebx
lea ecx, [ebp - 0x248]
push ecx
push esi
push eax
push dword [ebp - 0x224]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c6be
mov dword [ebp - 0x1a8], edi
mov dword [ebp - 0x1ac], ebx
mov byte [ebp - 0x1bc], bl
mov dword [ebp - 0x1fc], edi
mov dword [ebp - 0x200], ebx
mov byte [ebp - 0x210], bl
mov byte [ebp - 4], 2
push 0x66e300
lea ecx, [ebp - 0x1a0]
mov dword [ebp - 0x18c], edi
mov dword [ebp - 0x190], ebx
mov byte [ebp - 0x1a0], bl
call fcn.00402342
push 1
push 0x629ec8
lea eax, [ebp - 0x1a0]
push eax
xor eax, eax
mov byte [ebp - 4], 3
call fcn.004026da
mov dword [ebp - 0x214], eax
cmp eax, 0xffffffff
je 0x40c108
push eax
push ebx
lea eax, [ebp - 0x1a0]
push eax
lea esi, [ebp - 0x14c]
call fcn.004042ca
mov esi, eax
lea edi, [ebp - 0x1bc]
mov byte [ebp - 4], 4
call fcn.00405d94
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 3
call fcn.00402696
mov eax, dword [ebp - 0x214]
lea ecx, [eax + 2]
cmp dword [ebp - 0x190], ecx
jbe 0x40bfdd
push 0xffffffffffffffff
inc eax
push eax
lea eax, [ebp - 0x1a0]
push eax
lea esi, [ebp - 0x14c]
call fcn.004042ca
mov esi, eax
lea edi, [ebp - 0x210]
mov byte [ebp - 4], 5
call fcn.00405d94
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 3
call fcn.00402696
push 0xf
pop edi
push 1
mov esi, 0x629ecc
push esi
lea ecx, [ebp - 0x184]
mov dword [ebp - 0x170], edi
mov dword [ebp - 0x174], ebx
mov byte [ebp - 0x184], bl
call fcn.004022cd
lea eax, [ebp - 0x184]
push eax
lea edx, [ebp - 0x210]
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 6
call fcn.00479850
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x184]
mov byte [ebp - 4], 8
call fcn.00402696
push 1
push esi
lea ecx, [ebp - 0x14c]
mov dword [ebp - 0x138], edi
mov dword [ebp - 0x13c], ebx
mov byte [ebp - 0x14c], bl
call fcn.004022cd
mov byte [ebp - 4], 9
mov eax, dword [ebp - 0x21c]
mov eax, dword [eax + 0xe8]
push eax
lea ecx, [ebp - 0x1d8]
mov dword [ebp - 0x1c4], edi
mov dword [ebp - 0x1c8], ebx
mov byte [ebp - 0x1d8], bl
call fcn.00402342
lea eax, [ebp - 0x14c]
push eax
lea edx, [ebp - 0x1d8]
lea ecx, [ebp - 0x268]
mov byte [ebp - 4], 0xa
call fcn.00479850
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x1d8]
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0xd
call fcn.00402696
push ecx
mov dword [ebp - 0x21c], esp
lea esi, [ebp - 0x234]
mov dword [ebp - 0x21c], esp
call fcn.0041386f
push ecx
mov byte [ebp - 4], 0xe
mov dword [ebp - 0x21c], esp
lea esi, [ebp - 0x244]
mov dword [ebp - 0x21c], esp
call fcn.0041386f
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x258]
mov dword [ebp - 0x214], eax
jmp 0x40c1fd
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x1a0]
push eax
lea ecx, [ebp - 0x1bc]
call fcn.004025f3
jmp 0x40bfe0
push 1
push 0x629ed0
lea ecx, [ebp - 0x14c]
mov dword [ebp - 0x138], edi
mov dword [ebp - 0x13c], ebx
mov byte [ebp - 0x14c], bl
call fcn.004022cd
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0x10
mov edx, dword [ebp - 0x214]
push eax
lea ecx, [ebp - 0x178]
call fcn.00479850
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x12
call fcn.00402696
mov eax, dword [ebp - 0x174]
mov ecx, dword [ebp - 0x178]
sub eax, ecx
push 0x1c
cdq
pop esi
idiv esi
cmp eax, 2
jne 0x40c1e1
lea eax, [ecx + 0x1c]
push eax
push ecx
lea eax, [ebp - 0x1f4]
push eax
call fcn.00413d1e
add esp, 0xc
push eax
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 0x13
call fcn.00414185
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x234]
call fcn.00413f56
push ebx
push 1
lea ecx, [ebp - 0x1d8]
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x1f4]
call fcn.00402696
lea esi, [ebp - 0x178]
mov byte [ebp - 4], 0xf
call fcn.0040ab0a
add dword [ebp - 0x214], 0x1c
mov eax, dword [ebp - 0x214]
cmp eax, dword [ebp - 0x254]
jne 0x40c122
mov eax, dword [ebp - 0x268]
mov dword [ebp - 0x214], eax
jmp 0x40c2f5
push 1
push 0x629ed0
lea ecx, [ebp - 0x14c]
mov dword [ebp - 0x138], edi
mov dword [ebp - 0x13c], ebx
mov byte [ebp - 0x14c], bl
call fcn.004022cd
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0x14
mov edx, dword [ebp - 0x214]
push eax
lea ecx, [ebp - 0x178]
call fcn.00479850
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0x16
call fcn.00402696
mov eax, dword [ebp - 0x174]
mov ecx, dword [ebp - 0x178]
sub eax, ecx
push 0x1c
cdq
pop esi
idiv esi
cmp eax, 2
jne 0x40c2d9
lea eax, [ecx + 0x1c]
push eax
push ecx
lea eax, [ebp - 0x1f4]
push eax
call fcn.00413d1e
add esp, 0xc
push eax
lea ecx, [ebp - 0x244]
mov byte [ebp - 4], 0x17
call fcn.00414185
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x244]
call fcn.00413f56
push ebx
push 1
lea ecx, [ebp - 0x1d8]
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x1f4]
call fcn.00402696
lea esi, [ebp - 0x178]
mov byte [ebp - 4], 0xf
call fcn.0040ab0a
add dword [ebp - 0x214], 0x1c
mov eax, dword [ebp - 0x214]
cmp eax, dword [ebp - 0x264]
jne 0x40c21a
mov eax, dword [ebp - 0x240]
mov esi, dword [eax]
mov dword [ebp - 0x214], esi
cmp esi, eax
je 0x40c3a5
lea eax, [esi + 0xc]
lea ecx, [eax + 0x1c]
push ecx
push eax
lea edi, [ebp - 0x168]
call fcn.00413d52
pop ecx
pop ecx
push eax
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 0x18
call fcn.00414185
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x234]
call fcn.00413f56
push ebx
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 4], 0xf
call fcn.00402696
push ebx
push 1
mov ecx, edi
call fcn.00402696
cmp byte [ebp - 0x21c], bl
jne 0x40c388
mov ecx, dword [ebp - 0x220]
push 0xffffffffffffffff
lea eax, [esi + 0x28]
push ebx
add ecx, 0x28
push eax
call fcn.004025f3
lea eax, [ebp - 0x214]
call fcn.004137ea
mov esi, dword [ebp - 0x214]
cmp esi, dword [ebp - 0x240]
jne 0x40c317
lea eax, [ebp - 0x304]
push eax
call fcn.004042f5
lea eax, [ebp - 0x304]
push eax
lea ecx, [ebp - 0x1bc]
mov byte [ebp - 4], 0x19
call fcn.00413dc5
pop ecx
cmp dword [ebp - 0x22c], ebx
jbe 0x40c3e3
lea eax, [ebp - 0x304]
push 0x629ec8
push eax
call fcn.00404def
pop ecx
pop ecx
mov eax, dword [ebp - 0x230]
mov ecx, dword [eax]
mov dword [ebp - 0x214], ecx
cmp ecx, eax
je 0x40c45c
mov ecx, dword [ebp - 0x214]
cmp ecx, dword [eax]
je 0x40c412
lea eax, [ebp - 0x304]
push 0x629ecc
push eax
call fcn.00404def
pop ecx
pop ecx
mov ecx, dword [ebp - 0x214]
add ecx, 0xc
push 0x629ed0
push ecx
lea eax, [ebp - 0x304]
push eax
lea esi, [ecx + 0x1c]
call fcn.00413dc5
pop ecx
pop ecx
push eax
call fcn.00404def
push eax
mov ecx, esi
call fcn.00413dc5
add esp, 0xc
lea eax, [ebp - 0x214]
call fcn.004137ea
mov eax, dword [ebp - 0x230]
cmp dword [ebp - 0x214], eax
jne 0x40c3f5
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x304]
call fcn.004043b0
cmp dword [ebp - 0x11c], 0x10
mov esi, dword [ebp - 0x130]
jae 0x40c483
lea esi, [ebp - 0x130]
cmp dword [eax + 0x14], 0x10
jb 0x40c48b
mov eax, dword [eax]
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x40c4ab
cmp cl, bl
je 0x40c4a7
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x40c4ab
add eax, 2
add esi, 2
cmp cl, bl
jne 0x40c48b
xor eax, eax
jmp 0x40c4b0
sbb eax, eax
sbb eax, 0xffffffff
push ebx
cmp eax, ebx
push 1
lea ecx, [ebp - 0x14c]
setne byte [ebp - 0x215]
call fcn.00402696
cmp byte [ebp - 0x215], bl
je 0x40c5a6
push ebx
lea eax, [ebp - 0x21c]
push eax
push ebx
push dword [ebp - 0x224]
mov dword [ebp - 0x21c], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x224]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
lea eax, [ebp - 0x1d8]
push eax
lea ecx, [ebp - 0x304]
call fcn.004043b0
mov esi, eax
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x304]
mov byte [ebp - 4], 0x1a
call fcn.004043b0
cmp dword [eax + 0x14], 0x10
mov esi, dword [esi + 0x10]
jb 0x40c52f
mov eax, dword [eax]
push ebx
lea ecx, [ebp - 0x248]
push ecx
push esi
push eax
push dword [ebp - 0x224]
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
sbb al, al
push ebx
inc al
push 1
lea ecx, [ebp - 0x14c]
mov byte [ebp - 0x215], al
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x1d8]
mov byte [ebp - 4], 0x19
call fcn.00402696
cmp byte [ebp - 0x215], bl
je 0x40c5a6
lea eax, [ebp - 0x114]
push eax
push 0x629ed4
push 0x110
push 3
push dword [0x6686d0]
mov ebx, str.CUpdateThread::UpdateInstalled
mov edi, str.UpdateThread.cpp
call fcn.004169e0
add esp, 0x14
xor ebx, ebx
lea eax, [ebp - 0x304]
mov byte [ebp - 4], 0xf
call fcn.004041cb
mov byte [ebp - 4], 0x1b
mov edi, dword [ebp - 0x240]
mov eax, dword [edi]
mov dword [ebp - 0x214], eax
cmp eax, eax
jne 0x40c5fb
push dword [edi + 4]
lea ecx, [ebp - 0x244]
call fcn.00413c56
mov eax, dword [ebp - 0x240]
mov dword [eax + 4], eax
mov eax, dword [ebp - 0x240]
mov dword [eax], eax
mov eax, dword [ebp - 0x240]
mov dword [eax + 8], eax
mov dword [ebp - 0x23c], ebx
jmp 0x40c62c
cmp eax, edi
je 0x40c62c
mov esi, dword [ebp - 0x214]
lea eax, [ebp - 0x214]
call fcn.004137ea
push esi
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x244]
push eax
call fcn.00413953
cmp dword [ebp - 0x214], edi
jne 0x40c5ff
push dword [ebp - 0x240]
call fcn.004ba2af
pop ecx
mov byte [ebp - 4], 0x1c
mov eax, dword [ebp - 0x230]
push dword [eax + 4]
lea ecx, [ebp - 0x234]
call fcn.00413c56
mov eax, dword [ebp - 0x230]
mov dword [eax + 4], eax
mov eax, dword [ebp - 0x230]
mov dword [eax], eax
mov eax, dword [ebp - 0x230]
mov dword [eax + 8], eax
push dword [ebp - 0x230]
mov dword [ebp - 0x22c], ebx
call fcn.004ba2af
pop ecx
lea esi, [ebp - 0x268]
call fcn.0040ab0a
lea esi, [ebp - 0x258]
call fcn.0040ab0a
push ebx
push 1
lea ecx, [ebp - 0x1a0]
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x210]
call fcn.00402696
push ebx
push 1
lea ecx, [ebp - 0x1bc]
call fcn.00402696
jmp 0x40c6eb
lea eax, [ebp - 0x114]
push eax
push str.ReadFile__s_Failed
push 0x116
push 3
push dword [0x6686d0]
mov ebx, str.CUpdateThread::UpdateInstalled
mov edi, str.UpdateThread.cpp
call fcn.004169e0
add esp, 0x14
xor ebx, ebx
push ebx
push 1
lea ecx, [ebp - 0x130]
call fcn.00402696
jmp 0x40c725
lea eax, [ebp - 0x114]
push eax
push str.GetFileSize__s_Failed
push 0x11b
push edi
push dword [0x6686d0]
mov ebx, str.CUpdateThread::UpdateInstalled
mov edi, str.UpdateThread.cpp
call fcn.004169e0
add esp, 0x14
push dword [ebp - 0x224]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c75d
lea eax, [ebp - 0x114]
push eax
push str.CreateFile__s_Failed
push 0x121
push edi
push dword [0x6686d0]
mov ebx, str.CUpdateThread::UpdateInstalled
mov edi, str.UpdateThread.cpp
call fcn.004169e0
add esp, 0x14
call fcn.005c5eaa
ret 4