Function at 0x401a2f
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 0x401a6d
xor al, al
jmp 0x401e54
mov dword [esp + 0x88], 0x401901
mov dword [esp + 0x8c], 0x401930
mov dword [esp + 0x48], 0x4039d8
mov dword [esp + 0x4c], 0x4039ef
mov dword [esp + 0x80], 0x4039d8
mov dword [esp + 0x84], 0x4039ef
call fcn.004039fa
lea eax, [esp + 0xa0]
call fcn.0040201e
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x54]
call fcn.004039ab
add esp, 0xc
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e30
mov ecx, dword [ebp + 0x10]
or dword [esp + 0x9c], 0xffffffff
cmp ecx, ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x98], ebx
je 0x401b15
fldz
mov eax, dword [ecx]
push 0x401828
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.00406240
add esp, 0xc
push esi
lea eax, [esp + 0xe6]
push ebx
push eax
mov word [esp + 0xec], bx
call fcn.00406240
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
add esp, 0xc
cmp dword [ebp + 0xc], ebx
lea eax, [esp + 0xe0]
jne 0x401b76
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
jmp 0x401b84
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 0x401b8d
cmp word [esp + ecx*2 + 0xde], 0x5c
je 0x401baf
push 0x40182c
lea eax, [esp + 0xe4]
push eax
call esi
mov eax, dword [esp + 0xbc]
cmp eax, ebx
jbe 0x401c11
mov esi, dword [esp + 0xb0]
add esi, 0x10
mov dword [esp + 0x18], eax
cmp byte [esi + 9], bl
je 0x401bf0
mov ecx, dword [esi]
lea edx, [esp + 0xe0]
lea eax, [esp + 0x2e8]
call fcn.00401860
lea eax, [esp + 0x2e8]
call fcn.0040198c
jmp 0x401bfe
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 0x401bc8
mov eax, dword [esp + 0x28]
or eax, dword [esp + 0x2c]
jne 0x401c18
mov al, 1
jmp 0x401e54
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.00401860
mov eax, dword [esp + 0x24]
cmp byte [eax + 0x19], bl
jne 0x401df6
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.00401e5b
add esp, 0x24
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e21
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 0x401e19
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 0x401d10
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 0x401dbf
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 0x401dd8
cmp byte [esp + 0x13], bl
je 0x401e12
cmp dword [esp + 0x1c], ebx
ja 0x401d01
cmp byte [esp + 0x13], bl
je 0x401e12
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x54]
jne 0x401e19
push dword [esp + 0x24]
call fcn.004018f1
test eax, eax
pop ecx
jne 0x401e19
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], 0x20
cmp eax, dword [esp + 0xbc]
jb 0x401c2d
jmp 0x401e21
or dword [esp + 0x14], 0xffffffff
jmp 0x401e21
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.00402032
push dword [esp + 0x90]
call fcn.004018f1
cmp dword [esp + 0x18], ebx
pop ecx
sete al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret