Function at 0x409230
Capabilities:
Check if file exists
Create directory
Delete file
Extract resource via kernel32 functions
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1074
call fcn.00417a60
mov eax, dword [0x41a040]
xor eax, esp
mov dword [esp + 0x1070], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push 0x407ec0
push 0x82
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
je 0x409750
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
je 0x409750
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
push ebx
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
push esi
call fcn.0040e5b9
add esp, 4
push esi
mov ebx, eax
push 0
push ebx
mov dword [esp + 0x20], ebx
call fcn.004133d0
mov ecx, dword [0x402b90]
mov eax, dword [0x402b8c]
mov edx, dword [0x402b94]
add esp, 0xc
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x10]
push esi
mov dword [esp + 0x24], eax
mov eax, dword [0x402b98]
mov dword [esp + 0x2c], edx
push ecx
mov edx, ebx
lea ecx, [esp + 0x28]
mov dword [esp + 0x34], eax
call fcn.00408580
test al, al
je 0x409750
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov edx, dword [ebx]
xor ecx, ecx
push 0x206
mov dword [esp + 0x20], edx
mov byte [esp + 0x10], 0x50
mov byte [esp + 0x11], 0x4b
mov byte [esp + 0x12], 3
mov byte [esp + 0x13], 4
mov eax, dword [esp + 0x10]
push ecx
lea edx, [esp + 0x67a]
mov dword [ebx], eax
push edx
mov word [esp + 0x67c], cx
call fcn.004133d0
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x26a]
push ecx
mov word [esp + 0x26c], ax
call fcn.004133d0
add esp, 0xc
push 0x104
lea edx, [esp + 0x674]
push edx
push 0x407ecc
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov eax, dword [0x41bfb0]
push eax
lea ecx, [esp + 0x674]
push ecx
push 0x407ed8
lea edx, [esp + 0x26c]
call fcn.00409ec0
add esp, 0xc
lea edx, [esp + 0x260]
push edx
call edi
cmp eax, 0xffffffff
je 0x4093b8
test al, 0x10
je 0x4093b8
inc dword [0x41bfb0]
jmp 0x40937b
push 0
lea eax, [esp + 0x264]
push eax
call ebx
lea ecx, [esp + 0x260]
push ecx
call edi
cmp eax, 0xffffffff
je 0x40937b
test al, 0x10
je 0x40937b
mov ebx, dword [esp + 0x14]
push 3
push esi
call fcn.0040e400
mov edi, eax
add esp, 8
test edi, edi
jne 0x4093f8
mov dword [0x41bfb4], 0x10000
jmp 0x409416
cmp dword [edi], 1
je 0x409409
mov dword [0x41bfb4], 0x80000
jmp 0x409416
mov esi, dword [edi + 4]
call fcn.0040d900
mov dword [0x41bfb4], eax
push 0xffffffffffffffff
lea eax, [esp + 0x34]
mov ecx, edi
call fcn.0040e510
mov eax, dword [esp + 0x34]
mov esi, eax
imul eax, eax, 0x104
xor ecx, ecx
add esp, 4
mov edx, 2
mul edx
seto cl
mov dword [esp + 0x10], esi
neg ecx
or ecx, eax
push ecx
call fcn.0040e5b9
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x409750
imul esi, esi, 0x208
push esi
push 0
push ebx
call fcn.004133d0
add esp, 0xc
push 0x206
xor esi, esi
lea ecx, [esp + 0x46e]
xor eax, eax
push esi
push ecx
mov word [esp + 0x474], ax
call fcn.004133d0
add esp, 0xc
cmp dword [esp + 0x10], esi
mov dword [esp + 0x18], ebx
mov dword [esp + 0xc], esi
jle 0x409687
xor eax, eax
xor edx, edx
mov dword [esp + 0x30], eax
mov word [esp + 0x34], dx
mov dword [esp + 0x25c], eax
cmp edi, eax
jne 0x4094c3
mov dword [0x41bfb4], 0x10000
jmp 0x4094e7
cmp dword [edi], 1
je 0x4094d4
mov dword [0x41bfb4], 0x80000
jmp 0x4094e7
mov ecx, dword [edi + 4]
lea eax, [esp + 0x30]
push eax
push esi
call fcn.0040d970
mov dword [0x41bfb4], eax
lea eax, [esp + 0x34]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4094f0
sub eax, edx
sar eax, 1
push 4
lea ecx, [esp + eax*2 + 0x30]
push 0x407efc
push ecx
call fcn.0040e8cf
add esp, 0xc
test eax, eax
jne 0x409570
push 1
lea edx, [esp + 0x38]
push 0x407f08
push edx
call fcn.0040e8cf
add esp, 0xc
test eax, eax
jne 0x409570
lea eax, [esp + 0x36]
push eax
lea ecx, [esp + 0x38]
push 0x104
push ecx
call fcn.0040eb9d
inc dword [esp + 0x18]
add esp, 0xc
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x264]
push eax
push 0x407f0c
push 0x104
push ebx
call fcn.0040e740
add esp, 0x14
add ebx, 0x208
lea eax, [esp + 0x34]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x409577
sub eax, edx
sar eax, 1
push 4
lea ecx, [esp + eax*2 + 0x30]
push 0x407f18
push ecx
call fcn.0040e8cf
add esp, 0xc
test eax, eax
jne 0x4095c5
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x264]
push eax
push 0x407f0c
lea ecx, [esp + 0x474]
push 0x104
push ecx
call fcn.0040e740
add esp, 0x14
xor edx, edx
push 0x7fe
push edx
lea eax, [esp + 0x882]
push eax
mov word [esp + 0x884], dx
call fcn.004133d0
add esp, 0xc
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x264]
push edx
push 0x407f0c
lea edx, [esp + 0x884]
call fcn.00409ee0
add esp, 0xc
test edi, edi
jne 0x409616
mov dword [0x41bfb4], 0x10000
jmp 0x409641
cmp dword [edi], 1
je 0x409627
mov dword [0x41bfb4], 0x80000
jmp 0x409641
mov ecx, dword [edi + 4]
lea eax, [esp + 0x878]
push eax
push esi
call fcn.0040e070
mov dword [0x41bfb4], eax
test eax, eax
je 0x40967c
test edi, edi
jne 0x409651
mov dword [0x41bfb4], 0x10000
jmp 0x409641
cmp dword [edi], 1
je 0x409662
mov dword [0x41bfb4], 0x80000
jmp 0x409641
mov ecx, dword [edi + 4]
lea edx, [esp + 0x878]
push edx
push esi
call fcn.0040e070
mov dword [0x41bfb4], eax
test eax, eax
jne 0x409641
inc esi
cmp esi, dword [esp + 0x10]
jl 0x40949f
test edi, edi
jne 0x409697
mov dword [0x41bfb4], 0x10000
jmp 0x4096c7
cmp dword [edi], 1
je 0x4096a8
mov dword [0x41bfb4], 0x80000
jmp 0x4096c7
mov esi, dword [edi + 4]
call fcn.0040e3a0
mov dword [0x41bfb4], eax
test esi, esi
je 0x4096be
call fcn.0040e4c0
push edi
call fcn.0040e6e4
add esp, 4
lea eax, [esp + 0x260]
push eax
lea ecx, [esp + 0x46c]
call fcn.00409bb0
add esp, 4
lea ecx, [esp + 0x468]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov esi, dword [esp + 0xc]
mov ebx, dword [esp + 0x18]
mov edi, ebx
test esi, esi
jbe 0x409722
lea ebx, [ebx]
lea edx, [esp + 0x260]
push edx
push 0x407f24
mov ecx, edi
call fcn.00409900
add esp, 8
add edi, 0x208
sub esi, 1
jne 0x409700
push ebx
call fcn.0040eb15
add esp, 4
lea ecx, [esp + 0x260]
call fcn.00409a40
mov eax, dword [esp + 0x14]
push eax
call fcn.0040eb15
add esp, 4
cmp byte [esp + 0x1c], 1
jne 0x409750
call fcn.00409770
mov ecx, dword [esp + 0x107c]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0040e5c4
mov esp, ebp
pop ebp
ret 0x10