Function at 0x40b990
Capabilities:
Access peb ldr_data
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x49c
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 4], edi
test edi, edi
je 0x40bcfa
mov eax, dword fs:[0x30]
mov dword [ebp - 0x14], 0
mov eax, dword [eax + 0xc]
add eax, 0xc
mov dword [ebp - 8], eax
mov ebx, dword [eax]
test ebx, ebx
je 0x40ba93
mov ecx, 0x20a
mov edi, edi
cmp word [ebx + 0x2e], cx
jae 0x40ba80
mov ecx, dword [ebx + 0x30]
lea edx, [ebp - 0x288]
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40b9e5
cmp word [ebp - 0x288], 0
lea eax, [ebp - 0x288]
je 0x40ba22
movzx edx, word [eax]
lea ecx, [edx - 0x41]
cmp cx, 0x19
lea ecx, [edx + 0x20]
jbe 0x40ba16
mov ecx, edx
mov word [eax], cx
add eax, 2
cmp word [eax], 0
jne 0x40ba05
lea ecx, [ebp - 0x288]
lea edx, [ecx + 2]
jmp 0x40ba30
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40ba30
sub ecx, edx
xor esi, esi
sar ecx, 1
mov edx, 0xb12d667
lea edi, [ecx*2 + 2]
test edi, edi
je 0x40ba76
movzx ecx, byte [ebp + esi - 0x288]
mov eax, edx
shl eax, 5
inc esi
add ecx, eax
mov eax, edx
shr eax, 2
add ecx, eax
xor edx, ecx
cmp esi, edi
jb 0x40ba51
cmp edx, 0xc73d5fac
je 0x40ba8a
mov ebx, dword [ebx]
mov ecx, 0x20a
mov eax, dword [ebp - 8]
cmp ebx, eax
jne 0x40b9d0
jmp 0x40ba90
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x14], eax
mov edi, dword [ebp - 4]
push 0xdc
lea eax, [ebp - 0x498]
push eax
push 0x15
push 1
call fcn.00401420
cmp word [ebp - 0x498], 0
lea ecx, [ebp - 0x498]
mov edx, str._ntdll.dll
je 0x40bac9
lea ecx, [ecx]
add ecx, 2
cmp word [ecx], 0
jne 0x40bac0
sub ecx, str._ntdll.dll
nop
movzx eax, word [edx]
lea edx, [edx + 2]
mov word [ecx + edx - 2], ax
test ax, ax
jne 0x40bad0
push 0
push 0
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x498]
push eax
push 0x11
push 0
call fcn.00401420
test al, al
je 0x40bcfa
push 0x40
push 7
lea eax, [ebp - 0x38]
mov dword [ebp - 0x50], 0x18
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x50]
mov dword [ebp - 0x4c], 0
push eax
push 0x80100080
lea eax, [ebp - 0x20]
mov dword [ebp - 0x44], 0x40
push eax
push 0x12
push 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
call fcn.00401420
push dword [ebp - 0x34]
mov esi, eax
push 0
push dword [0x41148c]
push 9
push 1
call fcn.00401420
test esi, esi
jns 0x40bb6a
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x20]
lea eax, [ebp - 0x18]
push 0x1000000
push 2
push 0
push 0
push 0xf001f
push eax
push 1
push 0
call fcn.00401420
movzx ebx, al
test ebx, ebx
js 0x40bce5
push 2
push 0
push 2
lea eax, [ebp - 0x24]
mov dword [ebp - 0xc], 0
push eax
push 0
push 0
push 0
lea eax, [ebp - 0xc]
mov dword [ebp - 0x24], 0
push eax
push dword [0x41041c]
push dword [ebp - 0x18]
push 2
push 0
call fcn.00401420
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
js 0x40bcd9
xor eax, eax
mov dword [ebp - 8], eax
jmp 0x40bbe0
mov edx, dword [ebp - 0x14]
lea ebx, [edi + eax*4]
mov eax, dword [ebx]
lea ecx, [ebp - 0x30]
push 0
push 0
mov dword [ebp - 0x10], 0
push dword [eax + 4]
mov dword [ebp - 0x2c], ebx
call fcn.00403580
test eax, eax
js 0x40bcb4
mov eax, dword [ebx]
lea ecx, [ebp - 0x1c]
mov edx, dword [ebp - 0xc]
push 0
push 0
push dword [eax + 4]
call fcn.00403580
test eax, eax
js 0x40bcb4
xor esi, esi
xor edi, edi
xor bh, bh
mov bl, 1
lea ecx, [ecx]
lea eax, [ebp - 0x6c]
push eax
mov eax, dword [ebp - 0x1c]
add eax, esi
push eax
call fcn.004027f0
test eax, eax
je 0x40bc79
test dword [ebp - 0x54], 0x1000
jne 0x40bc79
mov al, byte [ebp - 0x66]
cmp al, 0xc3
je 0x40bc57
cmp al, 0xc2
jne 0x40bc5b
mov bh, 1
xor bl, bl
movzx eax, byte [ebp - 0x6c]
add esi, eax
cmp esi, 5
jb 0x40bc6b
test edi, edi
cmove edi, esi
test bl, bl
je 0x40bc74
cmp esi, 0x20
jb 0x40bc30
mov eax, dword [ebp - 0x10]
jmp 0x40bc7e
mov eax, 0xc0000001
test bh, bh
je 0x40bcb1
test eax, eax
js 0x40bcb1
mov ecx, esi
call fcn.00402fb0
mov ecx, dword [ebp - 0x2c]
mov ecx, dword [ecx]
mov dword [ecx + 0x10], eax
test eax, eax
je 0x40bcb1
mov dword [ecx + 0x14], esi
mov eax, dword [ebp - 0x30]
mov dword [ecx + 8], eax
mov dword [ecx + 0x18], edi
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 0x10]
push esi
call fcn.004019d0
mov edi, dword [ebp - 4]
mov eax, dword [ebp - 8]
inc eax
mov dword [ebp - 8], eax
cmp eax, 2
jb 0x40bbe0
push dword [ebp - 0xc]
push dword [0x41041c]
push 3
push 0
call fcn.00401420
mov ebx, dword [ebp - 0x28]
push dword [ebp - 0x18]
push 8
push 0
call fcn.00401420
push dword [ebp - 0x20]
push 8
push 0
call fcn.00401420
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret