Function at 0x401a4f
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 0x401a8d
xor al, al
jmp 0x401e74
mov dword [esp + 0x88], 0x401921
mov dword [esp + 0x8c], 0x401950
mov dword [esp + 0x48], 0x4039f8
mov dword [esp + 0x4c], 0x403a0f
mov dword [esp + 0x80], 0x4039f8
mov dword [esp + 0x84], 0x403a0f
call fcn.00403a1a
lea eax, [esp + 0xa0]
call fcn.0040203e
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x54]
call fcn.004039cb
add esp, 0xc
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e50
mov ecx, dword [ebp + 0x10]
or dword [esp + 0x9c], 0xffffffff
cmp ecx, ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x98], ebx
je 0x401b35
fldz
mov eax, dword [ecx]
push 0x401844
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.00406260
add esp, 0xc
push esi
lea eax, [esp + 0xe6]
push ebx
push eax
mov word [esp + 0xec], bx
call fcn.00406260
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
add esp, 0xc
cmp dword [ebp + 0xc], ebx
lea eax, [esp + 0xe0]
jne 0x401b96
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
jmp 0x401ba4
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 0x401bad
cmp word [esp + ecx*2 + 0xde], 0x5c
je 0x401bcf
push 0x401848
lea eax, [esp + 0xe4]
push eax
call esi
mov eax, dword [esp + 0xbc]
cmp eax, ebx
jbe 0x401c31
mov esi, dword [esp + 0xb0]
add esi, 0x10
mov dword [esp + 0x18], eax
cmp byte [esi + 9], bl
je 0x401c10
mov ecx, dword [esi]
lea edx, [esp + 0xe0]
lea eax, [esp + 0x2e8]
call fcn.00401880
lea eax, [esp + 0x2e8]
call fcn.004019ac
jmp 0x401c1e
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 0x401be8
mov eax, dword [esp + 0x28]
or eax, dword [esp + 0x2c]
jne 0x401c38
mov al, 1
jmp 0x401e74
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.00401880
mov eax, dword [esp + 0x24]
cmp byte [eax + 0x19], bl
jne 0x401e16
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.00401e7b
add esp, 0x24
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x401e41
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 0x401e39
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 0x401d30
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 0x401ddf
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 0x401df8
cmp byte [esp + 0x13], bl
je 0x401e32
cmp dword [esp + 0x1c], ebx
ja 0x401d21
cmp byte [esp + 0x13], bl
je 0x401e32
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x54]
jne 0x401e39
push dword [esp + 0x24]
call fcn.00401911
test eax, eax
pop ecx
jne 0x401e39
inc dword [esp + 0x20]
mov eax, dword [esp + 0x20]
add dword [esp + 0x18], 0x20
cmp eax, dword [esp + 0xbc]
jb 0x401c4d
jmp 0x401e41
or dword [esp + 0x14], 0xffffffff
jmp 0x401e41
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.00402052
push dword [esp + 0x90]
call fcn.00401911
cmp dword [esp + 0x18], ebx
pop ecx
sete al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret