Function at 0x4087c0
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 0x41dc08
mov eax, dword fs:[0]
push eax
sub esp, 0xd8
mov eax, dword [0x424e90]
xor eax, esp
mov dword [esp + 0xd0], eax
push ebx
push esi
push edi
mov eax, dword [0x424e90]
xor eax, esp
push eax
lea eax, [esp + 0xe8]
mov dword fs:[0], eax
fldz
xor eax, eax
mov word [esp + 0x1c], ax
xor ecx, ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x30], ecx
fst qword [esp + 0x34]
fstp qword [esp + 0x6c]
xor edx, edx
fldz
mov dword [esp + 0x4c], ecx
fst dword [esp + 0x2c]
mov dword [esp + 0x50], ecx
mov word [esp + 0x20], dx
mov dword [esp + 0x5c], ecx
fst dword [esp + 0x3c]
fstp dword [esp + 0x24]
mov ax, word [0x424d70]
fld qword [0x423988]
mov dx, word [0x42392c]
dec word [0x42392c]
cwde
movsx edx, dx
sub edx, eax
mov dword [esp + 0x48], edx
fild dword [esp + 0x48]
fcompp
fnstsw ax
fld qword [0x423988]
fsub qword [0x41e348]
fstp qword [0x423988]
test ah, 0x41
jne 0x408887
mov dword [esp + 0x30], 0x85c388c9
mov dword [esp + 0x98], 0xf
mov dword [esp + 0x94], ecx
mov byte [esp + 0x84], cl
movzx eax, word [esp + 0x1c]
sub eax, 0x16c29d6e
mov word [esp + 0x1c], ax
push 0x118
mov dword [esp + 0xf4], ecx
call fcn.0040a9a1
push eax
mov dword [esp + 0x84], eax
call fcn.00402e90
mov cx, word [0x423918]
movsx edx, cx
add esp, 8
cmp edx, 0xf9d0001
jle 0x4088f0
mov eax, dword [0x423324]
mov word [0x4239a0], ax
lea ecx, [ecx]
movzx ecx, word [esp + 0x1c]
sub ecx, 0x4c8f095
push 0
mov word [esp + 0x20], cx
call fcn.0040a70a
mov esi, dword [esp + 0x54]
add esp, 4
cmp edx, esi
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], edx
jg 0x408930
jl 0x408922
cmp eax, dword [esp + 0x4c]
jae 0x408930
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 0x409285
jg 0x408952
cmp ecx, 0x708
jbe 0x409285
mov dword [esp + 0x50], edx
mov edx, dword [0x4234a4]
mov dword [esp + 0x44], edx
fild dword [esp + 0x44]
mov esi, eax
shr esi, 9
push 0x408
fadd qword [0x422508]
lea ebx, [esi + 0x55]
push 0x422090
mov dword [esp + 0x54], eax
fadd dword [esp + 0x34]
mov dword [esp + 0x50], 0
mov dword [esp + 0x60], esi
mov dword [esp + 0x1c], ebx
fmul dword [0x4225f8]
fstp dword [0x4225f8]
fld dword [esp + 0x34]
fsub qword [0x41e348]
fstp dword [esp + 0x34]
call fcn.004016a0
push 0xd
push 0x423e68
mov dword [esp + 0x78], eax
call fcn.004016a0
mov edi, eax
push 0xaf1
push 0x4227d0
mov dword [esp + 0x6c], edi
call fcn.004016a0
fld qword [0x423460]
fsub qword [0x41e7f8]
mov dword [esp + 0x5c], eax
mov ax, word [0x423884]
movsx ecx, ax
mov dword [esp + 0x58], ecx
fild dword [esp + 0x58]
fmulp st(1)
call fcn.0040a7e0
push 0x31e
push 0x423540
mov word [0x423884], ax
call fcn.004016a0
add esp, 0x20
mov dword [esp + 0x40], eax
cmp esi, ebx
je 0x408f34
mov edx, dword [0x4266a0]
push 0
push edx
call fcn.004017e0
add esp, 8
test eax, eax
jne 0x408a4e
mov eax, dword [0x4266a8]
mov ecx, dword [0x4261e4]
push eax
push ecx
call fcn.00401b10
add esp, 8
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
push edx
push eax
push ecx
lea edx, [esp + 0xa8]
push edx
call fcn.004028c0
fld qword [esp + 0x44]
fld dword [esp + 0x34]
push 0x8b
fadd qword [0x41e7f0]
push 0x4226f0
fsubp st(1)
fstp qword [esp + 0x4c]
call fcn.004016a0
inc word [0x42269c]
mov ebx, eax
mov ax, word [0x42269c]
mov cx, word [esp + 0x34]
cwde
movsx edx, cx
add edx, eax
add esp, 0x18
cmp edx, 0x7a7d8891
jne 0x408b0f
fld qword [esp + 0x34]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [esp + 0x34]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
fadd qword [0x422080]
fld qword [esp + 0x34]
fsubr qword [0x41e7e8]
fsub qword [0x423450]
fcompp
fnstsw ax
fsubr qword [0x423450]
fstp qword [0x423450]
test ah, 1
jne 0x408b53
mov cx, word [esp + 0x20]
movsx edx, cx
sub edx, 0x1aaf8fc8
mov dword [esp + 0x28], edx
dec dword [esp + 0x20]
jmp 0x408b53
fld dword [esp + 0x24]
fadd qword [0x41e348]
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
mov eax, dword [0x422774]
fsubr qword [0x41e7e0]
mov cx, word [0x424d58]
mov dword [esp + 0x10], eax
movsx edx, cx
fisub dword [esp + 0x10]
mov dword [esp + 0x10], edx
fild dword [esp + 0x10]
faddp st(1)
call fcn.0040a7e0
mov word [0x424d58], ax
mov eax, dword [esp + 0x54]
mov esi, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b60
mov edi, ebx
sub eax, esi
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x408b70
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0x2710
mov ecx, eax
push 0
and ecx, 3
lea eax, [esp + 0x88]
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xa8]
push ebx
push ecx
call fcn.00407f20
xor eax, eax
push 0x8b
push eax
mov dword [esp + 0x2c], eax
push ebx
mov dword [esp + 0x30], eax
call fcn.0040ade0
push ebx
call fcn.0040a8c4
mov eax, dword [esp + 0xa8]
add esp, 0x24
cmp dword [esp + 0x98], 0x10
jae 0x408bda
lea eax, [esp + 0x84]
mov edx, dword [esp + 0x94]
push edx
push eax
mov eax, dword [esp + 0x70]
push eax
call fcn.00407870
add esp, 0xc
cmp eax, 9
jl 0x408f04
fld qword [esp + 0x6c]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x10], ecx
fild dword [esp + 0x10]
mov ebx, 0x10
fsub qword [0x423460]
mov ecx, dword [esp + 0x84]
fsub qword [0x41e7d8]
fsubp st(1)
fstp qword [esp + 0x6c]
cmp dword [esp + 0x98], ebx
jae 0x408c37
lea ecx, [esp + 0x84]
mov edx, dword [ecx]
xor ecx, ecx
cmp ecx, dword [esp + 0x78]
jg 0x408c68
jl 0x408c49
cmp edx, dword [esp + 0x74]
jae 0x408c68
movzx edx, word [esp + 0x20]
mov eax, dword [esp + 0x28]
sub edx, eax
add edx, 0x7e8e2be0
mov word [esp + 0x20], dx
dec dword [esp + 0x28]
jmp 0x408f04
lea esi, [eax - 1]
cmp esi, dword [esp + 0x94]
jbe 0x408c79
call fcn.0040b378
mov eax, dword [esp + 0x84]
cmp dword [esp + 0x98], ebx
jae 0x408c90
lea eax, [esp + 0x84]
mov byte [eax + esi], 0
mov eax, dword [esp + 0x84]
cmp dword [esp + 0x98], ebx
jae 0x408cab
lea eax, [esp + 0x84]
lea ecx, [esp + 0x9c]
add eax, 8
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x408cd5
test dl, dl
je 0x408cd1
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x408cd5
add eax, 2
add ecx, 2
test dl, dl
jne 0x408cb5
xor eax, eax
jmp 0x408cda
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x408f04
fld qword [esp + 0x34]
fadd qword [0x41e348]
fstp qword [esp + 0x34]
mov ecx, dword [0x423f44]
mov dword [esp + 0x10], ecx
fild dword [esp + 0x10]
fsub qword [esp + 0x34]
call fcn.0040a7e0
mov edx, dword [esp + 0x98]
mov dword [0x423f44], eax
mov eax, dword [esp + 0x84]
cmp edx, ebx
jb 0x408dfd
mov edi, eax
test eax, eax
je 0x408d51
mov ecx, eax
cmp edx, ebx
jae 0x408d35
lea ecx, [esp + 0x84]
cmp ecx, edi
ja 0x408d51
cmp edx, ebx
jae 0x408d44
lea eax, [esp + 0x84]
mov edx, dword [esp + 0x94]
add eax, edx
cmp edi, eax
jbe 0x408d56
call fcn.0040b378
add dword [0x422660], 0x564ac4a5
lea esi, [esp + 0x80]
mov dword [esp + 0x64], edi
jmp 0x408d70
mov edx, dword [esp + 0x98]
mov ebx, dword [esp + 0x84]
mov eax, ebx
cmp edx, 0x10
jae 0x408d8c
lea eax, [esp + 0x84]
mov ecx, dword [esp + 0x94]
lea edi, [eax + ecx]
test edi, edi
je 0x408dc0
mov eax, ebx
cmp edx, 0x10
jae 0x408da8
lea eax, [esp + 0x84]
cmp eax, edi
ja 0x408dc0
mov eax, ebx
cmp edx, 0x10
jae 0x408dba
lea eax, [esp + 0x84]
add eax, ecx
cmp edi, eax
jbe 0x408dc5
call fcn.0040b378
cmp esi, 0xfffffffc
je 0x408dde
test esi, esi
je 0x408dd9
lea eax, [esp + 0x80]
cmp esi, eax
je 0x408dde
call fcn.0040b378
cmp dword [esp + 0x64], edi
je 0x408e58
cmp esi, 0xfffffffc
je 0x408e1c
test esi, esi
jne 0x408df2
call fcn.0040b378
cmp dword [esi + 0x18], 0x10
jb 0x408e09
mov eax, dword [esi + 4]
jmp 0x408e0c
lea edi, [esp + 0x84]
jmp 0x408d28
lea eax, [esi + 4]
mov ecx, dword [esi + 0x14]
add ecx, eax
cmp dword [esp + 0x64], ecx
jb 0x408e1c
call fcn.0040b378
mov edx, dword [esp + 0x64]
mov byte [edx], 0
cmp esi, 0xfffffffc
je 0x408e4f
test esi, esi
jne 0x408e31
call fcn.0040b378
cmp dword [esi + 0x18], 0x10
jb 0x408e3c
mov eax, dword [esi + 4]
jmp 0x408e3f
lea eax, [esi + 4]
mov ecx, dword [esi + 0x14]
add ecx, eax
cmp dword [esp + 0x64], ecx
jb 0x408e4f
call fcn.0040b378
inc dword [esp + 0x64]
jmp 0x408d70
push 0x7e
push 0x4226f0
call fcn.004016a0
xor ebx, ebx
push ebx
push ebx
lea edx, [esp + 0x90]
mov esi, eax
push edx
lea eax, [esp + 0xb0]
push esi
push eax
call fcn.00407f20
fld qword [0x4224c0]
fsub qword [0x41e7d0]
push 0x7e
push ebx
push esi
fadd qword [esp + 0x5c]
fstp qword [esp + 0x5c]
mov dword [esp + 0x38], ebx
mov dword [esp + 0x38], ebx
call fcn.0040ade0
push esi
call fcn.0040a8c4
push 0xc
push 0x4232cc
call fcn.004016a0
add esp, 0x34
mov esi, eax
lea ecx, [eax + 1]
nop
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x408ec0
sub eax, ecx
push eax
push 0xffffffffffffffff
push esi
lea ecx, [esp + 0x8c]
call fcn.00404130
mov edi, eax
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esp + 0x10], ebx
push esi
mov dword [esp + 0x14], ebx
mov dword [esi + 8], eax
call fcn.0040a8c4
mov ecx, dword [esp + 0x98]
add ecx, 0xfffffff5
add esp, 4
cmp edi, ecx
je 0x408f19
mov eax, dword [esp + 0x58]
inc eax
mov dword [esp + 0x58], eax
cmp eax, dword [esp + 0x14]
jne 0x408a24
jmp 0x408f30
push 0xb
push edi
lea ecx, [esp + 0x88]
call fcn.00405220
mov dword [esp + 0x48], 1
mov edi, dword [esp + 0x54]
mov ebx, dword [esp + 0x68]
xor esi, esi
push 0x408
push esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x1c], esi
push ebx
call fcn.0040ade0
push ebx
call fcn.0040a8c4
inc dword [esp + 0x6c]
mov edx, dword [esp + 0x6c]
add esp, 0x10
cmp edx, 0xfa136e5d
jne 0x408fd9
dec word [0x422088]
fld qword [0x423ef0]
mov ax, word [0x422088]
movsx ecx, ax
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fsubp st(1)
fsub qword [0x41e7c8]
fcomp qword [0x41e7c0]
fnstsw ax
test ah, 1
jne 0x408faa
fld dword [esp + 0x2c]
fadd qword [0x41e7b8]
fstp dword [esp + 0x2c]
jmp 0x408fd9
fld qword [0x424b38]
fadd qword [0x41e348]
fstp qword [0x424b38]
fld qword [0x424b38]
fsub qword [0x41e7b0]
fadd qword [0x41e7a8]
call fcn.0040a7e0
mov word [0x42208c], ax
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x14], esi
push edi
mov byte [edi + 0xc], al
call fcn.0040a8c4
mov edx, dword [0x4224b8]
mov edi, dword [esp + 0x44]
imul edx, edx, 0xa85d821f
push 0x31e
mov dword [0x4224b8], edx
push esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x20], esi
push edi
call fcn.0040ade0
push edi
call fcn.0040a8c4
mov edi, dword [esp + 0x58]
push 0xaf1
push esi
mov dword [esp + 0x30], esi
push edi
mov dword [esp + 0x34], esi
call fcn.0040ade0
push edi
call fcn.0040a8c4
push 0x40
lea eax, [esp + 0xc4]
push esi
push eax
call fcn.0040ade0
add esp, 0x30
cmp dword [esp + 0x48], esi
je 0x409285
mov ecx, dword [esp + 0x7c]
push 0x708
push ecx
call fcn.00401fc0
add esp, 8
cmp dword [esp + 0x94], 0x200
jbe 0x409251
push 0x370
call fcn.0040a9a1
fld dword [0x4225fc]
fadd qword [0x41e7a0]
mov ebx, eax
add esp, 4
fcomp qword [0x41e798]
fnstsw ax
fld dword [0x4225fc]
fadd qword [0x41e348]
fstp dword [0x4225fc]
test ah, 5
jp 0x4090d2
fld dword [esp + 0x3c]
fsub qword [0x41e790]
fmul dword [0x4227a0]
fstp dword [0x4227a0]
push ebx
push 0xeb
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push ebx
call fcn.00403500
push 3
push 0x42397c
call fcn.004016a0
mov esi, eax
push esi
push ebx
call fcn.0040b204
mov edi, eax
xor eax, eax
mov dword [esp + 0x2c], eax
mov word [esi], ax
push esi
mov dword [esp + 0x30], eax
mov byte [esi + 2], al
call fcn.0040a8c4
mov eax, dword [esp + 0xa0]
add esp, 0x1c
cmp dword [esp + 0x98], 0x10
jae 0x409133
lea eax, [esp + 0x84]
mov edx, dword [esp + 0x94]
push edi
push 1
push edx
push eax
call fcn.0040b0be
push edi
call fcn.0040aee0
fld dword [0x423878]
fadd qword [0x41e788]
add esp, 0x14
push 0x104
lea eax, [ebx + 0x104]
fsub qword [0x41e780]
push eax
push 0
fadd qword [esp + 0x78]
fstp qword [esp + 0x78]
fld dword [0x423878]
fsub qword [0x41e348]
fstp dword [0x423878]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x15
push 0x422618
call fcn.004016a0
push 0x20
push 0x423470
mov edi, eax
call fcn.004016a0
mov esi, eax
mov eax, dword [0x4266a0]
push eax
push esi
lea eax, [ebx + 0x104]
push eax
push edi
lea eax, [ebx + 0x208]
push 0x168
push eax
call fcn.0040b76e
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
mov dword [esp + 0x3c], eax
mov dword [esi + 0x18], eax
mov dword [esp + 0x3c], eax
push esi
mov dword [esi + 0x1c], eax
call fcn.0040a8c4
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
xor esi, esi
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], eax
mov dword [esp + 0x40], esi
push edi
mov dword [esp + 0x44], esi
mov byte [edi + 0x14], al
call fcn.0040a8c4
mov ecx, dword [0x4266a0]
push 1
push ecx
call fcn.004017e0
lea eax, [ebx + 0x208]
push eax
push ebx
call fcn.00401b10
add esp, 0x40
push 0x370
push esi
push ebx
call fcn.0040ade0
push ebx
call fcn.0040a8c4
add esp, 0x10
push 0x15f90
call dword [sym.imp.KERNEL32.dll_Sleep]
fld dword [esp + 0x24]
fsub qword [0x41e348]
fstp dword [esp + 0x24]
inc dword [esp + 0x20]
fld dword [esp + 0x24]
mov dx, word [esp + 0x20]
movsx eax, dx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
faddp st(1)
fadd dword [0x423e64]
fstp dword [0x423e64]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fld dword [esp + 0x3c]
mov dx, word [0x423884]
fadd qword [0x41e778]
movsx eax, dx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
faddp st(1)
fsubp st(1)
call fcn.0040a7e0
mov dword [esp + 0x30], eax
dec word [0x423884]
fld qword [0x4224d0]
mov ecx, dword [0x4224fc]
mov edx, 0x72b869e
sub edx, ecx
mov dword [esp + 0x14], edx
fild dword [esp + 0x14]
fcompp
fnstsw ax
fld qword [0x4224d0]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [0x4224d0]
test ah, 0x41
jp 0x40932d
mov eax, dword [esp + 0x30]
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
fld dword [esp + 0x3c]
fadd qword [0x41e770]
fsubp st(1)
call fcn.0040a7e0
mov dword [esp + 0x30], eax
fadd dword [esp + 0x3c]
fstp dword [esp + 0x3c]
jmp 0x409339
fstp st(0)
fld qword [0x424d68]
fstp qword [esp + 0x34]
mov ecx, dword [0x4266a0]
push 0
push ecx
call fcn.004017e0
add esp, 8
test eax, eax
jne 0x4088f0
mov edx, dword [0x4266a8]
mov eax, dword [0x4261e4]
push edx
push eax
call fcn.00401b10
add esp, 8
jmp 0x4088f0