Function at 0x401aff
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, closesocket
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x90], eax
jne 0x401b3d
xor al, al
jmp 0x401f24
mov dword [esp + 0x88], 0x4019d1
mov dword [esp + 0x8c], 0x401a00
mov dword [esp + 0x48], 0x403ab3
mov dword [esp + 0x4c], 0x403aa8
mov dword [esp + 0x80], 0x403ab3
mov dword [esp + 0x84], 0x403aa8
call fcn.00403aca
lea eax, [esp + 0xa0]
call fcn.004020ee
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x54]
call fcn.00403a7b
add esp, 0xc
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401f00
mov ecx, dword [ebp + 0x10]
or dword [esp + 0x9c], 0xffffffff
cmp ecx, ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x98], ebx
je 0x401be5
fldz
mov eax, dword [ecx]
push 0x4018f4
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.00406310
add esp, 0xc
push esi
lea eax, [esp + 0xe6]
push ebx
push eax
mov word [esp + 0xec], bx
call fcn.00406310
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
add esp, 0xc
cmp dword [ebp + 0xc], ebx
lea eax, [esp + 0xe0]
jne 0x401c46
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
jmp 0x401c54
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 0x401c5d
cmp word [esp + ecx*2 + 0xde], 0x5c
je 0x401c7f
push 0x4018f8
lea eax, [esp + 0xe4]
push eax
call esi
mov eax, dword [esp + 0xbc]
cmp eax, ebx
jbe 0x401ce1
mov esi, dword [esp + 0xb0]
add esi, 0x10
mov dword [esp + 0x18], eax
cmp byte [esi + 9], bl
je 0x401cc0
mov ecx, dword [esi]
lea edx, [esp + 0xe0]
lea eax, [esp + 0x2e8]
call fcn.00401930
lea eax, [esp + 0x2e8]
call fcn.00401a5c
jmp 0x401cce
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 0x401c98
mov eax, dword [esp + 0x28]
or eax, dword [esp + 0x2c]
jne 0x401ce8
mov al, 1
jmp 0x401f24
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
mov esi, closesocket
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.00401930
mov eax, dword [esp + 0x24]
cmp byte [eax + 0x19], bl
jne 0x401ec6
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.00401f2b
add esp, 0x24
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401ef1
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 0x401ee9
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 0x401de0
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 0x401e8f
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 0x401ea8
cmp byte [esp + 0x13], bl
je 0x401ee2
cmp dword [esp + 0x1c], ebx
ja 0x401dd1
cmp byte [esp + 0x13], bl
je 0x401ee2
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x54]
jne 0x401ee9
push dword [esp + 0x24]
call fcn.004019c1
test eax, eax
pop ecx
jne 0x401ee9
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], 0x20
cmp eax, dword [esp + 0xbc]
jb 0x401cfd
jmp 0x401ef1
or dword [esp + 0x14], 0xffffffff
jmp 0x401ef1
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.00402102
push dword [esp + 0x90]
call fcn.004019c1
cmp dword [esp + 0x18], ebx
pop ecx
sete al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret