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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41e298
mov eax, dword fs:[0]
push eax
sub esp, 0xe0
mov eax, dword [0x426110]
xor eax, esp
mov dword [esp + 0xd8], eax
push ebx
push esi
push edi
mov eax, dword [0x426110]
xor eax, esp
push eax
lea eax, [esp + 0xf0]
mov dword fs:[0], eax
fldz
xor esi, esi
fst qword [esp + 0x2c]
xor eax, eax
fldz
mov dword [esp + 0x5c], esi
mov word [esp + 0x40], ax
mov dword [esp + 0x60], esi
fst dword [esp + 0x24]
xor ecx, ecx
fxch st(1)
mov word [esp + 0x20], cx
fst qword [esp + 0x6c]
fstp qword [esp + 0x6c]
xor edx, edx
mov word [esp + 0x28], dx
mov dword [esp + 0x4c], esi
fstp dword [esp + 0x58]
mov ax, word [esp + 0x20]
movsx ecx, ax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x50], esi
fild dword [esp + 0x48]
fld dword [esp + 0x24]
fadd qword [esp + 0x2c]
fsubp st(1)
call fcn.0040b030
mov word [esp + 0x20], ax
fld qword [esp + 0x2c]
fsub qword [0x41f348]
mov dword [esp + 0xa0], 0xf
mov dword [esp + 0x9c], esi
mov byte [esp + 0x8c], 0
fstp qword [esp + 0x2c]
push 0x118
mov dword [esp + 0xfc], esi
call fcn.0040af5c
push eax
mov dword [esp + 0x8c], eax
call fcn.00402710
add esp, 8
mov edi, edi
push 0
call fcn.0040adaa
mov esi, dword [esp + 0x54]
add esp, 4
cmp edx, esi
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], edx
jg 0x409033
jl 0x409025
cmp eax, dword [esp + 0x4c]
jae 0x409033
xor esi, esi
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], esi
mov ecx, eax
sub ecx, dword [esp + 0x4c]
mov edi, edx
sbb edi, esi
mov dword [esp + 0x18], edi
js 0x40993b
jg 0x409055
cmp ecx, 0x708
jbe 0x40993b
fld qword [0x423f60]
mov dword [esp + 0x50], edx
mov edx, dword [esp + 0x60]
mov dword [esp + 0x44], edx
fild dword [esp + 0x44]
mov esi, eax
shr esi, 9
push 0x408
fsubp st(1)
lea ebx, [esi + 0x55]
push 0x424430
mov dword [esp + 0x54], eax
fstp qword [0x423f60]
inc dword [esp + 0x68]
mov dword [esp + 0x50], 0
mov dword [esp + 0x6c], esi
mov dword [esp + 0x1c], ebx
call fcn.00402370
push 0xd
push 0x4256a8
mov dword [esp + 0x88], eax
call fcn.00402370
mov edi, eax
push 0xaf1
push 0x423148
mov dword [esp + 0x6c], edi
call fcn.00402370
push 0x31e
push 0x4240f8
mov dword [esp + 0x64], eax
call fcn.00402370
add esp, 0x20
mov dword [esp + 0x68], eax
cmp esi, ebx
je 0x4095b2
lea esp, [esp]
mov eax, dword [0x427920]
push 0
push eax
call fcn.00401c80
add esp, 8
test eax, eax
jne 0x40911a
mov ecx, dword [0x427928]
mov edx, dword [0x427464]
push ecx
push edx
call fcn.00401170
add esp, 8
fld qword [0x4255e8]
fsub qword [0x41f348]
fstp qword [0x4255e8]
mov eax, dword [0x425fc8]
mov dword [esp + 0x34], eax
fild dword [esp + 0x34]
fadd qword [0x4255e8]
fsub dword [0x423f20]
call fcn.0040b030
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x68]
push ecx
mov dword [0x423fe0], eax
mov eax, dword [esp + 0x48]
push edx
push eax
lea ecx, [esp + 0xb0]
push ecx
call fcn.00403c30
push 0x8b
push 0x424898
call fcn.00402370
mov ebx, eax
mov eax, dword [esp + 0x6c]
add esp, 0x18
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409185
mov edi, ebx
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409191
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0x2710
push 0
lea edx, [esp + 0x90]
push edx
mov ecx, eax
lea eax, [esp + 0xb0]
and ecx, 3
push ebx
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.004085b0
push 0x8b
fldz
push 0
fstp qword [esp + 0x50]
push ebx
mov dword [esp + 0x54], 0
call fcn.0040b450
push ebx
call fcn.0040ae7f
mov eax, dword [esp + 0xb0]
add esp, 0x24
cmp dword [esp + 0xa0], 0x10
jae 0x409200
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
mov edx, dword [esp + 0x78]
push ecx
push eax
push edx
call fcn.00407ef0
fld qword [0x4256f8]
fcomp qword [0x41f938]
mov edx, eax
add esp, 0xc
fnstsw ax
test ah, 0x44
jnp 0x40924d
mov ax, word [esp + 0x20]
movsx ecx, ax
sub ecx, 0x4a7db47a
mov dword [esp + 0x34], ecx
fild dword [esp + 0x34]
fstp dword [0x424988]
dec dword [esp + 0x20]
jmp 0x409268
inc dword [esp + 0x5c]
mov eax, dword [esp + 0x5c]
add eax, 0xa4db46b
mov dword [esp + 0x34], eax
fild dword [esp + 0x34]
fstp dword [0x425a2c]
cmp edx, 9
jl 0x409539
mov eax, dword [esp + 0x8c]
mov edi, 0x10
cmp dword [esp + 0xa0], edi
jae 0x40928d
lea eax, [esp + 0x8c]
mov ecx, dword [eax]
xor eax, eax
cmp eax, dword [esp + 0x80]
jl 0x409539
jg 0x4092aa
cmp ecx, dword [esp + 0x7c]
jb 0x409539
lea esi, [edx - 1]
cmp esi, dword [esp + 0x9c]
jbe 0x4092bb
call fcn.0040b671
mov eax, dword [esp + 0x8c]
cmp dword [esp + 0xa0], edi
jae 0x4092d2
lea eax, [esp + 0x8c]
mov byte [eax + esi], 0
mov esi, dword [esp + 0xa0]
mov ebx, dword [esp + 0x8c]
mov eax, ebx
cmp esi, edi
jae 0x4092f1
lea eax, [esp + 0x8c]
lea ecx, [esp + 0xa4]
add eax, 8
jmp 0x409300
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409320
test dl, dl
je 0x40931c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409320
add eax, 2
add ecx, 2
test dl, dl
jne 0x409300
xor eax, eax
jmp 0x409325
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x409539
cmp esi, edi
jb 0x409409
mov edi, ebx
test ebx, ebx
je 0x409368
mov eax, ebx
cmp esi, 0x10
jae 0x409349
lea eax, [esp + 0x8c]
cmp eax, edi
ja 0x409368
mov eax, ebx
cmp esi, 0x10
jae 0x40935b
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
add eax, ecx
cmp edi, eax
jbe 0x409374
call fcn.0040b671
mov ecx, dword [esp + 0x9c]
lea esi, [esp + 0x88]
mov ebx, edi
mov edx, dword [esp + 0xa0]
mov eax, dword [esp + 0x8c]
cmp edx, 0x10
jae 0x409397
lea eax, [esp + 0x8c]
lea edi, [eax + ecx]
test edi, edi
je 0x4093ce
mov eax, dword [esp + 0x8c]
cmp edx, 0x10
jae 0x4093b1
lea eax, [esp + 0x8c]
cmp eax, edi
ja 0x4093ce
mov eax, dword [esp + 0x8c]
cmp edx, 0x10
jae 0x4093c8
lea eax, [esp + 0x8c]
add eax, ecx
cmp edi, eax
jbe 0x4093d3
call fcn.0040b671
cmp esi, 0xfffffffc
je 0x4093ec
test esi, esi
je 0x4093e7
lea ecx, [esp + 0x88]
cmp esi, ecx
je 0x4093ec
call fcn.0040b671
cmp ebx, edi
je 0x409460
cmp esi, 0xfffffffc
je 0x409426
test esi, esi
jne 0x4093fe
call fcn.0040b671
cmp dword [esi + 0x18], 0x10
jb 0x409415
mov eax, dword [esi + 4]
jmp 0x409418
lea edi, [esp + 0x8c]
jmp 0x40933b
lea eax, [esi + 4]
mov edx, dword [esi + 0x14]
add edx, eax
cmp ebx, edx
jb 0x409426
call fcn.0040b671
mov byte [ebx], 0
cmp esi, 0xfffffffc
je 0x409453
test esi, esi
jne 0x409437
call fcn.0040b671
cmp dword [esi + 0x18], 0x10
jb 0x409442
mov eax, dword [esi + 4]
jmp 0x409445
lea eax, [esi + 4]
mov ecx, dword [esi + 0x14]
add ecx, eax
cmp ebx, ecx
jb 0x409453
call fcn.0040b671
mov ecx, dword [esp + 0x9c]
inc ebx
jmp 0x40937d
fld dword [0x423140]
push 0x7e
fmul qword [0x425fc0]
push 0x424898
fstp dword [0x423140]
call fcn.00402370
xor ebx, ebx
push ebx
push ebx
lea edx, [esp + 0x98]
mov esi, eax
push edx
lea eax, [esp + 0xb8]
push esi
push eax
call fcn.004085b0
fld dword [esp + 0x74]
fsub qword [0x41f930]
push 0x7e
push ebx
push esi
fstp dword [esp + 0x80]
fldz
fstp qword [esp + 0x5c]
mov dword [esp + 0x5c], ebx
call fcn.0040b450
push esi
call fcn.0040ae7f
push 0xc
push 0x423c60
call fcn.00402370
fld dword [0x423f20]
fld qword [esp + 0xa0]
add esp, 0x34
fsub qword [0x425fd0]
mov esi, eax
lea ecx, [eax + 1]
fsubp st(1)
fstp dword [0x423f20]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4094f3
sub eax, ecx
push eax
push 0xffffffffffffffff
push esi
lea ecx, [esp + 0x94]
call fcn.00404af0
fldz
mov edi, eax
fstp qword [esp + 0x34]
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
push esi
mov dword [esp + 0x38], ebx
mov dword [esi + 8], eax
call fcn.0040ae7f
mov ecx, dword [esp + 0xa0]
add ecx, 0xfffffff5
add esp, 4
cmp edi, ecx
je 0x40954e
mov eax, dword [esp + 0x64]
inc eax
mov dword [esp + 0x64], eax
cmp eax, dword [esp + 0x14]
jne 0x4090f0
jmp 0x4095ae
fld dword [0x41f928]
push 0xb
fstp dword [esp + 0x28]
push edi
lea ecx, [esp + 0x90]
call fcn.00406670
fld qword [esp + 0x2c]
fsub qword [0x41f348]
fstp qword [esp + 0x2c]
mov dx, word [esp + 0x40]
movsx eax, dx
mov dword [esp + 0x14], eax
mov eax, 1
mov dword [esp + 0x48], eax
fild dword [esp + 0x14]
fadd qword [esp + 0x2c]
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
add dword [esp + 0x40], eax
movzx ecx, word [esp + 0x40]
imul ecx, ecx, 0xba569323
mov word [esp + 0x40], cx
mov edi, dword [esp + 0x54]
fldz
mov ebx, dword [esp + 0x78]
xor esi, esi
fstp qword [esp + 0x14]
push 0x408
push esi
mov dword [esp + 0x1c], esi
push ebx
call fcn.0040b450
push ebx
call fcn.0040ae7f
fldz
xor eax, eax
fstp qword [esp + 0x24]
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [esp + 0x24], esi
push edi
mov byte [edi + 0xc], al
call fcn.0040ae7f
fldz
mov edi, dword [esp + 0x7c]
fstp qword [esp + 0x28]
push 0x31e
push esi
mov dword [esp + 0x30], esi
push edi
call fcn.0040b450
push edi
call fcn.0040ae7f
fldz
mov edi, dword [esp + 0x68]
fstp qword [esp + 0x38]
push 0xaf1
push esi
push edi
mov dword [esp + 0x44], esi
call fcn.0040b450
push edi
call fcn.0040ae7f
push 0x40
lea edx, [esp + 0xdc]
push esi
push edx
call fcn.0040b450
add esp, 0x40
cmp dword [esp + 0x48], esi
je 0x4098e9
mov eax, dword [esp + 0x84]
push 0x708
push eax
call fcn.00403b70
add esp, 8
cmp dword [esp + 0x9c], 0x200
jbe 0x4098dd
movzx ecx, word [0x423f88]
imul ecx, ecx, 0x5f950014
mov word [0x423f88], cx
push 0x370
call fcn.0040af5c
mov ebx, eax
fld dword [0x423cf8]
mov edx, dword [0x423c58]
mov dword [esp + 0x18], edx
add esp, 4
fisub dword [esp + 0x14]
fstp dword [0x423cf8]
inc dword [0x423c58]
fld dword [0x4256a0]
fsubr qword [0x41f920]
fcomp qword [0x41f918]
fnstsw ax
test ah, 0x44
jnp 0x409702
mov ax, word [0x425564]
movsx ecx, ax
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fadd qword [esp + 0x2c]
fadd qword [esp + 0x2c]
fstp qword [esp + 0x2c]
dec word [0x425564]
fld qword [esp + 0x2c]
fadd qword [0x41f348]
fstp qword [esp + 0x2c]
push ebx
push 0xeb
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push ebx
call fcn.00404220
push 3
push 0x424080
call fcn.00402370
mov esi, eax
push esi
push ebx
call fcn.0040bc1e
mov edx, dword [0x4256c4]
mov dword [esp + 0x2c], edx
fild dword [esp + 0x2c]
mov edi, eax
xor eax, eax
push esi
fstp qword [esp + 0x88]
inc dword [0x4256c4]
fldz
mov word [esi], ax
fstp qword [esp + 0x88]
mov byte [esi + 2], al
mov dword [esp + 0x30], eax
call fcn.0040ae7f
mov eax, dword [esp + 0xa8]
add esp, 0x1c
cmp dword [esp + 0xa0], 0x10
jae 0x409783
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
push edi
push 1
push ecx
push eax
call fcn.0040be46
push edi
call fcn.0040b7c4
add esp, 0x14
push 0x104
lea eax, [ebx + 0x104]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x15
push 0x424048
call fcn.00402370
push 0x20
push 0x4255f0
mov edi, eax
call fcn.00402370
mov edx, dword [0x427920]
push edx
mov esi, eax
push esi
lea eax, [ebx + 0x104]
push eax
push edi
lea eax, [ebx + 0x208]
push 0x168
push eax
call fcn.0040bc35
movzx eax, word [esp + 0x50]
movsx ecx, ax
xor eax, eax
mov edx, 0x587224a4
sub edx, ecx
mov dword [esi], eax
mov dword [esp + 0x3c], edx
mov dword [esi + 4], eax
mov dword [esi + 8], eax
fild dword [esp + 0x3c]
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
fstp qword [esp + 0x94]
mov dword [esi + 0x18], eax
fldz
push esi
fstp qword [esp + 0x40]
mov dword [esp + 0x40], eax
mov dword [esi + 0x1c], eax
call fcn.0040ae7f
movzx eax, word [0x42406c]
fldz
movzx ecx, word [esp + 0x54]
cwde
sub ecx, eax
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
sub ecx, 0x7d51f2b8
mov word [esp + 0x54], cx
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], eax
fstp qword [esp + 0x40]
mov dword [esp + 0x40], eax
push edi
mov byte [edi + 0x14], al
call fcn.0040ae7f
mov edx, dword [0x427920]
push 1
push edx
call fcn.00401c80
lea eax, [ebx + 0x208]
push eax
push ebx
call fcn.00401170
fld qword [esp + 0x6c]
add esp, 0x40
fadd qword [0x41f910]
fcomp qword [0x41f908]
fnstsw ax
test ah, 1
jne 0x4098bc
mov eax, dword [0x423c44]
add eax, 0x4f86cb5f
mov dword [0x423f70], eax
inc dword [0x423c44]
push 0x370
push 0
push ebx
call fcn.0040b450
push ebx
call fcn.0040ae7f
add esp, 0x10
push 0x15f90
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, 0xfffff478
mov word [0x425a58], cx
fld qword [0x425750]
fadd qword [0x41f900]
fld dword [0x425fe4]
mov dx, word [0x425684]
movsx eax, dx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
faddp st(1)
fld dword [esp + 0x24]
fsubp st(2)
fadd qword [esp + 0x2c]
inc word [0x425684]
fcompp
fnstsw ax
test ah, 0x41
jne 0x40993b
fld dword [esp + 0x58]
fadd qword [0x41f8f8]
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
movzx ecx, word [esp + 0x20]
mov edx, 0x4a535e4b
sub edx, ecx
mov word [esp + 0x20], dx
dec dword [esp + 0x20]
mov eax, dword [0x427920]
push 0
push eax
call fcn.00401c80
add esp, 8
test eax, eax
jne 0x409000
mov ecx, dword [0x427928]
mov edx, dword [0x427464]
push ecx
push edx
call fcn.00401170
jmp 0x408ffb