Function at 0x412da0
Capabilities:
Get common file path
Get file size
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x43bb4c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x174
mov eax, dword [0x44b754]
xor eax, esp
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x194]
mov dword [esp + 0x180], eax
mov eax, dword [edi + 0x518]
cmp eax, 1
mov dword [esp + 0x18], edi
jae 0x412df4
mov ecx, 0x44c660
call fcn.00404d90
xor al, al
jmp 0x413143
push 0x2000
call fcn.0042a127
mov dword [esp + 0x14], eax
mov eax, dword [edi]
mov ecx, dword [eax + 0x28]
add esp, 4
xor ebx, ebx
push ebx
call fcn.004173d0
mov ecx, dword [edi]
mov ecx, dword [ecx + 0x28]
push str.Merge_installer_files...
call fcn.00417370
mov edx, dword [edi]
mov ecx, dword [edx + 0x28]
push ebx
call fcn.004173f0
lea eax, [esp + 0x7c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov ebp, 0xf
mov dword [esp + 0x78], ebp
mov dword [esp + 0x74], ebx
mov byte [esp + 0x64], bl
lea eax, [esp + 0x7c]
mov dword [esp + 0x18c], ebx
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x412e67
sub eax, ecx
push eax
lea ecx, [esp + 0x80]
push ecx
lea ecx, [esp + 0x4c]
call fcn.00403210
push str.mabinogi_setup.cab
lea edx, [esp + 0x48]
push edx
lea eax, [esp + 0x30]
push eax
mov byte [esp + 0x198], 1
call fcn.00412cf0
add esp, 0xc
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x6c]
mov byte [esp + 0x198], 2
call fcn.00403120
mov eax, dword [esp + 0x40]
mov esi, 0x10
cmp eax, esi
jb 0x412ed0
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.0042bb52
add esp, 4
cmp dword [esp + 0x5c], esi
mov dword [esp + 0x40], ebp
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
mov byte [esp + 0x18c], bl
jb 0x412ef6
mov edx, dword [esp + 0x48]
push edx
call fcn.0042bb52
add esp, 4
mov ebp, dword [esp + 0x78]
cmp ebp, esi
mov esi, dword [esp + 0x64]
mov ecx, esi
jae 0x412f08
lea ecx, [esp + 0x64]
lea edx, [edi + 0x408]
mov edi, edi
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
cmp al, bl
jne 0x412f10
cmp ebp, 0x10
mov eax, esi
jae 0x412f25
lea eax, [esp + 0x64]
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x412f9f
mov eax, dword [esp + 0x78]
mov esi, 0x10
cmp eax, esi
mov eax, dword [esp + 0x64]
jae 0x412f55
lea eax, [esp + 0x64]
push eax
push str.Fail_to_open_file___s__for_writing.
push 0x44c660
call fcn.00401330
add esp, 0xc
mov ecx, 0x44c660
call fcn.00404d90
mov eax, dword [esp + 0x10]
push eax
call fcn.0042bb4d
mov eax, dword [esp + 0x7c]
add esp, 4
cmp eax, esi
jb 0x4131e7
mov ecx, dword [esp + 0x64]
push ecx
call fcn.0042bb52
add esp, 4
xor al, al
jmp 0x413143
mov eax, dword [edi + 0x514]
mov ebp, dword [eax]
cmp ebp, eax
mov dword [esp + 0x20], ebp
je 0x413113
mov dword [esp + 0x1c], ebx
jmp 0x412fc1
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov ecx, dword [edi]
call fcn.00404e10
test al, al
jne 0x413113
mov edx, dword [edi]
mov ecx, dword [edx + 0x28]
mov esi, dword [edi + 0x518]
mov eax, dword [esp + 0x1c]
xor edx, edx
div esi
push eax
call fcn.004173f0
mov eax, dword [ebp + 0x20]
mov edi, 0x10
cmp eax, edi
jb 0x412ffa
mov edx, dword [ebp + 0xc]
jmp 0x412ffd
lea edx, [ebp + 0xc]
mov ebp, 0xf
mov eax, edx
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x413013
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x4c]
call fcn.00403210
cmp dword [esp + 0x5c], edi
mov eax, dword [esp + 0x48]
mov byte [esp + 0x18c], 3
jae 0x41303d
lea eax, [esp + 0x48]
push ebx
push ebx
push 3
push ebx
push ebx
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x41316a
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
cmp ebp, ebx
je 0x4130bc
jmp 0x413070
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
call fcn.00404e10
test al, al
jne 0x4130bc
cmp ebp, 0x2000
mov esi, ebp
jb 0x41308e
mov esi, 0x2000
mov edx, dword [esp + 0x10]
push ebx
lea ecx, [esp + 0x28]
push ecx
push esi
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
push ebx
lea eax, [esp + 0x28]
push eax
push esi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub ebp, esi
jne 0x413070
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x5c], 0x10
mov byte [esp + 0x18c], bl
jb 0x4130de
mov eax, dword [esp + 0x48]
push eax
call fcn.0042bb52
add esp, 4
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx]
add edx, 0x64
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x18]
cmp eax, dword [edx + 0x514]
mov dword [esp + 0x5c], 0xf
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
mov dword [esp + 0x20], eax
jne 0x412fb9
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x10]
push edx
call fcn.0042bb4d
mov eax, dword [esp + 0x7c]
add esp, 4
cmp eax, 0x10
jb 0x413141
mov eax, dword [esp + 0x64]
push eax
call fcn.0042bb52
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x184]
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x178]
pop ebp
pop ebx
xor ecx, esp
call fcn.0042baa4
add esp, 0x180
ret
sub esp, 0x1c
mov edi, esp
push str.Fail_to_open_file___s__for_reading.
mov ecx, 7
lea esi, [esp + 0x64]
push 0x44c660
rep movsd dword es:[edi], dword [esi]
call fcn.00401330
add esp, 0x24
mov ecx, 0x44c660
call fcn.00404d90
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x10]
push ecx
call fcn.0042bb4d
mov eax, dword [esp + 0x60]
mov esi, 0x10
add esp, 4
cmp eax, esi
jb 0x4131c8
mov edx, dword [esp + 0x48]
push edx
call fcn.0042bb52
add esp, 4
cmp dword [esp + 0x78], esi
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], ebx
mov byte [esp + 0x48], bl
jb 0x4131e7
mov eax, dword [esp + 0x64]
push eax
call fcn.0042bb52
add esp, 4
xor al, al
jmp 0x413143