Function at 0x409528
Capabilities:
Create directory
Create process on windows
Delete directory
Delete file
Encode data using xor
Extract resource via kernel32 functions
Get common file path
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x410991
mov eax, dword fs:[0]
push eax
sub esp, 0x18c
mov eax, dword [0x4224ec]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
cmp eax, ebx
jne 0x4095da
sub esp, 0xc
mov esi, esp
mov dword [ebp - 0x144], esp
push 0x24
mov dword [ebp - 0x130], esi
mov dword [esi + 4], ebx
call fcn.00407653
add esp, 4
cmp eax, ebx
je 0x40959d
mov dword [esi], eax
mov dword [eax], eax
mov esi, dword [esi]
mov dword [esi + 4], esi
mov dword [ebp - 4], 2
mov dword [ebp - 4], 0xffffffff
call fcn.00406c69
lea eax, [ebp - 0x12c]
push eax
lea ecx, [ebp - 0x140]
mov dword [ebp - 0x12c], ebx
call fcn.0040c886
mov dword [ebp - 4], ebx
mov dword [ebp - method.std::bad_alloc.virtual_0], vtable.std::bad_alloc.0
mov dword [ebp - 4], 0xffffffff
push 0x41ed2c
lea ecx, [ebp - 0x140]
push ecx
call fcn.0040f014
mov dword [ebp - 0x128], ebx
mov dword [ebp - 0x124], ebx
mov dword [ebp - 0x120], ebx
mov dword [ebp - 4], 3
movzx edx, ax
push 0xa
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
cmp esi, ebx
je 0x409746
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov edi, eax
cmp edi, ebx
je 0x409746
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, ebx
je 0x409746
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
cmp esi, ebx
je 0x409746
push edi
lea ecx, [ebp - 0x128]
call fcn.00417be1
mov eax, dword [ebp - 0x128]
push edi
push esi
push eax
call fcn.00402117
mov eax, dword [ebp - 0x130]
mov ecx, dword [ebp - 0x124]
mov edx, dword [ebp - 0x128]
add esp, 0xc
push eax
push ecx
push edx
lea ecx, [ebp - 0x84]
mov dword [ebp - 0x70], 0xf
mov dword [ebp - 0x74], ebx
mov byte [ebp - 0x84], bl
call fcn.0040d58a
mov esi, 7
mov byte [ebp - 4], 7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.00409411
xor eax, eax
add esp, 4
mov dword [ebp - 0x8c], esi
mov dword [ebp - 0x90], ebx
mov word [ebp - 0xa0], ax
mov byte [ebp - 4], 8
xor ecx, ecx
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x68], cx
mov byte [ebp - 4], 9
xor edx, edx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], dx
mov byte [ebp - 4], 0xa
mov edi, dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov dword [ebp - 0x118], ebx
nop
call fcn.0040a5c7
and eax, 0x80000007
jns 0x4096f9
dec eax
or eax, 0xfffffff8
inc eax
add eax, 7
je 0x409724
mov esi, eax
call fcn.0040a5c7
cdq
mov ecx, 0x19
idiv ecx
lea ecx, [ebp - 0xa0]
add edx, 0x41
movzx eax, dx
push eax
push 1
call fcn.00407c3e
dec esi
jne 0x409700
mov eax, dword [ebp - 0x58]
lea ecx, [ebp - 0x68]
cmp eax, 0x104
jb 0x4097b9
push 0xffffffffffffffff
push 0x104
call fcn.00401b98
jmp 0x4097c7
sub esp, 0xc
mov esi, esp
mov dword [ebp - 0x130], esp
push 0x24
mov dword [ebp - 0x144], esi
mov dword [esi + 4], ebx
call fcn.00407653
add esp, 4
cmp eax, ebx
je 0x40977e
mov dword [esi], eax
mov dword [eax], eax
mov esi, dword [esi]
mov dword [esi + 4], esi
mov byte [ebp - 4], 6
mov byte [ebp - 4], 3
call fcn.00406c69
lea ecx, [ebp - 0x12c]
push ecx
lea ecx, [ebp - 0x140]
mov dword [ebp - 0x12c], ebx
call fcn.0040c886
mov byte [ebp - 4], 4
mov dword [ebp - method.std::bad_alloc.virtual_0], vtable.std::bad_alloc.0
mov byte [ebp - 4], 3
push 0x41ed2c
lea edx, [ebp - 0x140]
push edx
call fcn.0040f014
mov edx, 0x104
push ebx
sub edx, eax
push edx
call fcn.00407c3e
mov eax, dword [ebp - 0x68]
mov esi, 8
cmp dword [ebp - 0x54], esi
jae 0x4097d7
lea eax, [ebp - 0x68]
push eax
push 0x104
call edi
mov ecx, dword [ebp - 0x58]
mov dword [ebp - 0x118], eax
cmp eax, ecx
ja 0x4097f9
push 0xffffffffffffffff
push eax
lea ecx, [ebp - 0x68]
call fcn.00401b98
jmp 0x409805
sub eax, ecx
push ebx
push eax
lea ecx, [ebp - 0x68]
call fcn.00407c3e
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0xa0]
push eax
lea ecx, [ebp - 0x68]
call fcn.00407b2e
mov eax, dword [ebp - 0x68]
cmp dword [ebp - 0x54], esi
jae 0x409822
lea eax, [ebp - 0x68]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp eax, 0xb7
je 0x4096e8
push str._tmppack.exe
lea ecx, [ebp - 0x68]
push ecx
lea edx, [ebp - 0xbc]
push edx
call fcn.0040a4e7
add esp, 0xc
mov esi, eax
mov byte [ebp - 4], 0xb
lea eax, [ebp - 0x4c]
cmp eax, esi
je 0x4098b9
cmp dword [ebp - 0x38], 8
jb 0x40986c
mov ecx, dword [ebp - 0x4c]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov edi, 7
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], dx
cmp dword [esi + 0x14], 8
jae 0x409899
mov eax, dword [esi + 0x10]
inc eax
add eax, eax
push eax
lea ecx, [ebp - 0x4c]
push esi
push ecx
call fcn.00413838
add esp, 0xc
jmp 0x4098a0
mov edx, dword [esi]
mov dword [ebp - 0x4c], edx
mov dword [esi], ebx
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x3c], eax
mov ecx, dword [esi + 0x14]
mov dword [ebp - 0x38], ecx
xor edx, edx
mov dword [esi + 0x14], edi
mov dword [esi + 0x10], ebx
mov word [esi], dx
jmp 0x4098be
mov edi, 7
mov byte [ebp - 4], 0xa
cmp dword [ebp - 0xa8], 8
jb 0x4098da
mov eax, dword [ebp - 0xbc]
push eax
call fcn.0040c8bc
add esp, 4
mov eax, dword [ebp - 0x4c]
xor ecx, ecx
cmp dword [ebp - 0x38], 8
mov dword [ebp - 0xa8], edi
mov dword [ebp - 0xac], ebx
mov word [ebp - 0xbc], cx
jae 0x4098fb
lea eax, [ebp - 0x4c]
push ebx
push ebx
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, ebx
jne 0x4099a8
mov byte [ebp - 4], 9
mov esi, 8
cmp dword [ebp - 0x38], esi
jb 0x409931
mov edx, dword [ebp - 0x4c]
push edx
call fcn.0040c8bc
add esp, 4
xor eax, eax
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], ax
mov byte [ebp - 4], 8
cmp dword [ebp - 0x54], esi
jb 0x409952
mov ecx, dword [ebp - 0x68]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x68], dx
mov byte [ebp - 4], 7
cmp dword [ebp - 0x8c], esi
jb 0x409979
mov eax, dword [ebp - 0xa0]
push eax
call fcn.0040c8bc
add esp, 4
mov dword [ebp - 0x8c], edi
xor ecx, ecx
mov dword [ebp - 0x90], ebx
mov word [ebp - 0xa0], cx
mov byte [ebp - 4], 3
cmp dword [ebp - 0x70], 0x10
jb 0x409e1b
mov edx, dword [ebp - 0x84]
push edx
jmp 0x409e13
lea eax, [ebp - 0x30]
push eax
push 0x41b2fc
mov dword [ebp - 0x134], ebx
call dword [sym.imp.USER32.dll_FindWindowW]
mov edi, eax
cmp edi, ebx
je 0x4099e3
push 0xffffffffffffffec
push edi
call dword [sym.imp.USER32.dll_GetWindowLongW]
push 0xfffffffffffffff0
push edi
call dword [sym.imp.USER32.dll_GetWindowLongW]
lea ecx, [ebp - 0x114]
push ecx
push edi
call dword [sym.imp.USER32.dll_GetWindowInfo]
cmp dword [ebp - 0x70], 0x10
mov eax, dword [ebp - 0x84]
jae 0x4099f5
lea eax, [ebp - 0x84]
mov ecx, dword [ebp - 0x74]
push ebx
lea edx, [ebp - 0x134]
push edx
push ecx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, 1
je 0x409a89
mov byte [ebp - 4], 9
mov edi, 8
cmp dword [ebp - 0x38], edi
jb 0x409a31
mov edx, dword [ebp - 0x4c]
push edx
call fcn.0040c8bc
add esp, 4
mov esi, 7
xor eax, eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], ax
mov byte [ebp - 4], 8
cmp dword [ebp - 0x54], edi
jb 0x409a57
mov ecx, dword [ebp - 0x68]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x68], dx
mov byte [ebp - 4], 7
cmp dword [ebp - 0x8c], edi
jb 0x409a7e
mov eax, dword [ebp - 0xa0]
push eax
call fcn.0040c8bc
add esp, 4
mov dword [ebp - 0x8c], esi
jmp 0x40997f
push 0x40
lea eax, [ebp - 0x194]
push ebx
push eax
call fcn.0040dca2
xor ecx, ecx
add esp, 0xc
mov dword [ebp - 0x198], 0x44
mov word [ebp - 0x168], cx
mov dword [ebp - 0x16c], 1
mov dword [ebp - 0x154], ebx
mov dword [ebp - 0x150], ebx
mov dword [ebp - 0x14c], ebx
mov dword [ebp - 0x148], ebx
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
cmp esi, ebx
jne 0x409ae4
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x409b0b
push esi
call dword [sym.imp.USER32.dll_GetDC]
mov edi, eax
cmp edi, ebx
je 0x409b0b
push ebx
push 0xd8
push 0xca
push edi
call dword [sym.imp.GDI32.dll_MoveToEx]
push edi
push esi
call dword [sym.imp.USER32.dll_ReleaseDC]
mov ecx, dword [ebp - 0x68]
mov edi, 8
cmp dword [ebp - 0x54], edi
jae 0x409b1b
lea ecx, [ebp - 0x68]
mov eax, dword [ebp - 0x4c]
cmp dword [ebp - 0x38], edi
jae 0x409b26
lea eax, [ebp - 0x4c]
lea edx, [ebp - 0x154]
push edx
lea edx, [ebp - 0x198]
push edx
push ecx
push ebx
push 0x8000010
push ebx
push ebx
push ebx
push 0x41b414
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
call fcn.0040a467
mov eax, dword [ebp - 0x154]
push 0x1d4c0
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push str.ins
lea ecx, [ebp - 0x68]
push ecx
lea edx, [ebp - 0x30]
push edx
call fcn.0040a4e7
mov byte [ebp - 4], 0xc
push 0x41b400
push eax
lea eax, [ebp - 0xd8]
push eax
call fcn.00408778
mov byte [ebp - 4], 0xd
push str.ler.pak
push eax
lea ecx, [ebp - 0xbc]
push ecx
call fcn.00408778
add esp, 0x24
mov byte [ebp - 4], 0xe
push eax
lea ecx, [ebp - 0x4c]
call fcn.00414124
mov byte [ebp - 4], 0xd
cmp dword [ebp - 0xa8], edi
jb 0x409bca
mov edx, dword [ebp - 0xbc]
push edx
call fcn.0040c8bc
add esp, 4
mov esi, 7
xor eax, eax
mov dword [ebp - 0xa8], esi
mov dword [ebp - 0xac], ebx
mov word [ebp - 0xbc], ax
mov byte [ebp - 4], 0xc
cmp dword [ebp - 0xc4], edi
jb 0x409bff
mov ecx, dword [ebp - 0xd8]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov dword [ebp - 0xc4], esi
mov dword [ebp - 0xc8], ebx
mov word [ebp - 0xd8], dx
mov byte [ebp - 4], 0xa
cmp dword [ebp - 0x1c], edi
jb 0x409c29
mov eax, dword [ebp - 0x30]
push eax
call fcn.0040c8bc
add esp, 4
mov eax, dword [ebp - 0x4c]
xor ecx, ecx
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x20], ebx
mov word [ebp - 0x30], cx
cmp dword [ebp - 0x38], edi
jae 0x409c40
lea eax, [ebp - 0x4c]
push ebx
push ebx
push 3
push ebx
push ebx
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x409cca
mov byte [ebp - 4], 9
cmp dword [ebp - 0x38], edi
jb 0x409c6e
mov edx, dword [ebp - 0x4c]
push edx
call fcn.0040c8bc
add esp, 4
mov esi, 7
xor eax, eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], ax
mov byte [ebp - 4], 8
cmp dword [ebp - 0x54], edi
jb 0x409c94
mov ecx, dword [ebp - 0x68]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x68], dx
mov byte [ebp - 4], 7
cmp dword [ebp - 0x8c], edi
jb 0x409a7e
mov eax, dword [ebp - 0xa0]
push eax
call fcn.0040c8bc
add esp, 4
mov dword [ebp - 0x8c], esi
jmp 0x40997f
mov eax, dword [ebp - 0x74]
lea eax, [eax + eax*4]
push eax
mov ecx, 0x423b88
call fcn.00417be1
mov ecx, dword [0x423b88]
mov byte [ecx], 0x4d
mov edx, dword [0x423b88]
push ebx
mov byte [edx + 1], 0x5a
call dword [sym.imp.GDI32.dll_GetStockObject]
mov edi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0x1b
call edi
push 0x1d
call edi
call dword [sym.imp.USER32.dll_GetCursor]
mov ecx, dword [0x423b8c]
push ebx
lea eax, [ebp - 0x118]
push eax
mov eax, dword [0x423b88]
sub ecx, eax
sub ecx, 2
push ecx
add eax, 2
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x38], 8
mov eax, dword [ebp - 0x4c]
jae 0x409d39
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [ebp - 0x118]
push edx
mov ecx, 0x423b88
call fcn.00417be1
mov eax, dword [ebp - 0x68]
mov edi, 8
cmp dword [ebp - 0x54], edi
jae 0x409d61
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov eax, 2
cmp dword [ebp - 0x118], eax
jbe 0x409d8b
lea ecx, [ecx]
mov ecx, dword [0x423b88]
xor byte [eax + ecx], 0x37
inc eax
cmp eax, dword [ebp - 0x118]
jb 0x409d78
mov byte [ebp - 4], 9
cmp dword [ebp - 0x38], edi
jb 0x409da0
mov eax, dword [ebp - 0x4c]
push eax
call fcn.0040c8bc
add esp, 4
mov esi, 7
xor ecx, ecx
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], cx
mov byte [ebp - 4], 8
cmp dword [ebp - 0x54], edi
jb 0x409dc6
mov edx, dword [ebp - 0x68]
push edx
call fcn.0040c8bc
add esp, 4
xor eax, eax
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x68], ax
mov byte [ebp - 4], 7
cmp dword [ebp - 0x8c], edi
jb 0x409ded
mov ecx, dword [ebp - 0xa0]
push ecx
call fcn.0040c8bc
add esp, 4
xor edx, edx
mov dword [ebp - 0x8c], esi
mov dword [ebp - 0x90], ebx
mov word [ebp - 0xa0], dx
mov byte [ebp - 4], 3
cmp dword [ebp - 0x70], 0x10
jb 0x409e1b
mov eax, dword [ebp - 0x84]
push eax
call fcn.0040c8bc
add esp, 4
mov dword [ebp - 0x70], 0xf
mov dword [ebp - 0x74], ebx
mov byte [ebp - 0x84], bl
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x128]
cmp eax, ebx
je 0x409e45
push eax
call fcn.0040c8bc
add esp, 4
mov dword [ebp - 0x120], ebx
mov dword [ebp - 0x124], ebx
mov dword [ebp - 0x128], ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040c8ad
mov esp, ebp
pop ebp
ret