Function at 0x40d140
Capabilities:
Check if file exists
Get common file path
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x45832c
mov eax, dword fs:[0]
push eax
sub esp, 0xa64
mov eax, dword [0x46e3d0]
xor eax, esp
mov dword [esp + 0xa60], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x46e3d0]
xor eax, esp
push eax
lea eax, [esp + 0xa78]
mov dword fs:[0], eax
xor ebx, ebx
push 0x206
lea eax, [esp + 0x72]
push ebx
push eax
mov edi, ecx
xor ebp, ebp
mov word [esp + 0x78], bx
call fcn.00443e10
add esp, 0xc
lea ecx, [esp + 0x6c]
push ecx
push ebx
push ebx
push 0x25
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
cmp eax, ebx
jl 0x40d30f
push str.rundll32.exe
lea edx, [esp + 0x70]
push edx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
test eax, eax
je 0x40d30f
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d30f
lea ecx, [esp + 0x6c]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x40d30f
lea edx, [esp + 0x6c]
call fcn.0040ebe0
mov edx, dword [edi]
push edx
push str.strRunDll32ExeFilePath___s_n
push 0x400
lea eax, [esp + 0x280]
push 0x200
push eax
call fcn.0043ef21
add esp, 0x14
lea ecx, [esp + 0x50]
call fcn.0042a750
mov dword [esp + 0xa80], ebx
mov edi, 7
lea eax, [esp + 0x274]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d246
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x278]
push ecx
lea esi, [esp + 0x20]
call fcn.00406f20
mov edx, esi
push ebx
push edx
or eax, 0xffffffff
lea esi, [esp + 0x58]
mov byte [esp + 0xa88], 1
call fcn.00406d90
mov ebp, 8
cmp dword [esp + 0x30], ebp
jb 0x40d297
mov eax, dword [esp + 0x1c]
push eax
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0x68], ebp
mov edx, dword [esp + 0x54]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40d2b2
lea edx, [esp + 0x54]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40d2ec
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d2c1
sub eax, esi
sar eax, 1
push edi
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.0043fe21
mov edx, dword [0x471b30]
push edx
call fcn.004402ef
add esp, 0x14
mov dword [esp + 0xa80], 0xffffffff
cmp dword [esp + 0x68], ebp
jb 0x40d30a
mov eax, dword [esp + 0x54]
push eax
call fcn.0043ef40
add esp, 4
mov ebp, 1
push ebp
push str.bSuc___ld_n
push 0x400
lea ecx, [esp + 0x680]
push 0x200
push ecx
call fcn.0043ef21
add esp, 0x14
lea ecx, [esp + 0x34]
call fcn.0042a750
mov dword [esp + 0xa80], 2
mov edi, 7
lea eax, [esp + 0x674]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d360
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x678]
push edx
lea esi, [esp + 0x20]
call fcn.00406f20
mov eax, esi
push ebx
push eax
or eax, 0xffffffff
lea esi, [esp + 0x3c]
mov byte [esp + 0xa88], 3
call fcn.00406d90
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x40d3b1
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0x4c], esi
mov edx, dword [esp + 0x38]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40d3cc
lea edx, [esp + 0x38]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40d40f
mov eax, edx
lea esi, [eax + 2]
jmp 0x40d3e0
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d3e0
sub eax, esi
sar eax, 1
push edi
add eax, eax
push eax
push 1
push edx
call fcn.0043fe21
mov ecx, dword [0x471b30]
push ecx
call fcn.004402ef
add esp, 0x14
mov esi, 8
cmp dword [esp + 0x4c], esi
jb 0x40d422
mov edx, dword [esp + 0x38]
push edx
call fcn.0043ef40
add esp, 4
mov eax, ebp
mov ecx, dword [esp + 0xa78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xa60]
xor ecx, esp
call fcn.0043ef12
add esp, 0xa70
ret