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

Disassembly:
sub esp, 0x98
mov eax, dword [0x45bb34]
push ebx
push ebp
push esi
push edi
xor edi, edi
mov dword [esp + 0xa4], eax
mov dword [esp + 0x10], edi
call fcn.0040b5d0
mov dword [esp + 0x14], eax
call fcn.0040b5d0
mov dword [esp + 0x24], eax
call fcn.0040b5d0
mov ebx, dword [esp + 0xac]
mov eax, dword [ebx + 0x14c]
mov edx, dword [ebx + 0x154]
mov esi, dword [esp + 0xb8]
mov dword [esp + 0x34], edi
mov dword [esp + 0x1c], edi
mov eax, dword [eax + 0x2a]
lea ecx, [eax + eax*4]
xor ebp, ebp
test esi, 0x200
lea eax, [edx + ecx*4]
mov dword [esp + 0x38], 0xffffffff
mov dword [esp + 0x3c], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], eax
je 0x40c74d
mov eax, 8
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
test esi, 0x100
je 0x40c791
mov eax, dword [esp + 0xc0]
cmp eax, edi
jne 0x40c76f
mov eax, dword [0x458920]
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], eax
jmp 0x40c791
cmp eax, 1
jne 0x40c791
mov eax, dword [esp + 0xbc]
mov ecx, dword [eax*4 + 0x458930]
mov edx, dword [eax*4 + 0x458924]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x38], edx
mov ecx, dword [esp + 0xb0]
lea eax, [esp + 0x34]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 4
mov dword [esp + 0x18], eax
jae 0x40c7ba
and esi, 0xfffcffff
mov dword [esp + 0xb8], esi
cmp eax, 0x20
jae 0x40c7cc
and esi, 0xffff00ff
mov dword [esp + 0xb8], esi
cmp dword [esp + 0x34], edi
je 0x40c7df
mov dword [esp + 0x10], 0x503
jmp 0x40cbbb
mov esi, dword [esp + 0xb4]
mov eax, esi
lea edx, [eax + 1]
jmp 0x40c7f0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c7f0
sub eax, edx
add eax, 0x50
push eax
call fcn.0042a10c
mov ebp, eax
add esp, 4
cmp ebp, edi
jne 0x40c818
mov dword [esp + 0x10], 8
jmp 0x40cbbb
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40c820
sub eax, edx
lea ecx, [eax + 0x50]
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
xor eax, eax
mov ecx, 0x14
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, ebp
sub ecx, esi
mov eax, esi
lea edx, [ecx + 0x4c]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40c852
push esi
push ebx
mov dword [ebp + 4], ebx
call fcn.0040f170
add esp, 8
test eax, eax
mov dword [ebp + 8], eax
je 0x40c8a8
mov ecx, dword [esp + 0xb8]
test ecx, ecx
js 0x40c88c
mov dword [esp + 0x10], 0xb7
mov dword [ebp + 8], 0
jmp 0x40c8c1
mov eax, dword [eax + 8]
lea edx, [eax + eax*4]
mov eax, dword [ebx + 0x154]
lea ecx, [eax + edx*4]
mov dword [ebp + 0xc], ecx
mov dword [esp + 0x3c], 1
jmp 0x40c8c1
push esi
push ebx
call fcn.0040f230
add esp, 8
test eax, eax
mov dword [ebp + 8], eax
jne 0x40c8c1
mov dword [esp + 0x10], 0x27
mov edx, dword [ebx + 0x150]
mov ecx, dword [ebp + 8]
sub ecx, edx
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp + 0x44], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40cbbb
mov eax, dword [ebx + 0x14c]
mov ecx, dword [eax + 0x2a]
mov edi, dword [eax + 0x1e]
lea ecx, [ecx + ecx*4]
shl ecx, 2
xor edx, edx
add ecx, edi
adc edx, dword [eax + 0x22]
mov edi, dword [esp + 0x2c]
mov dword [ebp + 0x20], ecx
mov dword [ebp + 0x24], edx
mov eax, dword [ebx + 0x154]
cmp eax, edi
jae 0x40c94e
mov ecx, dword [eax + 0x10]
test ecx, ecx
jns 0x40c93d
mov edx, dword [eax + 8]
xor ecx, ecx
add edx, dword [eax]
adc ecx, dword [eax + 4]
cmp ecx, dword [ebp + 0x24]
jl 0x40c947
jg 0x40c935
cmp edx, dword [ebp + 0x20]
jbe 0x40c947
mov dword [ebp + 0x20], edx
mov dword [ebp + 0x24], ecx
jmp 0x40c947
mov ecx, dword [ebp + 0xc]
test ecx, ecx
jne 0x40c947
mov dword [ebp + 0xc], eax
add eax, 0x14
cmp eax, edi
jb 0x40c918
mov ecx, dword [ebx + 0x110]
mov edx, dword [ebp + 0x20]
mov edi, dword [ebp + 0x24]
add ecx, edx
mov edx, dword [ebx + 0x114]
mov dword [ebp + 0x18], ecx
mov ecx, dword [ebp + 0xc]
adc edx, edi
test ecx, ecx
mov dword [ebp + 0x1c], edx
jne 0x40c974
mov dword [ebp + 0xc], eax
mov eax, dword [ebx + 0x154]
mov ecx, dword [ebp + 0xc]
sub ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp + 0x48], eax
mov ecx, dword [ebx + 0x14c]
cmp eax, dword [ecx + 0x26]
jb 0x40c9ab
mov dword [esp + 0x10], 0x27
jmp 0x40cbbb
mov edi, dword [esp + 0xb8]
test edi, 0x20000
je 0x40c9f0
push 0x5c
push esi
call fcn.0042ba70
add esp, 8
test eax, eax
je 0x40c9cc
lea esi, [eax + 1]
push esi
call fcn.0040f120
add esp, 4
test edi, 0x10000
mov dword [ebp + 0x10], eax
je 0x40c9f0
mov edx, dword [ebp + 0x20]
mov esi, dword [esp + 0x18]
add edx, eax
xor edx, esi
mov dword [ebp + 0x10], edx
jmp 0x40c9f4
mov esi, dword [esp + 0x18]
mov eax, dword [ebx + 0x190]
test eax, eax
je 0x40ca3c
mov eax, dword [eax + 8]
test eax, eax
je 0x40ca0e
mov ecx, dword [ebp + 0x48]
lea edx, [eax + ecx*4]
mov dword [ebp + 0x38], edx
mov eax, dword [ebx + 0x190]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x40ca24
mov ecx, dword [ebp + 0x48]
lea edx, [eax + ecx*8]
mov dword [ebp + 0x3c], edx
mov eax, dword [ebx + 0x190]
mov eax, dword [eax + 0x10]
test eax, eax
je 0x40ca3c
mov ecx, dword [ebp + 0x48]
shl ecx, 4
add ecx, eax
mov dword [ebp + 0x40], ecx
xor edx, edx
mov eax, esi
div dword [ebx + 0x138]
xor edx, edx
lea ecx, [eax + 1]
mov eax, esi
mov dword [ebp + 0x2c], ecx
div dword [ebx + 0x138]
test edx, edx
je 0x40ca5e
inc ecx
mov dword [ebp + 0x2c], ecx
mov edx, dword [ebx + 0x138]
push edx
call fcn.0042a10c
mov edi, eax
add esp, 4
test edi, edi
mov dword [ebp + 0x34], edi
jne 0x40ca80
mov dword [esp + 0x10], 8
jmp 0x40ca96
mov ecx, dword [ebx + 0x138]
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [ebp + 0x34]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40cbbb
mov eax, dword [esp + 0xb8]
test ah, 0xff
je 0x40cb3e
mov ecx, dword [ebp + 0x2c]
lea edx, [ecx*8 + 8]
push edx
call fcn.0042a10c
mov dword [ebp + 0x28], eax
mov eax, dword [ebx + 0x138]
shl eax, 1
push eax
call fcn.0042a10c
mov edi, dword [ebp + 0x28]
add esp, 8
test edi, edi
mov edx, eax
mov dword [esp + 0x20], edx
je 0x40caee
test edx, edx
jne 0x40caf6
mov dword [esp + 0x10], 8
test edi, edi
je 0x40cb14
mov ecx, dword [ebp + 0x2c]
lea ecx, [ecx*8 + 8]
mov esi, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
test edx, edx
je 0x40cb32
mov ecx, dword [ebx + 0x138]
shl ecx, 1
mov esi, ecx
shr ecx, 2
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0x28], edx
jne 0x40cbbb
mov ecx, dword [ebp + 0x18]
cmp ecx, dword [ebx + 0x128]
jne 0x40cb54
mov edx, dword [ebp + 0x1c]
cmp edx, dword [ebx + 0x12c]
je 0x40cb7d
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebx + 0x108]
push 0
lea eax, [ebp + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x18]
mov dword [ebx + 0x128], eax
mov ecx, dword [ebp + 0x1c]
mov dword [ebx + 0x12c], ecx
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x48]
mov dword [edx + 8], eax
mov edx, dword [ebp + 0x20]
mov ecx, dword [ebp + 0xc]
mov dword [ecx], edx
mov eax, dword [ebp + 0x24]
mov edx, dword [esp + 0x18]
mov dword [ecx + 4], eax
mov ecx, dword [ebp + 0xc]
mov dword [ecx + 0xc], edx
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0xb8]
mov dword [eax + 8], 0
mov edx, dword [ebp + 0xc]
or ecx, 0x80000000
mov dword [edx + 0x10], ecx
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0x30], 0
jne 0x40cf83
mov eax, dword [esp + 0xb8]
test ah, 0xff
je 0x40cc6a
mov esi, dword [ebp + 0x2c]
mov edi, dword [ebp + 0x28]
shl esi, 3
mov ecx, esi
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [ebp + 0x28]
push 0
lea ecx, [esp + 0x20]
push ecx
mov dword [eax], esi
mov edx, dword [ebp + 0x28]
mov eax, dword [ebx + 0x108]
push esi
push edx
push eax
mov dword [esp + 0x44], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebx + 0x128]
mov edi, dword [ebx + 0x12c]
mov edx, dword [ebx + 0x198]
add ecx, eax
adc edi, 0
or edx, 1
cmp eax, esi
mov dword [ebx + 0x128], ecx
mov dword [ebx + 0x12c], edi
mov dword [ebx + 0x198], edx
jne 0x40cc58
mov eax, dword [ebp + 0xc]
add dword [eax + 8], esi
jmp 0x40cc6a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
mov dword [esp + 0x10], eax
jne 0x40cf83
lea ecx, [esp + 0x2c]
push ecx
call fcn.00409c10
lea edx, [esp + 0x50]
push edx
call fcn.00409a00
mov ecx, dword [esp + 0xb8]
mov eax, dword [esp + 0x1c]
add esp, 8
xor edi, edi
push edi
push edi
push edi
push ecx
mov dword [esp + 0x54], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0x2c]
xor esi, esi
dec edx
mov dword [esp + 0x40], esi
je 0x40ce6d
lea esp, [esp]
mov eax, dword [ebx + 0x138]
mov edx, dword [ebp + 0x34]
push edi
lea ecx, [esp + 0x18]
push ecx
push eax
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0xbc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [esp + 0x14]
cmp edx, edi
je 0x40ce6d
cmp dword [ebp + 0x38], edi
je 0x40ccfa
mov ecx, dword [ebp + 0x34]
push edx
push ecx
lea edx, [esp + 0x34]
push edx
call fcn.00409c20
mov edx, dword [esp + 0x20]
add esp, 0xc
cmp dword [ebp + 0x40], edi
je 0x40cd15
mov eax, dword [ebp + 0x34]
push edx
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.00409a30
mov edx, dword [esp + 0x20]
add esp, 0xc
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 0x10]
test ah, 0xff
mov edi, edx
je 0x40cde0
mov eax, dword [ebx + 0x138]
shl eax, 1
mov dword [esp + 0x18], eax
mov dword [esp + 0x48], 0
test dword [ecx + 0x10], 0x200
je 0x40cd69
mov ecx, dword [ebp + 0x34]
push 0
lea eax, [esp + 0x4c]
push eax
mov eax, dword [esp + 0x28]
push edx
push ecx
lea edx, [esp + 0x28]
push edx
push eax
call fcn.0040f380
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x30]
add esp, 0x18
mov ecx, dword [ebp + 0xc]
test dword [ecx + 0x10], 0x100
je 0x40cda0
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x44]
push eax
push 0
push ecx
mov ecx, dword [esp + 0x2c]
push edx
mov edx, dword [ebp + 0x34]
push edx
lea eax, [esp + 0x2c]
push eax
push ecx
call fcn.0040f980
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
add esp, 0x1c
cmp eax, edx
jl 0x40cdc3
mov esi, dword [ebp + 0x34]
mov edi, dword [esp + 0x20]
mov ecx, edx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x40]
mov dword [esp + 0x18], eax
mov ecx, dword [ebp + 0x28]
lea ecx, [ecx + esi*8]
mov edi, eax
xor edx, edx
add eax, dword [ecx]
adc edx, dword [ecx + 4]
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x24]
mov dword [ecx + 0xc], edx
mov dword [esp + 0x44], eax
mov ecx, dword [ebp + 0xc]
test dword [ecx + 0x10], 0x20000
je 0x40ce00
mov edx, dword [ebp + 0x10]
mov eax, dword [esp + 0x28]
add edx, esi
push edx
push edi
push eax
call fcn.0040ef60
add esp, 0xc
mov edx, dword [esp + 0x28]
mov eax, dword [ebx + 0x108]
push 0
lea ecx, [esp + 0x20]
push ecx
push edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x1c]
cmp ecx, edi
jne 0x40ce63
mov edx, dword [ebx + 0x128]
mov eax, dword [ebx + 0x12c]
add edx, ecx
mov dword [ebx + 0x128], edx
mov edi, 0
adc eax, edi
mov dword [ebx + 0x12c], eax
mov eax, dword [ebp + 0xc]
add dword [eax + 8], ecx
or dword [ebx + 0x198], 1
mov ecx, dword [ebp + 0x2c]
inc esi
dec ecx
cmp esi, ecx
mov dword [esp + 0x40], esi
jb 0x40ccb0
jmp 0x40ce6d
mov dword [esp + 0x10], 0x70
xor edi, edi
mov eax, dword [ebp + 0x38]
cmp eax, edi
je 0x40ce82
push eax
lea edx, [esp + 0x30]
push edx
call fcn.00409c60
add esp, 8
mov eax, dword [ebp + 0x40]
cmp eax, edi
je 0x40ce97
push eax
lea eax, [esp + 0x50]
push eax
call fcn.00409b00
add esp, 8
cmp dword [esp + 0x10], edi
jne 0x40cf83
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 0x10]
test ah, 0xff
je 0x40cf31
test dword [esp + 0xb8], 0x20000
mov esi, dword [esp + 0x30]
je 0x40ced3
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x28]
dec edx
push edx
push esi
push eax
call fcn.0040ef60
add esp, 0xc
mov edx, dword [ebp + 0x18]
mov eax, dword [ebx + 0x108]
push edi
lea ecx, [ebp + 0x1c]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0x28]
mov eax, dword [ebx + 0x108]
push edi
lea ecx, [esp + 0x20]
push ecx
push esi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x1c]
cmp eax, esi
je 0x40cf11
mov dword [esp + 0x10], 0x70
mov esi, dword [ebp + 0x18]
mov edx, dword [ebp + 0x1c]
xor ecx, ecx
add eax, esi
mov dword [ebx + 0x128], eax
mov eax, dword [esp + 0x10]
adc ecx, edx
cmp eax, edi
mov dword [ebx + 0x12c], ecx
jne 0x40cf83
mov eax, dword [ebx + 0x14c]
mov dword [ebx + 0x13c], edi
mov dword [ebx + 0x140], edi
mov dword [ebx + 0x148], edi
mov edx, dword [ebp + 0x48]
mov ecx, dword [eax + 0x2a]
cmp edx, ecx
jb 0x40cf57
inc ecx
mov dword [eax + 0x2a], ecx
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
mov esi, dword [ebp + 0x20]
mov edx, dword [ebp + 0x24]
xor ecx, ecx
add eax, esi
adc ecx, edx
mov edx, dword [ebx + 0x14c]
mov dword [ebx + 0x130], eax
mov dword [ebx + 0x134], ecx
mov dword [edx + 8], eax
mov dword [edx + 0xc], ecx
jmp 0x40cf9b
xor edi, edi
cmp ebp, edi
je 0x40cf9b
mov eax, dword [ebp + 8]
cmp eax, edi
je 0x40cf9b
or ecx, 0xffffffff
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov eax, dword [esp + 0x20]
cmp eax, edi
je 0x40cfac
push eax
call fcn.0042a11e
add esp, 4
mov eax, dword [esp + 0xc4]
cmp eax, edi
je 0x40cfbd
mov edx, dword [esp + 0x3c]
mov dword [eax], edx
cmp ebp, edi
je 0x40cfff
mov eax, dword [ebp]
cmp eax, 0xffffffff
je 0x40cfd0
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp + 0x28]
cmp eax, edi
je 0x40cfe3
push eax
call fcn.0042a11e
add esp, 4
mov dword [ebp + 0x28], edi
mov eax, dword [ebp + 0x34]
cmp eax, edi
je 0x40cff6
push eax
call fcn.0042a11e
add esp, 4
mov dword [ebp + 0x34], edi
push ebp
call fcn.0042a11e
add esp, 4
mov ecx, dword [esp + 0xa4]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
call fcn.004296f9
add esp, 0x98
ret