Function at 0x401a8f
Capabilities:
Get common file path
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4e4
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 1
mov edi, 0x80000000
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x90], eax
jne 0x401acd
xor al, al
jmp 0x401eb4
mov dword [esp + 0x88], 0x401961
mov dword [esp + 0x8c], 0x401990
mov dword [esp + 0x48], 0x401ebb
mov dword [esp + 0x4c], 0x401ed2
mov dword [esp + 0x80], 0x401ebb
mov dword [esp + 0x84], 0x401ed2
call fcn.00403897
lea eax, [esp + 0xa0]
call fcn.00401edd
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x54]
call fcn.0040386a
add esp, 0xc
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e90
mov ecx, dword [ebp + 0x10]
or dword [esp + 0x9c], 0xffffffff
cmp ecx, ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x98], ebx
je 0x401b75
fldz
mov eax, dword [ecx]
push 0x401848
push ecx
push ecx
fstp qword [esp]
call dword [eax + 4]
mov esi, 0x206
push esi
lea eax, [esp + 0x2ee]
push ebx
push eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov word [esp + 0x2f4], bx
call fcn.004062a0
add esp, 0xc
push esi
lea eax, [esp + 0xe6]
push ebx
push eax
mov word [esp + 0xec], bx
call fcn.004062a0
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
add esp, 0xc
cmp dword [ebp + 0xc], ebx
lea eax, [esp + 0xe0]
jne 0x401bd6
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
jmp 0x401be4
push dword [ebp + 0xc]
mov word [esp + 0xe4], bx
push eax
call esi
lea eax, [esp + 0xe0]
xor ecx, ecx
inc ecx
inc eax
inc eax
cmp word [eax], bx
jne 0x401bed
cmp word [esp + ecx*2 + 0xde], 0x5c
je 0x401c0f
push 0x40184c
lea eax, [esp + 0xe4]
push eax
call esi
mov eax, dword [esp + 0xbc]
cmp eax, ebx
jbe 0x401c71
mov esi, dword [esp + 0xb0]
add esi, 0x10
mov dword [esp + 0x18], eax
cmp byte [esi + 9], bl
je 0x401c50
mov ecx, dword [esi]
lea edx, [esp + 0xe0]
lea eax, [esp + 0x2e8]
call fcn.004018c0
lea eax, [esp + 0x2e8]
call fcn.004019ec
jmp 0x401c5e
mov eax, dword [esi - 8]
add dword [esp + 0x28], eax
mov eax, dword [esi - 4]
adc dword [esp + 0x2c], eax
add esi, 0x20
dec dword [esp + 0x18]
jne 0x401c28
mov eax, dword [esp + 0x28]
or eax, dword [esp + 0x2c]
jne 0x401c78
mov al, 1
jmp 0x401eb4
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
mov esi, 0x7fffffff
mov ecx, dword [esp + 0xb0]
mov eax, dword [esp + 0x18]
add eax, ecx
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x24], eax
lea edx, [esp + 0xe0]
lea eax, [esp + 0x2e8]
call fcn.004018c0
mov eax, dword [esp + 0x24]
cmp byte [eax + 0x19], bl
jne 0x401e56
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x88]
push eax
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x50]
push eax
lea eax, [esp + 0xb4]
push eax
push dword [esp + 0x3c]
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0xc4]
call fcn.004038fd
add esp, 0x24
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e81
push ebx
push 0x80
push 2
push ebx
push 1
push 0x40000000
lea eax, [esp + 0x300]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x24], eax
je 0x401e79
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x3c]
add eax, ecx
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 0x1c], eax
mov byte [esp + 0x13], 1
mov dword [esp + 0x34], ebx
mov eax, 0x1000000
cmp dword [esp + 0x1c], eax
ja 0x401d70
mov eax, dword [esp + 0x1c]
push ebx
lea ecx, [esp + 0x54]
push ecx
push eax
push dword [esp + 0x44]
mov dword [esp + 0x60], ebx
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x50]
add dword [esp + 0x38], eax
sub dword [esp + 0x1c], eax
add dword [esp + 0x34], eax
cmp ecx, ebx
je 0x401e1f
add dword [esp + 0x40], eax
lea eax, [esp + 0x2e8]
push eax
adc dword [esp + 0x48], ebx
mov eax, dword [esp + 0x44]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x60], eax
and dword [esp + 0x60], esi
fild qword [esp + 0x5c]
mov dword [esp + 0x68], eax
and dword [esp + 0x68], edi
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x64], ebx
fild qword [esp + 0x64]
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x78], eax
and dword [esp + 0x78], esi
fchs
faddp st(1)
mov dword [esp + 0x70], eax
and dword [esp + 0x70], edi
fild qword [esp + 0x74]
mov dword [esp + 0x6c], ebx
fild qword [esp + 0x6c]
mov edx, dword [ecx]
push ecx
push ecx
fchs
faddp st(1)
fdivp st(1)
fstp qword [esp]
call dword [edx + 4]
mov byte [esp + 0x13], al
cmp dword [esp + 0x94], ebx
je 0x401e38
cmp byte [esp + 0x13], bl
je 0x401e72
cmp dword [esp + 0x1c], ebx
ja 0x401d61
cmp byte [esp + 0x13], bl
je 0x401e72
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x54]
jne 0x401e79
push dword [esp + 0x24]
call fcn.00401951
test eax, eax
pop ecx
jne 0x401e79
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], 0x20
cmp eax, dword [esp + 0xbc]
jb 0x401c8d
jmp 0x401e81
or dword [esp + 0x14], 0xffffffff
jmp 0x401e81
mov dword [esp + 0x14], 0xb
push dword [esp + 0x3c]
lea eax, [esp + 0x4c]
push eax
call dword [esp + 0x54]
pop ecx
pop ecx
lea esi, [esp + 0x48]
lea eax, [esp + 0xa0]
call fcn.00401ef1
push dword [esp + 0x90]
call fcn.00401951
cmp dword [esp + 0x18], ebx
pop ecx
sete al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret