Function at 0x4040b0
Capabilities:
Encode data using xor
Get windows directory from kuser_shared_data
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x448
push ebx
push esi
push edi
call fcn.00402f10
xor eax, eax
push 0x100
push eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov word [esp + 0x58], ax
lea eax, [esp + 0x5c]
push eax
call fcn.004033c0
add esp, 0xc
xor edi, edi
xor eax, eax
mov byte [esp + eax + 0x54], al
inc eax
cmp eax, 0x100
jb 0x4040f4
xor esi, esi
mov dl, byte [esp + esi + 0x54]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41e020]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x54]
mov byte [esp + esi + 0x54], al
inc esi
mov byte [esp + edi + 0x54], dl
cmp esi, 0x100
jb 0x404102
xor edi, edi
xor ebx, ebx
xor esi, esi
jmp 0x404140
lea eax, [edi + 1]
movzx edi, al
mov cl, byte [esp + edi + 0x54]
movzx edx, cl
lea eax, [ebx + edx]
movzx ebx, al
movzx eax, byte [esp + ebx + 0x54]
mov byte [esp + edi + 0x54], al
mov byte [esp + ebx + 0x54], cl
movzx eax, byte [esp + edi + 0x54]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x54]
xor al, byte [esi + 0x41e024]
mov byte [esp + esi + 0x38], al
inc esi
cmp esi, 0x1a
jb 0x404140
xor eax, eax
push 0x100
push eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov byte [esp + 0x28], al
lea eax, [esp + 0x5c]
push eax
call fcn.004033c0
add esp, 0xc
xor edi, edi
xor eax, eax
mov byte [esp + eax + 0x54], al
inc eax
cmp eax, 0x100
jb 0x4041b0
xor esi, esi
mov edi, edi
mov dl, byte [esp + esi + 0x54]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41e0a0]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x54]
mov byte [esp + esi + 0x54], al
inc esi
mov byte [esp + edi + 0x54], dl
cmp esi, 0x100
jb 0x4041c0
xor edi, edi
xor ebx, ebx
xor esi, esi
lea eax, [edi + 1]
movzx edi, al
mov cl, byte [esp + edi + 0x54]
movzx edx, cl
lea eax, [edx + ebx]
movzx ebx, al
movzx eax, byte [esp + ebx + 0x54]
mov byte [esp + edi + 0x54], al
mov byte [esp + ebx + 0x54], cl
movzx eax, byte [esp + edi + 0x54]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x54]
xor al, byte [esi + 0x41e0a4]
mov byte [esp + esi + 0xc], al
inc esi
cmp esi, 0x15
jb 0x4041f5
xor edx, edx
lea ecx, [esp + 0x38]
call fcn.00403720
test eax, eax
je 0x4043df
mov esi, dword [eax + 0x18]
push ebp
call fcn.00402f10
test esi, esi
je 0x404284
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x404284
mov ecx, dword [eax + esi + 0x7c]
test ecx, ecx
je 0x404284
mov eax, dword [eax + esi + 0x78]
test eax, eax
je 0x404284
lea edx, [esp + 0x10]
push edx
push ecx
lea edx, [eax + esi]
mov ecx, esi
call fcn.00401540
add esp, 8
mov ebp, eax
test ebp, ebp
jne 0x4042a3
mov eax, dword [0x7f4400]
test eax, eax
je 0x4043de
lea ecx, [esp + 0x10]
push ecx
push esi
call eax
mov ebp, eax
test ebp, ebp
je 0x4043de
xor eax, eax
push 0x100
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
lea eax, [esp + 0x60]
push eax
call fcn.004033c0
add esp, 0xc
xor edi, edi
xor eax, eax
mov byte [esp + eax + 0x58], al
inc eax
cmp eax, 0x100
jb 0x4042d0
xor esi, esi
mov edi, edi
mov dl, byte [esp + esi + 0x58]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41e060]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x58]
mov byte [esp + esi + 0x58], al
inc esi
mov byte [esp + edi + 0x58], dl
cmp esi, 0x100
jb 0x4042e0
xor edi, edi
xor ebx, ebx
xor esi, esi
lea eax, [edi + 1]
movzx edi, al
mov cl, byte [esp + edi + 0x58]
movzx edx, cl
lea eax, [edx + ebx]
movzx ebx, al
movzx eax, byte [esp + ebx + 0x58]
mov byte [esp + edi + 0x58], al
mov byte [esp + ebx + 0x58], cl
movzx eax, byte [esp + edi + 0x58]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x58]
xor al, byte [esi + 0x41e064]
mov byte [esp + esi + 0x28], al
inc esi
cmp esi, 0x14
jb 0x404315
push 0x400
lea eax, [esp + 0x5c]
push 0
push eax
call fcn.004033c0
mov ecx, 0x7ffe0030
add esp, 0xc
xor edx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x404372
sub ecx, esi
sar ecx, 1
je 0x4043de
add ecx, 0xb
cmp ecx, 0x200
ja 0x4043de
xor eax, eax
test ecx, ecx
je 0x4043b8
jmp 0x4043a0
movzx esi, word [edx + edx + 0x7ffe0030]
test si, si
je 0x4043b8
mov word [esp + edx*2 + 0x58], si
inc eax
inc edx
cmp eax, ecx
jb 0x4043a0
xor eax, eax
test ecx, ecx
je 0x4043d7
lea edx, [esp + edx*2 + 0x58]
movzx esi, word [esp + eax*2 + 0x28]
test si, si
je 0x4043d7
mov word [edx], si
inc eax
add edx, 2
cmp eax, ecx
jb 0x4043c2
lea eax, [esp + 0x58]
push eax
call ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x448
ret