Function at 0x40cc40
Capabilities:
Get file size
Read file on windows
Set file attributes
Timestomp file
Write file on windows

Disassembly:
sub esp, 0x328
lea eax, [esp + 0x120]
push ebx
mov ebx, ecx
push ebp
push esi
lea esi, [ebx + 0x18a48]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
push eax
call edi
push 1
mov ecx, ebx
call fcn.0040e960
test eax, eax
jne 0x40cc7d
push 2
mov ecx, ebx
call fcn.0040e960
test eax, eax
je 0x40cc92
lea ecx, [ebx + 0x18b4c]
lea edx, [esp + 0x130]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [ebx + 0x25868]
xor ebp, ebp
cmp eax, ebp
jl 0x40cf31
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x40cf31
cmp dword [ebx + 0x25888], 0x64
jne 0x40ccc0
mov dword [ebx + 0x25888], ebp
lea eax, [esp + 0x130]
lea ecx, [esp + 0x234]
push eax
push ecx
call edi
mov edx, dword [ebx + 0x25868]
mov eax, dword [ebx + 0x2587c]
cmp edx, eax
jge 0x40ccf1
mov dword [ebx + 0x5c901c], 0xe
jmp 0x40ce3c
mov eax, dword [ebx + 0x1dda4]
mov dword [esp + 0x14], ebp
cmp eax, ebp
jl 0x40cda9
mov ecx, eax
shl ecx, 6
add ecx, eax
lea ecx, [ecx + ecx*2]
lea ecx, [ecx + ecx*4]
shl ecx, 2
sub ecx, eax
lea ecx, [ebx + ecx*8 + 0x5380c0]
cmp dword [ecx], ebp
jne 0x40cd2d
dec eax
sub ecx, 0x79d8
cmp eax, ebp
jge 0x40cd1c
jmp 0x40cda9
cmp eax, ebp
jl 0x40cda9
mov ecx, eax
shl ecx, 6
add ecx, eax
lea ecx, [ecx + ecx*2]
lea edx, [ecx + ecx*4]
shl edx, 2
sub edx, eax
mov eax, dword [ebx + edx*8 + 0x5380c0]
mov esi, dword [eax + 0x7d4]
lea ebp, [ebx + edx*8 + 0x5306ec]
test esi, esi
jl 0x40cda9
lea edi, [esi + esi*8]
shl edi, 3
sub edi, esi
shl edi, 5
mov ecx, dword [ebp + 0x79d4]
mov edx, dword [ebx + 0x2587c]
lea eax, [edi + ecx]
mov ecx, dword [ebx + edx*4 + 0x51b138]
cmp ecx, dword [eax + 0x57d8]
jne 0x40cd94
add eax, 0x5fac
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x40cda1
dec esi
sub edi, 0x8e0
test esi, esi
jge 0x40cd66
jmp 0x40cda9
mov dword [esp + 0x14], 1
mov eax, dword [ebx + 0x2587c]
mov edx, eax
shl edx, 6
add edx, eax
lea eax, [ebx + edx*4 + 0x258b8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
dec eax
js 0x40ce0e
mov ecx, dword [ebx + 0x2587c]
mov edx, ecx
shl edx, 6
add edx, ecx
lea ecx, [eax + edx*4]
lea ebp, [ecx + ebx + 0x258b8]
mov ecx, 1
mov edi, 0x41a23c
mov esi, ebp
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x40cdf5
sbb edx, edx
sbb edx, 0xffffffff
test edx, edx
jne 0x40ce08
cmp dword [esp + 0x14], 1
je 0x40ce0e
mov dword [esp + 0x14], 1
dec eax
dec ebp
test eax, eax
jge 0x40cdde
mov ecx, dword [ebx + 0x2587c]
mov edx, ecx
shl edx, 6
add edx, ecx
lea eax, [eax + edx*4]
lea edx, [esp + 0x234]
lea ecx, [eax + ebx + 0x258b9]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor ebp, ebp
mov eax, dword [ebx + 0x5c901c]
xor esi, esi
cmp eax, 0xa
mov dword [esp + 0x10], ebp
je 0x40d053
cmp eax, 0xb
je 0x40d053
cmp eax, 0xc
je 0x40d053
cmp eax, 0xd
jne 0x40d009
mov eax, dword [ebx + 0x1de88]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebx + 0x25870]
mov ebp, eax
shl ecx, 0x14
mov esi, ebp
sub esi, ecx
cmp esi, 0x100000
jbe 0x40ce96
mov esi, 0x100000
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, dword [ebx + 0x1de88]
mov edi, eax
test edi, edi
je 0x40d114
lea ecx, [esp + 0x10]
push 0
push ecx
push esi
push edi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40cee6
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [ebx + 0x1de88]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [ebx + 0x1de8c]
push ecx
jmp 0x40cf21
mov eax, dword [ebx + 0x1de8c]
lea edx, [esp + 0x10]
push 0
push edx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
push edi
test eax, eax
jne 0x40cf3e
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [ebx + 0x1de88]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [ebx + 0x1de8c]
push edx
call esi
xor eax, eax
mov dword [ebx + 0x1de88], eax
mov dword [ebx + 0x1de8c], eax
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x328
ret
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [ebx + 0x25870]
mov edx, ebp
mov ecx, eax
shl ecx, 0x14
sub edx, ecx
cmp edx, 0x100000
ja 0x40d218
lea eax, [esp + 0x14]
lea ecx, [esp + 0x24]
push eax
mov eax, dword [ebx + 0x1de88]
lea edx, [esp + 0x20]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileTime]
lea ecx, [esp + 0x14]
lea edx, [esp + 0x24]
push ecx
mov ecx, dword [ebx + 0x1de8c]
lea eax, [esp + 0x20]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov edx, dword [ebx + 0x1de88]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [ebx + 0x1de8c]
push eax
call edi
xor eax, eax
mov dword [ebx + 0x1de88], eax
mov dword [ebx + 0x1de8c], eax
mov eax, dword [ebx + 0x2587c]
mov ecx, eax
shl ecx, 6
add ecx, eax
lea eax, [esp + 0x2c]
lea edx, [ebx + ecx*4 + 0x258b8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x2c]
push 0x80
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov eax, dword [ebx + 0x2587c]
mov dword [ebx + 0x5c901c], 0xa
inc eax
mov dword [ebx + 0x2587c], eax
jmp 0x40d21f
cmp eax, 0xe
je 0x40d21f
mov eax, dword [ebx + 0x1de88]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40d02f
push eax
call esi
mov dword [ebx + 0x1de88], 0
mov eax, dword [ebx + 0x1de8c]
test eax, eax
je 0x40d046
push eax
call esi
mov dword [ebx + 0x1de8c], 0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x328
ret
mov eax, dword [ebx + 0x2587c]
lea ecx, [esp + 0x2c]
mov edx, eax
shl edx, 6
add edx, eax
lea eax, [ebx + edx*4 + 0x258b8]
push eax
push ecx
call edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 1
push 3
push 0
push 0
lea edx, [esp + 0x40]
push 0x80000000
push edx
call edi
cmp eax, 0xffffffff
mov dword [ebx + 0x1de88], eax
je 0x40cf31
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
mov esi, 0x100000
cmp ebp, 0x100000
ja 0x40d0b4
mov esi, ebp
push 0
push 0x80
push 2
push 0
push 0
lea eax, [esp + 0x248]
push 0x40000000
push eax
call edi
cmp eax, 0xffffffff
mov dword [ebx + 0x1de8c], eax
jne 0x40d0ff
mov ecx, dword [ebx + 0x1de88]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov dword [ebx + 0x1de88], 0
pop ebp
xor eax, eax
pop ebx
add esp, 0x328
ret
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, dword [ebx + 0x1de88]
mov edi, eax
test edi, edi
jne 0x40d129
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [ebx + 0x1de8c]
push eax
jmp 0x40cf21
lea ecx, [esp + 0x10]
push 0
push ecx
push esi
push edi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40d163
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [ebx + 0x1de88]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [ebx + 0x1de8c]
push ecx
jmp 0x40cf21
mov eax, dword [ebx + 0x1de8c]
lea edx, [esp + 0x10]
push 0
push edx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
push edi
test eax, eax
je 0x40cf05
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, ebp
sub eax, esi
jne 0x40d208
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x24]
push ecx
mov ecx, dword [ebx + 0x1de88]
lea eax, [esp + 0x18]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
lea edx, [esp + 0x1c]
lea eax, [esp + 0x24]
push edx
mov edx, dword [ebx + 0x1de8c]
lea ecx, [esp + 0x18]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov eax, dword [ebx + 0x1de88]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
mov ecx, dword [ebx + 0x1de8c]
push ecx
call edi
lea edx, [esp + 0x2c]
xor eax, eax
push 0x80
push edx
mov dword [ebx + 0x1de88], eax
mov dword [ebx + 0x1de8c], eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
inc dword [ebx + 0x2587c]
jmp 0x40d21f
mov eax, dword [ebx + 0x25870]
mov dword [ebx + 0x5c901c], 0xd
inc eax
mov dword [ebx + 0x25870], eax
mov ecx, dword [ebx + 0x25870]
xor eax, eax
cmp ecx, eax
je 0x40d280
cmp esi, 0x100000
jne 0x40d276
shl ecx, 0x14
mov eax, 0xcccccccd
mul ecx
mov eax, 0x10624dd3
mov ecx, edx
mul ebp
shr ecx, 3
mov esi, edx
mov eax, ecx
shr esi, 6
xor edx, edx
div esi
cmp eax, 0x64
mov dword [ebx + 0x25888], eax
jbe 0x40d269
mov dword [ebx + 0x25888], 0x64
mov eax, dword [ebx + 0x25884]
add eax, 0x418
jmp 0x40d2a2
mov dword [ebx + 0x25870], 0
mov dword [ebx + 0x2588c], eax
mov eax, 0x10624dd3
mul esi
mov eax, dword [ebx + 0x25884]
mov dword [ebx + 0x25888], 0x64
shr edx, 6
add eax, edx
mov ecx, eax
mov esi, dword [ebx + 0x2586c]
mov dword [ebx + 0x25884], eax
lea edx, [ecx + ecx*2]
lea eax, [ecx + edx*8]
xor edx, edx
shl eax, 2
div esi
cmp esi, ecx
mov dword [ebx + 0x25880], eax
jae 0x40d2cd
mov dword [ebx + 0x25884], esi
mov ecx, dword [ebx + 0x25880]
mov eax, 0x64
cmp ecx, eax
jbe 0x40d2e2
mov dword [ebx + 0x25880], eax
cmp dword [ebx + 0x5c901c], 0xe
jge 0x40d300
mov ecx, ebx
call fcn.00409790
lea eax, [ebx + 0x1de90]
mov ecx, ebx
push eax
call fcn.0040a270
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x328
ret