Function at 0x403c87
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40a525
mov eax, dword fs:[0]
push eax
mov eax, 0x2220
call fcn.00409ca0
mov eax, dword [0x40c118]
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, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x2224], esi
mov dword [ebp - 0x2228], edi
mov dword [ebp - 0x2218], ebx
mov dword [ebp - 0x2214], ebx
mov dword [ebp - 4], 3
call fcn.0040453d
test eax, eax
je 0x403dca
push edi
push esi
push 0xffffffffffffffff
lea eax, [ebp - 0x2210]
push 0x1000
push eax
call dword [sym.imp.MSVCR80.dll__vsnwprintf_s]
add esp, 0x14
cmp eax, 0xffffffff
jne 0x403d56
push 0x100
lea eax, [ebp - 0x210]
push eax
push 0xd
call fcn.00403833
test eax, eax
je 0x403d56
lea eax, [ebp - 0x210]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x403d2b
sub eax, edx
sar eax, 1
lea ecx, [ebp - 0x210]
push ecx
inc eax
push eax
add eax, eax
lea ecx, [ebp - 0x210]
sub ecx, eax
push ecx
call dword [sym.imp.MSVCR80.dll_wcscpy_s]
add esp, 0xc
lea eax, [ebp - 0x2210]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x403d5f
sub eax, edx
sar eax, 1
lea esi, [eax + 1]
imul esi, esi, 3
push esi
call fcn.0040406a
pop ecx
mov edi, eax
cmp dword [ebp - 0x2214], ebx
je 0x403d96
push dword [ebp - 0x2218]
call fcn.004040e9
pop ecx
mov dword [ebp - 0x2214], ebx
mov dword [ebp - 0x2218], edi
cmp edi, ebx
je 0x403daa
mov dword [ebp - 0x2214], 1
push ebx
push ebx
dec esi
push esi
push edi
push 0xffffffffffffffff
lea eax, [ebp - 0x2210]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
push eax
call fcn.004046b6
jmp 0x403eec
mov dword [ebp - 0x2220], ebx
mov dword [ebp - 0x221c], ebx
mov byte [ebp - 4], 7
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x403ddf
sub eax, edx
sar eax, 1
lea esi, [eax + 1]
imul esi, esi, 3
push esi
call fcn.0040406a
pop ecx
mov edi, eax
cmp dword [ebp - 0x221c], ebx
je 0x403e16
push dword [ebp - 0x2220]
call fcn.004040e9
pop ecx
mov dword [ebp - 0x221c], ebx
mov dword [ebp - 0x2220], edi
cmp edi, ebx
je 0x403e2a
mov dword [ebp - 0x221c], 1
push ebx
push ebx
dec esi
push esi
push edi
push 0xffffffffffffffff
push dword [ebp - 0x2224]
push ebx
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
push eax
call fcn.004046b6
mov eax, dword [ebp - 0x2220]
xor edi, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x403e4f
sub eax, esi
je 0x403e88
mov eax, dword [ebp - 0x2220]
add eax, edi
cmp byte [eax], 0x25
jne 0x403e71
cmp byte [eax + 1], 0x73
jne 0x403e71
mov byte [eax + 1], 0x53
mov eax, dword [ebp - 0x2220]
inc edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x403e7b
sub eax, esi
cmp edi, eax
jb 0x403e5a
mov esi, 0x400
push esi
call fcn.0040406a
pop ecx
mov edi, eax
cmp dword [ebp - 0x2214], ebx
je 0x403eb0
push dword [ebp - 0x2218]
call fcn.004040e9
pop ecx
mov dword [ebp - 0x2214], ebx
mov dword [ebp - 0x2218], edi
cmp edi, ebx
je 0x403ec4
mov dword [ebp - 0x2214], 1
push dword [ebp - 0x2228]
push dword [ebp - 0x2220]
push 0xffffffffffffffff
push esi
push edi
call dword [sym.imp.MSVCR80.dll__vsnprintf_s]
add esp, 0x14
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x2220]
call fcn.004039fc
mov eax, dword [ebp - 0x2218]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x403ef5
push ebx
lea ecx, [ebp - 0x222c]
push ecx
sub eax, edx
push eax
push dword [ebp - 0x2218]
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2218]
call fcn.004039fc
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.00409bc3
leave
ret 8