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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x40db58
push 0x404fd0
mov eax, dword fs:[0]
push eax
add esp, 0xfffff720
mov eax, dword [0x40f018]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x30], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
push 0x402bd0
push 0x402be0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0xd0], eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0xc8], eax
push 0xa
push 0x370
mov eax, dword [ebp - 0xc8]
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0xb8], eax
mov ecx, dword [ebp - 0xb8]
push ecx
mov edx, dword [ebp - 0xc8]
push edx
call dword [ebp - 0xd0]
mov dword [ebp - 0x8d8], eax
mov eax, dword [ebp - 0xb8]
push eax
mov ecx, dword [ebp - 0xc8]
push ecx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x8dc], eax
mov edx, dword [ebp - 0x8d8]
mov eax, dword [edx]
mov dword [ebp - 0x64], eax
mov ecx, dword [ebp - 0x8d8]
add ecx, 4
mov dword [ebp - 0x8d8], ecx
mov edx, dword [ebp - 0x8d8]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x64]
shl eax, 1
push eax
call fcn.004031e2
add esp, 4
mov dword [ebp - 0xb4], eax
mov ecx, dword [ebp - 0x64]
shl ecx, 1
mov dword [ebp - 0x24], ecx
push 0
lea edx, [ebp - 0x24]
push edx
mov eax, dword [ebp - 0xb4]
push eax
mov ecx, dword [ebp - 0x8dc]
sub ecx, 4
push ecx
mov edx, dword [ebp - 0x2c]
push edx
call fcn.0040caa0
add esp, 0x14
push 0xa
push 0x3ac
mov eax, dword [ebp - 0xc8]
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0xc8]
push edx
call dword [ebp - 0xd0]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp - 0x60]
push eax
mov ecx, dword [ebp - 0xc8]
push ecx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x20]
sub edx, 4
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x8e0], 0
jmp 0x40d3f1
mov eax, dword [ebp - 0x8e0]
add eax, 1
mov dword [ebp - 0x8e0], eax
mov ecx, dword [ebp - 0x8e0]
cmp ecx, dword [ebp - 0x24]
jae 0x40d445
mov edx, dword [ebp - 0xb4]
add edx, dword [ebp - 0x8e0]
movzx eax, byte [edx]
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0xcc]
add ecx, dword [ebp - 0x40]
movsx edx, byte [ecx]
xor edx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0xb4]
add eax, dword [ebp - 0x8e0]
mov byte [eax], dl
mov ecx, dword [ebp - 0x40]
add ecx, 1
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp - 0x40]
cmp edx, dword [ebp - 0x28]
jne 0x40d443
mov dword [ebp - 0x40], 0
jmp 0x40d3e2
mov eax, dword [ebp - 0x24]
shr eax, 1
mov dword [ebp - 0xc4], eax
mov ecx, dword [ebp - 0xc4]
push ecx
push 1
call fcn.00403153
add esp, 8
mov dword [ebp - 0xc0], eax
mov edx, dword [ebp - 0xb4]
mov dword [ebp - 0x8d8], edx
mov byte [ebp - 0x3c], 0
xor eax, eax
mov dword [ebp - 0x3b], eax
mov dword [ebp - 0x37], eax
mov byte [ebp - 0x33], al
push 0xa
push 0
mov ecx, dword [ebp - 0xc0]
push ecx
call fcn.00403490
add esp, 0xc
mov dword [ebp - 0x8e4], 0
jmp 0x40d4b0
mov edx, dword [ebp - 0x8e4]
add edx, 1
mov dword [ebp - 0x8e4], edx
mov eax, dword [ebp - 0x8e4]
cmp eax, dword [ebp - 0xc4]
jge 0x40d50c
mov ecx, dword [ebp - 0x8d8]
mov dl, byte [ecx]
mov byte [ebp - 0x3c], dl
mov eax, dword [ebp - 0x8d8]
mov cl, byte [eax + 1]
mov byte [ebp - 0x3b], cl
lea edx, [ebp - 0x3c]
push edx
call fcn.0040d0a0
add esp, 4
mov dword [ebp - 0x8e8], eax
mov eax, dword [ebp - 0xc0]
add eax, dword [ebp - 0x8e4]
mov cl, byte [ebp - 0x8e8]
mov byte [eax], cl
mov edx, dword [ebp - 0x8d8]
add edx, 2
mov dword [ebp - 0x8d8], edx
jmp 0x40d4a1
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0x8f0], eax
mov ecx, dword [ebp - 0x8f0]
push ecx
call fcn.0040350a
add esp, 4
push 0x402bf0
push 0x402c04
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0
je 0x40d567
lea edx, [ebp - 0x8d4]
push edx
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [ebp - 0x48]
test eax, eax
jne 0x40d567
mov dword [ebp - 0x48], 0
lea ecx, [ebp - 0x8d0]
push ecx
push 0x800
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x40d591
push 0x402c14
lea edx, [ebp - 0x8d0]
push edx
call fcn.004032b0
add esp, 8
mov dword [ebp - 4], 0
call fcn.0040d090
cmp eax, 1
jne 0x40d5b0
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x48], 1
mov dword [ebp - 4], 0xfffffffe
jmp 0x40d5c9
mov eax, dword [ebp - 0xcc]
push eax
lea ecx, [ebp - 0x8d0]
push ecx
call fcn.004032c0
add esp, 8
push 0x402c18
lea edx, [ebp - 0x8d0]
push edx
call fcn.004032c0
add esp, 8
push 0x402c20
lea eax, [ebp - 0x8d0]
push eax
call fcn.0040346c
add esp, 8
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x8ec], 0
jmp 0x40d625
mov ecx, dword [ebp - 0x8ec]
add ecx, 1
mov dword [ebp - 0x8ec], ecx
mov edx, dword [ebp - 0x8ec]
cmp edx, dword [ebp - 0xc4]
jge 0x40d652
mov eax, dword [ebp - 0x44]
push eax
push 1
push 1
mov ecx, dword [ebp - 0xc0]
add ecx, dword [ebp - 0x8ec]
push ecx
call fcn.0040387d
add esp, 0x10
jmp 0x40d616
mov edx, dword [ebp - 0x44]
push edx
call fcn.00403976
add esp, 4
mov dword [ebp - 0xb0], 0
push 0x40
push 0
lea eax, [ebp - 0xac]
push eax
call fcn.00403490
add esp, 0xc
push 0x44
push 0
lea ecx, [ebp - 0xb0]
push ecx
call fcn.00403490
add esp, 0xc
push 0x10
push 0
lea edx, [ebp - 0x58]
push edx
call fcn.00403490
add esp, 0xc
mov dword [ebp - 0xb0], 0x44
push 0x402c24
push 0x402c34
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0xbc], eax
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0xb0]
push ecx
push 0
push 0
push 0x20
push 0
push 0
push 0
push 0
lea edx, [ebp - 0x8d0]
push edx
call dword [ebp - 0xbc]
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x30]
xor ecx, ebp
call fcn.00402d51
mov esp, ebp
pop ebp
ret 0x10