Function at 0x40a110
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42e786
mov eax, dword fs:[0]
push eax
sub esp, 0x4bc
mov eax, dword [0x43a204]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov ecx, dword [esi + 0x5b4]
mov eax, 0x4ec4ec4f
mov ebx, dword [esi + 0x5b0]
sub ecx, ebx
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x40a64a
mov ecx, dword [ebx + 0x2c]
mov eax, 0x66666667
mov edi, dword [ebx + 0x28]
sub ecx, edi
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x40a64a
mov eax, dword [edi + 0xc]
sub eax, dword [edi + 8]
sar eax, 2
test eax, eax
jle 0x40a64a
push dword [esi + 4]
lea ecx, [ebp - 0x494]
push str.CNS_Files__.cns_
push 6
push 0
push 0x430204
push 0
call fcn.00402ad0
mov dword [ebp - 4], 0
call dword [sym.imp.USER32.dll_GetActiveWindow]
push eax
lea ecx, [ebp - 0x494]
call fcn.004053d0
cmp eax, 1
jne 0x40a63a
lea eax, [ebp - 0x218]
push 0x430264
push eax
call fcn.0041bd6f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x49c], ebx
test ebx, ebx
je 0x40a63a
cmp byte [esi + 0x72], 0
je 0x40a215
lea ecx, [esi + 0x4d4]
call fcn.0040ff20
mov byte [ebp - 0x495], 1
test eax, eax
jg 0x40a21c
mov byte [ebp - 0x495], 0
push ebx
push 4
push 1
push str._CNS
call fcn.0041e88d
push ebx
push 4
lea eax, [esi + 0x64]
push 1
push eax
call fcn.0041e88d
push ebx
push 4
lea eax, [esi + 0x68]
push 1
push eax
call fcn.0041e88d
push ebx
push 4
lea eax, [esi + 0x5c]
push 1
push eax
call fcn.0041e88d
add esp, 0x40
lea eax, [esi + 0x60]
push ebx
push 4
push 1
push eax
call fcn.0041e88d
push ebx
push 1
lea eax, [ebp - 0x495]
push 1
push eax
call fcn.0041e88d
mov eax, dword [esi + 0x5cc]
sub eax, dword [esi + 0x5c8]
push ebx
sar eax, 3
push 4
mov dword [ebp - 0x4a0], eax
lea eax, [ebp - 0x4a0]
push 1
push eax
call fcn.0041e88d
mov ecx, dword [esi + 0x5c8]
mov eax, dword [esi + 0x5cc]
sub eax, ecx
push ebx
and eax, 0xfffffff8
push eax
push 1
push ecx
call fcn.0041e88d
mov ecx, dword [esi + 0x5c0]
mov eax, 0x2aaaaaab
sub ecx, dword [esi + 0x5bc]
add esp, 0x40
imul ecx
push ebx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
push 4
mov dword [ebp - 0x4a0], eax
lea eax, [ebp - 0x4a0]
push 1
push eax
call fcn.0041e88d
mov ecx, dword [esi + 0x5c0]
mov eax, 0x2aaaaaab
mov edi, dword [esi + 0x5bc]
sub ecx, edi
imul ecx
push ebx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
lea eax, [eax + eax*2]
shl eax, 2
push eax
push 1
push edi
call fcn.0041e88d
mov ecx, dword [esi + 0x5c0]
mov eax, 0x2aaaaaab
sub ecx, dword [esi + 0x5bc]
xor edi, edi
imul ecx
add esp, 0x20
mov dword [ebp - 0x4ac], edi
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x40a5d5
nop dword [eax]
mov eax, dword [esi + 0x5b0]
imul ecx, edi, 0xd0
add eax, 0x28
add eax, ecx
mov dword [ebp - 0x4a8], eax
test edi, edi
jne 0x40a523
mov eax, dword [esi + 0x5cc]
lea ecx, [ebp - 0x4ad]
sub eax, dword [esi + 0x5c8]
push ecx
sar eax, 3
lea ecx, [ebp - 0x4c8]
push eax
call fcn.00402850
mov eax, dword [esi + 0x5cc]
lea ecx, [ebp - 0x4ae]
sub eax, dword [esi + 0x5c8]
push ecx
sar eax, 3
lea ecx, [ebp - 0x4bc]
push eax
mov byte [ebp - 4], 1
call fcn.004028b0
mov edi, dword [esi + 0x5cc]
xor ecx, ecx
mov edx, dword [esi + 0x5c8]
mov eax, edi
mov ebx, dword [ebp - 0x4c8]
sub eax, edx
sar eax, 3
test eax, eax
mov eax, dword [ebp - 0x4bc]
mov dword [ebp - 0x4a0], eax
je 0x40a421
xor edx, edx
mov edi, dword [ebp - 0x4a8]
lea edx, [edx + 0x14]
mov eax, dword [edi]
mov al, byte [edx + eax - 0x14]
mov byte [ebx + ecx], al
mov eax, dword [edi]
mov edi, dword [ebp - 0x4a0]
mov eax, dword [eax + edx - 0x10]
mov dword [edi + ecx*4], eax
inc ecx
mov edi, dword [esi + 0x5cc]
mov eax, edi
sub eax, dword [esi + 0x5c8]
sar eax, 3
cmp ecx, eax
jb 0x40a3e4
mov edx, dword [esi + 0x5c8]
push dword [ebp - 0x49c]
sub edi, edx
sar edi, 3
push edi
push 1
push ebx
call fcn.0041e88d
mov eax, dword [esi + 0x5cc]
sub eax, dword [esi + 0x5c8]
push dword [ebp - 0x49c]
mov edi, dword [ebp - 0x4a0]
sar eax, 3
shl eax, 2
push eax
push 1
push edi
call fcn.0041e88d
add esp, 0x20
test edi, edi
je 0x40a4bb
mov eax, dword [ebp - 0x4b4]
sub eax, edi
sar eax, 2
lea ecx, [eax*4]
mov eax, edi
cmp ecx, 0x1000
jb 0x40a493
mov edi, dword [edi - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40a66a
push ecx
push edi
call fcn.004135cf
add esp, 8
mov dword [ebp - 0x4bc], 0
mov dword [ebp - 0x4b8], 0
mov dword [ebp - 0x4b4], 0
mov byte [ebp - 4], 0
test ebx, ebx
je 0x40a511
mov ecx, dword [ebp - 0x4c0]
mov eax, ebx
sub ecx, ebx
cmp ecx, 0x1000
jb 0x40a4e9
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40a66a
push ecx
push ebx
call fcn.004135cf
add esp, 8
mov dword [ebp - 0x4c8], 0
mov dword [ebp - 0x4c4], 0
mov dword [ebp - 0x4c0], 0
mov edi, dword [ebp - 0x4ac]
mov ebx, dword [ebp - 0x49c]
mov eax, dword [ebp - 0x4a8]
mov ecx, dword [eax]
push ebx
push 4
push 1
mov eax, dword [ecx + 0xc]
sub eax, dword [ecx + 8]
sar eax, 2
mov dword [ebp - 0x4a4], eax
lea eax, [ebp - 0x4a4]
push eax
call fcn.0041e88d
mov eax, dword [esi + 0x5cc]
add esp, 0x10
sub eax, dword [esi + 0x5c8]
xor ebx, ebx
sar eax, 3
test eax, eax
je 0x40a5a4
xor edi, edi
nop
mov eax, dword [ebp - 0x4a8]
push dword [ebp - 0x49c]
mov eax, dword [eax]
mov ecx, dword [eax + edi + 8]
mov eax, dword [eax + edi + 0xc]
sub eax, ecx
and eax, 0xfffffffc
push eax
push 1
push ecx
call fcn.0041e88d
mov eax, dword [esi + 0x5cc]
lea edi, [edi + 0x14]
sub eax, dword [esi + 0x5c8]
inc ebx
sar eax, 3
add esp, 0x10
cmp ebx, eax
jb 0x40a560
mov edi, dword [ebp - 0x4ac]
mov ecx, dword [esi + 0x5c0]
mov eax, 0x2aaaaaab
sub ecx, dword [esi + 0x5bc]
inc edi
mov ebx, dword [ebp - 0x49c]
imul ecx
mov dword [ebp - 0x4ac], edi
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp edi, eax
jb 0x40a350
cmp byte [ebp - 0x495], 0
je 0x40a622
mov ecx, dword [esi + 0x4fc]
push ebx
push 4
push 1
mov eax, dword [ecx + 0xc]
sub eax, dword [ecx + 8]
sar eax, 2
mov dword [ebp - 0x4a4], eax
lea eax, [ebp - 0x4a4]
push eax
call fcn.0041e88d
mov eax, dword [esi + 0x4fc]
push ebx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
sub eax, ecx
and eax, 0xfffffffc
push eax
push 1
push ecx
call fcn.0041e88d
add esp, 0x20
push ebx
push 4
push 1
push str._CNS
call fcn.0041e88d
push ebx
call fcn.0041e289
add esp, 0x14
mov eax, dword [ebp - 0x480]
test eax, eax
je 0x40a64a
push eax
call fcn.00413140
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00413a6c
mov esp, ebp
pop ebp
ret 0x10
call fcn.00417569
int3