Function at 0x40a220
Capabilities:
Create directory
Delete file
Get common file path
Get file size
Print debug messages
Read file via mapping
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x432706
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x3b0
mov eax, dword [0x442184]
push ebx
push esi
or ebx, 0xffffffff
push edi
mov dword [esp + 0x3b4], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x34], ebx
call fcn.00425d0d
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [esp + 0x18], eax
xor eax, eax
mov byte [esp + 0x160], 0
mov ecx, 0x40
lea edi, [esp + 0x161]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x103
lea eax, [esp + 0x164]
push eax
push 0
mov dword [esp + 0x3d0], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0
push 3
push 0
push 1
push SysReAllocString
lea ecx, [esp + 0x178]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, ebx
mov dword [esp + 0x20], edi
je 0x40a6a6
test edi, edi
je 0x40a6a6
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push 0
push 2
push 0
mov esi, eax
push edi
mov dword [esp + 0x3c], esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
test eax, eax
mov dword [esp + 0x38], eax
jne 0x40a35c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateFileMapping
lea edx, [esp + 0x20]
push str._s_ld
push edx
call fcn.00401ad0
mov esi, dword [esp + 0x28]
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esi - 0x10]
mov dword [esp + 0x3c4], ebx
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebx
dec ebx
test ebx, ebx
jg 0x40a352
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, 0xfffffffd
jmp 0x40a6f5
push 0
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x10], ebx
je 0x40a646
mov eax, dword [ebx + esi - 4]
cmp eax, esi
ja 0x40a646
mov edx, dword [esp + 0x24]
lea esi, [eax + 8]
mov al, byte [ebx + esi]
mov byte [esp + 0x28], al
mov ecx, dword [esp + 0x28]
inc esi
push ecx
mov ecx, dword [esp + 0x20]
sub edx, esi
lea eax, [ebx + esi]
push edx
push eax
mov dword [esp + 0x38], eax
call fcn.004097a0
test eax, eax
jne 0x40a3c1
push 0x435820
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x40a646
cmp esi, dword [esp + 0x24]
ja 0x40a646
xor eax, eax
mov byte [esp + 0x58], 0
mov ecx, 0x40
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax + 4]
test ecx, ecx
jle 0x40a63a
mov byte [esp + 0x268], 0
xor eax, eax
mov ecx, 0x50
lea edi, [esp + 0x269]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x58]
stosw word es:[edi], ax
push ecx
push 0x103
mov dword [esp + 0x38], 0
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edx, [esp + 0x3c]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
lea ecx, [esp + 0x14]
call fcn.00401760
movzx eax, word [esp + 0x4a]
movzx ecx, word [esp + 0x48]
movzx edx, word [esp + 0x46]
push eax
movzx eax, word [esp + 0x48]
push ecx
movzx ecx, word [esp + 0x4a]
push edx
movzx edx, word [esp + 0x4a]
push eax
movzx eax, word [esp + 0x4c]
push ecx
push edx
push eax
lea ecx, [esp + 0x30]
push str._d_d_d_d_d_d_d
push ecx
mov byte [esp + 0x3e8], 1
call fcn.00401ad0
add esp, 0x24
lea edx, [esp + 0x58]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
push edi
push str.MgrSetup_
lea eax, [esp + 0x60]
push eax
add ecx, 0x108
push str._s_s_s
push ecx
call fcn.004170ff
push 0x4357f8
push 0x4357f4
push edi
push str.MgrSetup_
lea edx, [esp + 0x7c]
push edx
mov eax, edx
push str._s_s_s_s_s
push eax
call fcn.004170ff
add esp, 0x30
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x5c]
xor edi, edi
push edx
push edi
mov dword [esp + 0x58], 0x104
mov dword [esp + 0x60], edi
mov dword [esp + 0x5c], edi
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
mov ecx, dword [ebp + 8]
lea eax, [esp + 0x58]
push eax
push 0x434d54
push ecx
call fcn.004170ff
add esp, 0xc
add esi, 8
mov dword [esp + 0x28], edi
mov edx, dword [esp + 0x2c]
cmp dword [edx + 4], edi
jle 0x40a631
jmp 0x40a520
mov eax, dword [esp + 0x24]
add ebx, esi
add esi, 0x24
cmp esi, eax
ja 0x40a697
test ebx, ebx
je 0x40a609
mov ecx, dword [esp + 0x1c]
lea edi, [ebx + 4]
push edi
call fcn.0040a0b0
test eax, eax
je 0x40a560
push str.about.bmp
push edi
call fcn.00417196
add esp, 8
test eax, eax
jne 0x40a609
push edi
lea eax, [esp + 0x5c]
push eax
lea ecx, [esp + 0x270]
push 0x434b64
push ecx
call fcn.004170ff
mov ecx, dword [esp + 0x2c]
add esp, 0x10
lea edx, [esp + 0x268]
push edx
call fcn.004030e0
test eax, eax
je 0x40a59e
lea eax, [esp + 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0
push 0
push 2
push 0
push 0
push 0xc0000000
lea ecx, [esp + 0x280]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40a697
test edi, edi
je 0x40a697
mov ecx, dword [esp + 0x10]
push 0
lea edx, [esp + 0x34]
push edx
mov dword [esp + 0x38], 0
mov eax, dword [ebx]
push eax
add ecx, esi
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a690
mov edx, dword [esp + 0x30]
cmp edx, dword [ebx]
jne 0x40a690
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx]
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x10]
add esi, ecx
cmp esi, eax
ja 0x40a631
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 4]
inc eax
cmp eax, edx
mov dword [esp + 0x28], eax
jl 0x40a520
lea ecx, [esp + 0x14]
call fcn.004015e0
mov dword [esp + 0x34], 0
mov edi, dword [esp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
test ebx, ebx
je 0x40a65a
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [esp + 0x38]
push edx
call esi
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov dword [esp + 0x3c4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a68a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x34]
jmp 0x40a6f5
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x14]
call fcn.004015e0
mov ebx, dword [esp + 0x10]
jmp 0x40a642
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x164]
push eax
lea ecx, [esp + 0x20]
push str._s_ld
push ecx
call fcn.00401ad0
mov esi, dword [esp + 0x28]
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esi - 0x10]
mov dword [esp + 0x3c4], ebx
lea edx, [eax + 0xc]
lock xadd dword [edx], ebx
dec ebx
test ebx, ebx
jg 0x40a6f0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, 0xfffffffe
mov ecx, dword [esp + 0x3bc]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x3b4]
call fcn.00417188
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4