Function at 0x40bb8c
Capabilities:
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x47
push 0
push 0
dec ecx
jne 0x40bb94
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x84]
mov edx, dword [0x407c04]
call fcn.00404110
xor eax, eax
push ebp
push 0x40c2b6
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 4], eax
call sub.KERNEL32.DLL_UnmapViewOfFile
test eax, 0x80000000
je 0x40c036
test ebx, ebx
je 0x40c02a
cmp ebx, 0xffffffff
je 0x40c02a
push ebx
call fcn.0040c330
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x40c01e
call fcn.0040a28c
cmp eax, dword [ebp - 8]
je 0x40c01e
mov eax, dword [ebp - 8]
call fcn.0040bb38
test al, al
jne 0x40c01e
push 0x78
call sub.KERNEL32.DLL_RtlUnwind
call fcn.0040a28c
xor dword [ebp - 8], eax
lea eax, [ebp - 8]
mov dword [ebp - 0xc], eax
mov eax, 0x40c2d4
call fcn.00409fec
lea edx, [ebp - 0x84]
call fcn.00409f2c
mov eax, dword [ebp - 0x68]
call fcn.00404668
cmp eax, 7
jl 0x40c281
mov eax, dword [ebp - 0x68]
call fcn.00404670
add eax, eax
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x68]
mov eax, dword [edx + eax*8 - 0xc0]
lea edx, [ebp - 0x1d4]
call fcn.00409f2c
lea edx, [ebp - 0x1d4]
lea eax, [ebp - 0x84]
mov ecx, dword [0x407c04]
call fcn.00404300
cmp dword [ebp - 0x78], 0xc8
jge 0x40c281
mov eax, dword [ebp - 0x64]
call fcn.00404668
cmp eax, 5
jl 0x40c281
mov eax, dword [ebp - 0x64]
call fcn.00404670
mov edx, eax
shl eax, 3
sub eax, edx
mov edx, dword [ebp - 0x64]
mov ebx, dword [edx + eax*4 + 0xc]
mov eax, dword [ebp - 0x64]
call fcn.00404670
mov edx, eax
shl eax, 3
sub eax, edx
mov edx, dword [ebp - 0x64]
cmp ebx, dword [edx + eax*4 - 0x10]
jne 0x40c281
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x64]
call fcn.00404670
mov edx, eax
shl eax, 3
sub eax, edx
mov edx, dword [ebp - 0x64]
mov eax, dword [edx + eax*4 - 0x2c]
lea edx, [ebp - 0x214]
call fcn.00409f2c
lea edx, [ebp - 0x214]
lea eax, [ebp - 0x84]
mov ecx, dword [0x407c04]
call fcn.00404300
cmp dword [ebp - 0x78], 0x1f4
jge 0x40c281
lea eax, [ebp - 0x84]
call fcn.0040ba60
test eax, eax
je 0x40c281
push 0
push 0
xor ecx, ecx
xor edx, edx
mov eax, dword [ebp - 0x80]
call fcn.0040b2c0
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x40c017
push dword fs:[edx]
mov dword fs:[edx], esp
lea edx, [ebp - 0x84]
mov eax, dword [ebp - 0x14]
call fcn.00409f2c
lea eax, [ebp - 0x84]
call fcn.0040ba60
test eax, eax
je 0x40bffe
lea edx, [ebp - 0xc]
mov dword [eax], edx
push 0
push 0
xor ecx, ecx
xor edx, edx
mov eax, dword [ebp - 0x10]
call fcn.0040b2c0
mov dword [ebp - 0x20], eax
xor edx, edx
push ebp
push 0x40bff7
push dword fs:[edx]
mov dword fs:[edx], esp
lea edx, [ebp - 0x84]
mov eax, dword [ebp - 0x20]
call fcn.00409f2c
mov eax, dword [ebp - 0x64]
call fcn.00404670
mov edx, eax
shl eax, 3
sub eax, edx
mov edx, dword [ebp - 0x64]
lea esi, [edx + eax*4 - 0x38]
mov eax, dword [ebp - 0x14]
xor edx, edx
push edx
push eax
mov eax, dword [esi + 8]
xor edx, edx
sub dword [esp], eax
sbb dword [esp + 4], edx
pop eax
pop edx
mov edx, dword [esi + 0x14]
mov dword [edx], eax
mov eax, dword [ebp - 0x68]
call fcn.00404670
test eax, eax
jl 0x40be32
inc eax
mov dword [ebp - 0x44], eax
xor ebx, ebx
mov eax, ebx
add eax, eax
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x68]
mov edx, dword [edx + eax*8]
cmp edx, dword [esi + 4]
jae 0x40be2c
mov edx, dword [ebp - 0x68]
mov edx, dword [edx + eax*8 + 4]
cmp edx, dword [esi + 4]
jbe 0x40be2c
mov edx, dword [ebp - 0x68]
mov edx, dword [edx + eax*8]
cmp word [edx], 0x86a
jne 0x40be2c
mov edx, dword [ebp - 0x68]
mov eax, dword [edx + eax*8]
mov word [eax], 0x186a
jmp 0x40be32
inc ebx
dec dword [ebp - 0x44]
jne 0x40bdf4
cmp dword [ebp + 0x10], 0
jne 0x40be41
mov dword [ebp + 0x10], 0xffffd000
jmp 0x40be4a
cmp dword [ebp + 0x10], 0
jle 0x40be4a
neg dword [ebp + 0x10]
push 0
push 0x14
call fcn.0040aed8
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp + 0x14]
mov dword [eax], edx
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp + 0x18]
mov dword [eax + 4], edx
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, 0x40c2ec
call fcn.00409fec
lea edx, [ebp - 0x194]
call fcn.0040906c
mov ebx, 0xa
cmp word [ebp - 0x192], 0xa1
jne 0x40beb6
cmp dword [ebp - 0x18], 0
je 0x40beaa
mov eax, dword [ebp - 0x178]
inc eax
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
jmp 0x40bedf
mov eax, dword [ebp - 0x178]
inc eax
mov eax, dword [eax]
mov dword [ebp - 0x18], eax
lea edx, [ebp - 0x238]
mov eax, dword [ebp - 0x174]
call fcn.0040906c
push edi
lea esi, [ebp - 0x238]
lea edi, [ebp - 0x194]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
pop edi
dec ebx
jne 0x40be8b
cmp dword [ebp - 0x18], 0
jne 0x40beeb
cmp dword [ebp - 0x1c], 0
je 0x40bf3b
call fcn.00409f40
mov edx, 0x61
call fcn.00407764
mov dword [ebp - 0x3c], eax
call fcn.00409f40
mov edx, 0x62
call fcn.00407764
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x3c], 0
je 0x40bf45
cmp dword [ebp - 0x40], 0
je 0x40bf45
cmp dword [ebp - 0x18], 0
je 0x40bf2a
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
push eax
call dword [ebp - 0x3c]
cmp dword [ebp - 0x1c], 0
je 0x40bf45
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
push eax
call dword [ebp - 0x3c]
jmp 0x40bf45
xor eax, eax
mov dword [ebp - 0x3c], eax
xor eax, eax
mov dword [ebp - 0x40], eax
xor eax, eax
push ebp
push 0x40bfc6
push dword fs:[eax]
mov dword fs:[eax], esp
lea edx, [ebp - 0x10]
mov eax, dword [ebp - 0x38]
add eax, 8
call fcn.0040b6cc
test al, al
je 0x40bf8e
mov eax, dword [ebp - 8]
add eax, 0x20
test dword [eax], 0x30800000
jne 0x40bf8e
mov eax, dword [ebp + 0x20]
push eax
mov eax, dword [ebp + 0x1c]
push eax
mov eax, dword [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp + 0x10]
push eax
push edi
call dword [ebp - 0x20]
mov dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40bfcd
cmp dword [ebp - 0x3c], 0
je 0x40bfc5
cmp dword [ebp - 0x40], 0
je 0x40bfc5
cmp dword [ebp - 0x1c], 0
je 0x40bfb6
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
push eax
call dword [ebp - 0x40]
cmp dword [ebp - 0x18], 0
je 0x40bfc5
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
push eax
call dword [ebp - 0x40]
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40c281
push 0
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040aff8
ret
push 0x57
call sub.KERNEL32.DLL_RtlUnwind
jmp 0x40c281
push 0x57
call sub.KERNEL32.DLL_RtlUnwind
jmp 0x40c281
xor esi, esi
test edi, edi
jne 0x40c0d0
push 2
push 0
push 0
lea eax, [ebp - 0x1c]
push eax
call sub.KERNEL32.DLL_LoadLibraryW
push eax
call sub.KERNEL32.DLL_MapViewOfFile
push eax
call sub.KERNEL32.DLL_LoadLibraryW
push eax
call sub.KERNEL32.DLL_GetSystemDirectoryW
test eax, eax
je 0x40c0d0
xor eax, eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 0
push 0
push 4
mov eax, dword [ebp - 0x1c]
push eax
call sub.user32.dll_DispatchMessageA
cmp dword [ebp - 0x18], 0
jbe 0x40c0c7
mov eax, dword [ebp - 0x18]
add eax, eax
call fcn.004024fc
mov esi, eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x18]
add eax, eax
push eax
push esi
push 4
mov eax, dword [ebp - 0x1c]
push eax
call sub.user32.dll_DispatchMessageA
test eax, eax
je 0x40c0c7
mov dword [ebp - 0x90], 0xc
mov dword [ebp - 0x8c], esi
xor eax, eax
mov dword [ebp - 0x88], eax
lea edi, [ebp - 0x90]
mov eax, dword [ebp - 0x1c]
push eax
call sub.KERNEL32.DLL_FormatMessageA
call fcn.0040a61c
call sub.KERNEL32.DLL_LoadLibraryExA
call fcn.0040bae8
mov dword [ebp - 0x18], eax
push ebx
call fcn.0040c330
call fcn.0040bae8
cmp eax, dword [ebp - 0x18]
je 0x40c25b
mov eax, 0x40c308
call fcn.0040a0e4
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x40c27a
test edi, edi
je 0x40c119
mov eax, dword [edi + 4]
mov dword [ebp - 0x30], eax
jmp 0x40c11e
xor eax, eax
mov dword [ebp - 0x30], eax
xor edi, edi
xor eax, eax
mov dword [ebp - 0x34], eax
cmp dword [ebp + 0x10], 0
je 0x40c13c
test byte [ebp + 0x1e], 1
je 0x40c136
lea edi, [ebp + 0x10]
jmp 0x40c13c
lea eax, [ebp + 0x10]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp + 0x18]
push eax
mov eax, dword [ebp + 0x14]
push eax
mov eax, dword [ebp - 0x34]
push eax
push edi
push 0
push 0xffffffffffffffff
mov eax, dword [ebp - 0x30]
push eax
push ebx
call dword [ebp - 0x2c]
test eax, eax
jl 0x40c27a
mov dword [ebp - 0x15c], 0x10007
lea eax, [ebp - 0x15c]
push eax
mov eax, dword [ebp - 0x18]
push eax
call dword [0x4189ac]
test eax, eax
je 0x40c24e
lea eax, [ebp - 0x1c]
push eax
push 8
lea eax, [ebp - 0x16e]
push eax
mov eax, dword [ebp - 0x98]
push eax
push ebx
call dword [0x4189a4]
test eax, eax
je 0x40c24e
mov eax, dword [ebp - 0x98]
sub eax, 4
mov dword [ebp - 0x16e], eax
mov byte [ebp - 0x166], 0x50
mov byte [ebp - 0x165], 0xb8
mov eax, 0x40c324
call fcn.00409fec
mov dword [ebp - 0x164], eax
mov dword [ebp - 0x160], 0xd0ff
sub dword [ebp - 0x98], 0xc
lea eax, [ebp - 0x1c]
push eax
push 0x12
lea eax, [ebp - 0x16e]
push eax
mov eax, dword [ebp - 0x98]
push eax
push ebx
call dword [0x4189a8]
test eax, eax
je 0x40c241
lea eax, [ebp - 0x15c]
push eax
mov eax, dword [ebp - 0x18]
push eax
call dword [0x4189b0]
test eax, eax
je 0x40c241
test byte [ebp + 0x1c], 4
jne 0x40c231
mov eax, dword [ebp - 0x18]
push eax
call sub.KERNEL32.DLL_GetStdHandle
cmp eax, 0xffffffff
je 0x40c241
mov eax, dword [ebp - 0x18]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x20]
mov edx, dword [ebp - 0x24]
mov dword [eax], edx
jmp 0x40c27a
push 0
mov eax, dword [ebp - 0x18]
push eax
call sub.KERNEL32.DLL_WriteFile
jmp 0x40c27a
push 0
mov eax, dword [ebp - 0x18]
push eax
call sub.KERNEL32.DLL_WriteFile
jmp 0x40c27a
mov eax, dword [ebp + 0x20]
push eax
mov eax, dword [ebp + 0x1c]
push eax
mov eax, dword [ebp + 0x18]
push eax
mov eax, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x10]
push eax
push edi
push ebx
call dword [0x4189b4]
mov dword [ebp - 4], eax
mov eax, esi
call fcn.0040251c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40c2bd
lea eax, [ebp - 0x214]
mov edx, dword [0x407c04]
mov ecx, 2
call fcn.00404208
lea eax, [ebp - 0x84]
mov edx, dword [0x407c04]
call fcn.004041d4
ret