Function at 0x401e40
Capabilities:
Create directory
Get common file path
Get file size
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xa54
mov eax, dword [0x419050]
xor eax, esp
mov dword [esp + 0xa50], eax
push ebx
push esi
lea eax, [esp + 0x18]
mov esi, ecx
push edi
mov dword [esp + 0x10], esi
test eax, eax
je 0x401e9a
push 0x417450
push str.kernel32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x401e8f
lea ecx, [esp + 0x1c]
push ecx
call eax
jmp 0x401e9a
lea edx, [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ax, word [esp + 0x1c]
cmp ax, 9
je 0x401eab
cmp ax, 6
jne 0x401eb2
mov eax, 1
jmp 0x401eb4
xor eax, eax
mov dword [esi + 0x17c], eax
mov ebx, dword [esi + 0x174]
add esi, 0x164
cmp dword [esi + 0xc], ebx
jbe 0x401ed0
call fcn.0040964c
mov edi, dword [esi + 0xc]
mov eax, dword [esi]
mov dword [esp + 0x14], eax
cmp edi, dword [esi + 0x10]
jbe 0x401ee3
call fcn.0040964c
mov ecx, dword [esp + 0x14]
mov eax, dword [esi]
push ebx
push ecx
push edi
push eax
lea ebx, [esp + 0x24]
call fcn.00403330
push 0x104
lea edx, [esp + 0x4c]
push 0
push edx
call fcn.0040a210
push 0x104
lea eax, [esp + 0x260]
push 0
push eax
call fcn.0040a210
add esp, 0x18
push 0x104
lea ecx, [esp + 0x4c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x48]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401f37
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea esi, [edi + 0x180]
lea eax, [esp + 0x4c]
call fcn.004015d0
lea edx, [esp + 0x250]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [esp + 0x250]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401f77
sub eax, edx
sar eax, 1
lea ebx, [edi + 0x120]
push eax
lea eax, [esp + 0x254]
mov esi, ebx
call fcn.004015d0
lea eax, [esp + 0x658]
push eax
lea ecx, [esp + 0x45c]
push ecx
lea edx, [esp + 0x860]
push edx
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x58]
push ecx
call fcn.00409408
lea eax, [esp + 0x46c]
add esp, 0x14
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401fd0
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x45c]
mov ecx, ebx
call fcn.004014f0
push 1
mov eax, 0x4174ac
mov ecx, ebx
call fcn.004014f0
cmp dword [ebx + 0x18], 8
jb 0x402007
mov eax, dword [ebx + 4]
jmp 0x40200a
lea eax, [ebx + 4]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
lea edx, [esp + 0x60]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
test eax, eax
je 0x402039
cmp eax, 0xffffffff
jne 0x402042
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov dword [edi + 0x158], eax
test eax, eax
je 0x4020f7
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [edi + 0x15c], eax
push edi
mov edi, dword [edi + 0x158]
call fcn.004022b0
mov esi, dword [esp + 0x10]
cmp eax, dword [esi + 0x15c]
mov dword [esi + 0x160], eax
jl 0x40209f
mov eax, dword [esi + 0x158]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xa50]
xor ecx, esp
call fcn.004089cf
mov esp, ebp
pop ebp
ret
push eax
call fcn.00402250
mov ecx, dword [esi + 0x160]
add ecx, 0x100
push ecx
mov edx, 0x4174b0
mov ecx, esi
call fcn.00402350
cmp dword [esi + 0x17c], 0
je 0x4020d7
mov edx, dword [esi + 0x10]
push edx
mov edx, 0x4174b8
mov ecx, esi
call fcn.00402350
mov eax, dword [esi + 0x158]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebx + 0x18], 8
jb 0x4020ef
mov esi, dword [ebx + 4]
jmp 0x4020f2
lea esi, [ebx + 4]
call fcn.00402c00
mov ecx, dword [esp + 0xa5c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004089cf
mov esp, ebp
pop ebp
ret