Function at 0x417710
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b4e40
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x4e02dc]
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 eax, dword [0x4e3844]
mov edx, dword [eax + 0xc]
xor ebx, ebx
mov ecx, 0x4e3844
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x18], ebx
call edx
lea edi, [eax + 0x10]
mov dword [ebp - 0x2c], edi
mov dword [ebp - 4], ebx
mov eax, dword [0x4e3844]
mov edx, dword [eax + 0xc]
mov ecx, 0x4e3844
call edx
add eax, 0x10
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0xc]
push ebx
push ebx
push 2
push ebx
push 1
push 0x40000000
push eax
mov byte [ebp - 4], 1
mov dword [ebp - 0x14], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x20], esi
je 0x4178e0
mov ecx, dword [ebp + 8]
push ecx
lea edi, [ebp - 0x2c]
call fcn.00417950
mov eax, dword [ebp + 0x10]
sub eax, 1
mov edi, dword [ebp - 0x2c]
je 0x417863
sub eax, 1
je 0x4177fe
sub eax, 1
jne 0x4178b7
push eax
lea edx, [ebp - 0x18]
push edx
push 2
lea eax, [ebp - 0x20]
push eax
push esi
mov byte [ebp - 0x20], 0xff
mov byte [ebp - 0x1f], 0xfe
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4178d9
cmp dword [ebp - 0x18], 2
jne 0x4178d9
mov eax, dword [edi - 0xc]
mov dword [ebp - 0x14], edi
lea ebx, [eax + eax]
jmp 0x4178b7
push 0
lea ecx, [ebp - 0x18]
push ecx
push 3
lea edx, [ebp - 0x24]
push edx
push esi
mov byte [ebp - 0x24], 0xef
mov byte [ebp - 0x23], 0xbb
mov byte [ebp - 0x22], 0xbf
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4178d9
cmp dword [ebp - 0x18], 3
jne 0x4178d9
call dword [0x4e0024]
test edi, edi
jne 0x41783d
xor eax, eax
jmp 0x4178a1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
cmp eax, 0x3fffffff
jle 0x417852
xor eax, eax
jmp 0x4178a1
lea ebx, [eax + eax]
mov eax, ebx
call fcn.004a4af0
mov edx, 0xfde9
jmp 0x417896
call dword [0x4e0024]
test edi, edi
mov dword [ebp - 0x14], eax
jne 0x417874
xor eax, eax
jmp 0x4178a1
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 1
cmp eax, 0x3fffffff
jle 0x417889
xor eax, eax
jmp 0x4178a1
lea ebx, [eax + eax]
mov eax, ebx
call fcn.004a4af0
mov edx, dword [ebp - 0x14]
mov ecx, ebx
mov eax, edi
mov esi, esp
call fcn.00407b30
mov edx, eax
lea ebx, [ebp - 0x1c]
call fcn.00407500
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x20]
mov ebx, dword [eax - 0xc]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
push 0
lea eax, [ebp - 0x18]
push eax
push ebx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4178d9
cmp dword [ebp - 0x18], ebx
jne 0x4178d9
mov dword [ebp - 0x28], 1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x417903
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add edi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x417926
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, dword [ebp - 0x28]
lea esp, [ebp - 0x3c]
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.004935b6
mov esp, ebp
pop ebp
ret 0xc