Function at 0x40c230
Capabilities:
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4518ab
mov eax, dword fs:[0]
push eax
sub esp, 0xb0
mov eax, dword [0x46b008]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
xor eax, eax
mov byte [ebp - 0xad], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 7
mov word [ebp - 0x44], ax
mov dword [ebp - 4], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 7
mov word [ebp - 0x5c], ax
lea eax, [edi + 0x10]
mov byte [ebp - 4], 1
cmp dword [edi + 0x14], 8
mov dword [ebp - 0xb4], eax
mov dword [eax], 0
mov eax, edi
jb 0x40c2aa
mov eax, dword [edi]
xor ecx, ecx
mov dword [ebp - 0x18], 7
mov word [eax], cx
xor eax, eax
push 0x10
mov dword [ebp - 0x1c], ecx
lea ecx, [ebp - 0x2c]
push 0x462e5c
mov word [ebp - 0x2c], ax
call fcn.004013c0
lea edx, [ebp - 0x5c]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2c]
call fcn.0041a520
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40c31b
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c311
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c71e
push edx
push ecx
call fcn.0041b657
add esp, 8
mov esi, dword [0x46b8a8]
mov ebx, dword [esi]
test ebx, ebx
je 0x40c552
cmp ebx, 0x3ffffc
ja 0x40c552
cmp ebx, 2
jb 0x40c37e
mov al, bl
lea edx, [esi + ebx]
add al, al
mov cl, bl
add cl, al
mov al, 3
sub al, cl
add byte [edx + 3], al
lea edx, [ebx - 2]
test edx, edx
je 0x40c378
jmp 0x40c360
movzx eax, dl
lea ecx, [edx + esi]
imul eax, eax, 0xfd
sub al, byte [edx + esi + 5]
add byte [ecx + 4], al
sub edx, 1
jne 0x40c360
mov al, byte [esi + 5]
sub byte [esi + 4], al
lea eax, [ebp - 0x44]
mov dl, 1
push eax
mov ecx, 1
call fcn.0041b180
add esp, 4
test al, al
jne 0x40c3f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.GetServicePath_failed_with__i.
push eax
call fcn.004123b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.004032f0
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40c560
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c3e9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c723
push edx
push ecx
call fcn.0041b657
add esp, 8
jmp 0x40c560
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
jb 0x40c404
mov eax, dword [ebp - 0x44]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
jb 0x40c41c
mov eax, dword [ebp - 0x44]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
mov dword [ebp - 0xb8], ecx
cmp ecx, 0xffffffff
jne 0x40c49f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.CreateFile_failed_with__i.
push eax
call fcn.004123b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.004032f0
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40c560
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c3e9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c728
jmp 0x40c3e9
push 0
lea eax, [ebp - 0xbc]
push eax
mov eax, dword [0x46b8a8]
push ebx
add eax, 4
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0xb8]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40c526
push ebx
lea eax, [ebp - 0x2c]
push str.WriteFile_failed_with__i.
push eax
call fcn.004123b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.004032f0
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40c560
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40c3e9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c72d
invalid