Function at 0x40c8b0
Capabilities:
Get file size
Write file on windows

Disassembly:
sub esp, 0x6a4
mov eax, dword [0x4727f0]
xor eax, esp
mov dword [esp + 0x6a0], eax
push ebx
mov ebx, dword [esp + 0x6b0]
push ebp
mov ebp, dword [esp + 0x6bc]
push esi
mov esi, dword [esp + 0x6b4]
push edi
mov edi, dword [esp + 0x6c0]
push 0
lea eax, [esp + 0x20]
push eax
push esi
mov edx, edi
mov dword [esp + 0x34], ecx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x28], 0
call fcn.00410ea0
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
mov edx, edi
mov dword [esp + 0x24], 0
call fcn.00410e20
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
xor ecx, ecx
cmp esi, eax
lea edx, [ecx + 4]
jbe 0x40c948
mov eax, esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041a861
mov esi, eax
mov dword [esp + 0x18], esi
jmp 0x40c95d
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041a861
mov dword [esp + 0x18], eax
mov esi, eax
add esp, 4
cmp dword [esp + 0x18], 0
jbe 0x40cca3
mov ecx, dword [esp + 0x6b8]
push esi
lea eax, [esp + 0x1c]
push eax
push ecx
mov edx, edi
call fcn.00410e20
cmp dword [esp + 0x18], 0
mov dword [esp + 0x2c], 0
jbe 0x40cca3
mov edx, dword [esp + 0x28]
mov eax, dword [edx + 0xd4]
cmp eax, 1
je 0x40ccfb
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x2c]
add dword [ebx], 1
mov ebx, dword [esi + ecx*4]
mov eax, edi
call fcn.0040fc50
cmp eax, 0xffffffff
mov dword [esp + 0x34], eax
jne 0x40c9e6
mov ecx, dword [0x476eec]
mov ebx, str.ItemNotExistInCPK
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
jmp 0x40cc8a
push 1
push 0
mov ecx, edi
call fcn.0040fd80
mov esi, eax
test esi, esi
jne 0x40ca15
mov ecx, dword [0x476eec]
mov ebx, str.FailInOpenCPKItem
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
jmp 0x40cc86
push 0x144
lea edx, [esp + 0x48]
push 0
push edx
call fcn.00440c10
add esp, 0xc
push 0x144
lea eax, [esp + 0x420]
push 0
push eax
call fcn.00440c10
add esp, 0xc
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x420]
push edx
mov edi, esi
call fcn.0040fcc0
test eax, eax
jne 0x40ca71
mov ecx, dword [0x476eec]
mov ebx, str.FailInCheckCPKFile
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
xor ebx, ebx
xor edi, edi
cmp byte [esp + 0x44], 0
mov dword [esp + 0x10], ebx
je 0x40caf7
mov eax, 1
lea ecx, [esp + 0x44]
sub eax, ecx
mov dword [esp + 0x30], eax
cmp byte [esp + ebx + 0x44], 0x5c
jne 0x40caed
test ebx, ebx
jle 0x40caed
push 0x144
lea edx, [esp + 0x2d8]
push 0
push edx
call fcn.00440c10
add esp, 0xc
mov eax, ebx
sub eax, edi
push eax
lea ecx, [esp + edi + 0x48]
push ecx
lea edx, [esp + 0x2dc]
push edx
call fcn.0043ec80
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
lea ecx, [esp + 0x2d8]
mov edi, ebp
call fcn.004106b0
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x10], eax
lea eax, [esp + ebx + 0x44]
lea edi, [ecx + eax]
add ebx, 1
cmp byte [esp + ebx + 0x44], 0
jne 0x40ca8f
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x1cc]
mov ecx, dword [esp + 0x34]
lea edx, [ecx*8]
sub edx, ecx
mov ecx, dword [eax + edx*4 + 0x18]
add ecx, dword [eax + edx*4 + 0x10]
lea eax, [eax + edx*4]
mov eax, dword [esi + 0x104]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x10]
push eax
push ecx
lea ecx, [esp + 0x4c]
mov edi, ebp
call fcn.004102a0
lea ecx, [eax*8]
sub ecx, eax
add ecx, ecx
xor edi, edi
add ecx, ecx
mov dword [esp + 0x40], eax
mov dword [esp + 0x38], ecx
jmp 0x40cb50
mov edx, dword [esi + 0x118]
mov eax, dword [esi + 0x10c]
mov dword [esp + 0x30], edx
mov edx, dword [ebp + 0x1cc]
mov ebx, dword [ecx + edx + 0xc]
push 0
push 0
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x148]
add ebx, edi
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x148]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp ebx, eax
jb 0x40cba2
mov ecx, dword [ebp + 0x148]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
mov eax, dword [ebp + 0x148]
push 0
push 0x48700c
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
mov dword [0x487010], eax
je 0x40cd0c
add edi, dword [esi + 0x118]
cmp dword [esi + 0x108], 0
je 0x40cc27
cmp dword [esi + 0x124], 0
je 0x40cc05
cmp dword [esi + 0x11c], 0
jbe 0x40cc05
mov eax, dword [esi + 0x114]
cmp dword [esi + 0x10c], eax
je 0x40cc05
push eax
call fcn.0043f1dc
add esp, 4
mov eax, dword [esi + 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
jne 0x40cc1e
mov dword [esi + 0x128], eax
jmp 0x40cc27
push esi
call fcn.0043f1dc
add esp, 4
cmp edi, dword [esp + 0x3c]
jae 0x40cc50
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x20]
push 0
push edi
call fcn.0040fd80
mov ecx, dword [esp + 0x38]
mov esi, eax
jmp 0x40cb50
mov edi, dword [esp + 0x40]
mov esi, ebp
call fcn.00410410
mov edx, dword [esp + 0x24]
mov eax, dword [edx]
mov ecx, dword [esp + 0x28]
imul eax, eax, 0x64
xor edx, edx
div dword [ecx + 0xd0]
push 0
push eax
mov eax, dword [ecx + 0x64]
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x24]
add eax, 1
cmp eax, dword [esp + 0x18]
mov dword [esp + 0x2c], eax
jb 0x40c993
cmp dword [esp + 0x1c], 0
jbe 0x40ccce
mov edx, dword [esp + 0x6b8]
push esi
lea ecx, [esp + 0x20]
push ecx
push edx
mov edx, edi
call fcn.00410ea0
cmp dword [esp + 0x1c], 0
mov dword [esp + 0x10], 0
ja 0x40cd34
test esi, esi
je 0x40ccdb
push esi
call fcn.0041a866
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x6b0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043d963
add esp, 0x6a4
ret 0x10
test esi, esi
je 0x40cd08
push esi
call fcn.0041a866
add esp, 4
xor eax, eax
jmp 0x40cce0
mov ecx, dword [0x476eec]
mov ebx, str.FailInWriteToCPK
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
xor eax, eax
jmp 0x40cce0
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 0xd4]
cmp ecx, 1
je 0x40ccfb
mov edx, dword [esp + 0x10]
add dword [ebx], 1
mov ebx, dword [esi + edx*4]
mov eax, edi
call fcn.0040fc50
cmp eax, 0xffffffff
jne 0x40cd77
mov ecx, dword [0x476eec]
mov ebx, str.ItemNotExistInCPK
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
jmp 0x40ce9d
push 0
push 0
mov ecx, edi
call fcn.0040fd80
mov esi, eax
test esi, esi
jne 0x40cda6
mov ecx, dword [0x476eec]
mov ebx, str.FailInOpenCPKItem
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
jmp 0x40ce99
push 0x144
lea eax, [esp + 0x190]
push 0
push eax
call fcn.00440c10
add esp, 0xc
push 0x144
lea ecx, [esp + 0x568]
push 0
push ecx
call fcn.00440c10
add esp, 0xc
lea edx, [esp + 0x18c]
push edx
lea eax, [esp + 0x568]
push eax
mov edi, esi
call fcn.0040fcc0
mov edi, eax
test edi, edi
jne 0x40ce0a
mov ecx, dword [0x476eec]
mov ebx, str.FailInCheckCPKFile
call fcn.004187b0
push eax
call fcn.004059c0
add esp, 4
cmp edi, 1
jne 0x40ce1d
lea ecx, [esp + 0x18c]
push ecx
push ebp
call fcn.00410870
cmp dword [esi + 0x108], 0
je 0x40ce71
cmp dword [esi + 0x124], 0
je 0x40ce4f
cmp dword [esi + 0x11c], 0
jbe 0x40ce4f
mov eax, dword [esi + 0x114]
cmp dword [esi + 0x10c], eax
je 0x40ce4f
push eax
call fcn.0043f1dc
add esp, 4
mov eax, dword [esi + 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
jne 0x40ce68
mov dword [esi + 0x128], eax
jmp 0x40ce71
push esi
call fcn.0043f1dc
add esp, 4
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
push ebp
push edx
mov edx, dword [esp + 0x18]
push eax
mov eax, dword [ecx + edx*4]
mov ecx, dword [esp + 0x34]
push eax
call fcn.0040c8b0
test eax, eax
je 0x40ceb7
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
add eax, 1
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x10], eax
jb 0x40cd30
jmp 0x40ccce
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40cd08
push eax
call fcn.0041a866
add esp, 4
xor eax, eax
jmp 0x40cce0