Function at 0x401cb6
Capabilities:
Get common file path
Get file size
Read file on windows
Set current directory
Write file on windows

Disassembly:
mov eax, 0x43d39e
call fcn.0041de9c
sub esp, 0x1cc
push ebx
push esi
push edi
mov dword [ebp - 0x14], ecx
mov eax, dword [ecx + 0x98]
lea esi, [ecx + 0x90]
push eax
mov dword [ebp - 4], 1
mov ecx, dword [esi + 4]
push ecx
mov ecx, esi
call fcn.00402b29
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x1d7]
mov byte [ebp - 0x1d8], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x1d8]
mov dword [ebp - 0x38], ebx
push eax
push 0x104
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryA]
mov al, byte [ebp + 0x18]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x1c], esp
push ebx
mov ecx, edi
mov byte [edi], al
call fcn.004029a7
push dword [0x44067c]
lea eax, [ebp + 0x18]
mov ecx, edi
push ebx
push eax
call fcn.004028ad
sub esp, 0x10
lea eax, [ebp + 8]
mov ecx, esp
mov dword [ebp - 0x20], esp
push eax
mov byte [ebp - 4], 2
call fcn.004027c1
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.004016a8
mov al, byte [ebp + 0x18]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x1c], esp
push ebx
mov ecx, edi
mov byte [edi], al
call fcn.004029a7
push dword [0x44067c]
lea eax, [ebp + 0x18]
mov ecx, edi
push ebx
push eax
call fcn.004028ad
mov ecx, dword [ebp - 0x14]
call fcn.0040119c
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x401da3
mov ecx, dword [esi + 8]
sub ecx, eax
test ecx, 0xfffffff0
jne 0x401dab
mov byte [ebp - 0xd], bl
jmp 0x4020b7
mov edi, 0x44e1c8
lea eax, [ebp + 8]
push edi
push eax
lea eax, [ebp - 0xc4]
push eax
call fcn.0040354b
lea ecx, [ebp + 0x18]
mov byte [ebp - 4], 3
push ecx
push eax
lea eax, [ebp - 0xd4]
push eax
call fcn.004035d4
push str..src
push eax
lea eax, [ebp - 0x84]
mov byte [ebp - 4], 4
push eax
call fcn.0040354b
add esp, 0x24
push 1
lea ecx, [ebp - 0xd4]
pop esi
mov byte [ebp - 4], 7
push esi
call fcn.004029a7
push esi
lea ecx, [ebp - 0xc4]
mov byte [ebp - 4], 6
call fcn.004029a7
lea eax, [ebp + 8]
push edi
push eax
lea eax, [ebp - 0x94]
push eax
call fcn.0040354b
lea ecx, [ebp + 0x18]
mov byte [ebp - 4], 8
push ecx
push eax
lea eax, [ebp - 0xb4]
push eax
call fcn.004035d4
push str..hdr
push eax
lea eax, [ebp - 0x64]
mov byte [ebp - 4], 9
push eax
call fcn.0040354b
add esp, 0x24
push esi
lea ecx, [ebp - 0xb4]
mov byte [ebp - 4], 0xc
call fcn.004029a7
push esi
lea ecx, [ebp - 0x94]
mov byte [ebp - 4], 0xb
call fcn.004029a7
mov eax, dword [ebp + 0xc]
cmp eax, ebx
jne 0x401e7a
mov eax, 0x440680
mov esi, dword [ebp - 0x14]
push eax
mov ecx, esi
call fcn.00403eab
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x80]
cmp eax, ebx
jne 0x401e94
mov eax, 0x440680
push ebx
push 0x80
push 3
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov ecx, dword [esi + 0x94]
cmp eax, ebx
mov dword [ebp - 0x18], ecx
mov ecx, dword [esi + 0x98]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x2c], ecx
push ebx
je 0x40207a
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x18], eax
je 0x402030
mov al, byte [ebp + 0x27]
push ebx
lea ecx, [ebp - 0x54]
mov byte [ebp - 0x54], al
call fcn.004029a7
push dword [0x44067c]
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 0xd
push ebx
push dword [ebp - 0x18]
call fcn.004028ad
mov eax, dword [ebp - 0x20]
push edi
mov dword [ebp - 0x44], eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0xa4]
push eax
call fcn.0040354b
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 0xe
push ecx
push eax
lea eax, [ebp - 0x74]
push eax
call fcn.004035d4
add esp, 0x18
push 1
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 0x10
call fcn.004029a7
mov eax, dword [ebp - 0x70]
cmp eax, ebx
jne 0x401f4c
mov eax, 0x440680
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x34], eax
je 0x401ffb
push ebx
push eax
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov esi, eax
lea eax, [esi + 1]
push eax
call fcn.0041e1f1
pop ecx
mov dword [ebp - 0x30], eax
lea ecx, [ebp - 0x38]
push ebx
push ecx
push esi
push eax
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
push 2
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
lea eax, [ebp - 0x38]
push ebx
push eax
push esi
push dword [ebp - 0x30]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
push dword [ebp - 0x30]
call fcn.0041e108
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x28], esi
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x50]
cmp eax, ebx
pop ecx
mov dword [ebp - 0x3c], esi
jne 0x401fd6
mov eax, 0x440680
mov esi, dword [ebp - 0x14]
push eax
mov ecx, esi
call fcn.00403eab
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x1c]
push eax
lea ecx, [esi + 0x28]
call fcn.004027eb
mov ecx, eax
call fcn.00401c87
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 1
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], 0xd
call fcn.004029a7
push 1
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 0xb
call fcn.004029a7
add dword [ebp - 0x18], 0x10
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x2c]
jne 0x401ede
lea eax, [ebp - 0x1d8]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov al, byte [ebp - 0x64]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x20], esp
push ebx
mov ecx, edi
mov byte [edi], al
call fcn.004029a7
push dword [0x44067c]
lea eax, [ebp - 0x64]
mov ecx, edi
push ebx
push eax
call fcn.004028ad
mov ecx, esi
call fcn.00402524
mov byte [ebp - 0xd], 1
jmp 0x402098
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea eax, [ebp - 0x1d8]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryA]
lea ecx, [esi + 0x28]
call fcn.00402a81
mov byte [ebp - 0xd], bl
push 1
lea ecx, [ebp - 0x64]
mov byte [ebp - 4], 6
call fcn.004029a7
push 1
lea ecx, [ebp - 0x84]
mov byte [ebp - 4], 1
call fcn.004029a7
push 1
lea ecx, [ebp + 8]
mov byte [ebp - 4], bl
call fcn.004029a7
or dword [ebp - 4], 0xffffffff
push 1
lea ecx, [ebp + 0x18]
call fcn.004029a7
mov ecx, dword [ebp - 0xc]
mov al, byte [ebp - 0xd]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 0x20