Function at 0x40a920
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x4e7868
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc
push ebx
push esi
push edi
mov edi, ecx
lea ecx, [esp + 0x14]
call fcn.004be1a0
lea ecx, [esp + 0xc]
mov dword [esp + 0x20], 0
call fcn.004be1a0
lea ecx, [esp + 0x10]
mov byte [esp + 0x20], 1
call fcn.004be1a0
mov bl, byte [esp + 0x28]
mov esi, dword [esp + 0x30]
cmp bl, 1
mov byte [esp + 0x20], 2
jne 0x40a990
movsx cx, byte [0x50d1b8]
mov al, byte [esp + 0x2c]
push ecx
mov byte [0x50d1bc], al
push 0x50d1b9
jmp 0x40a9c0
cmp bl, 2
jne 0x40a9c9
mov dl, byte [esp + 0x2c]
mov byte [0x50d1c4], dl
mov ax, word [esi]
movsx dx, byte [0x50d1c0]
sar eax, 8
mov byte [0x50d1c5], al
mov cl, byte [esi]
push edx
mov byte [0x50d1c6], cl
push 0x50d1c1
lea ecx, [esp + 0x1c]
call fcn.004be740
lea eax, [esp + 0xc]
lea edx, [esp + 0x14]
push eax
push ecx
mov ecx, esp
mov dword [esp + 0x30], esp
push edx
call fcn.004be1b0
call fcn.0047d320
add esp, 8
test ax, ax
jg 0x40aa31
lea ecx, [esp + 0x10]
mov byte [esp + 0x20], 1
call fcn.004be2e0
lea ecx, [esp + 0xc]
mov byte [esp + 0x20], 0
call fcn.004be2e0
lea ecx, [esp + 0x14]
mov dword [esp + 0x20], 0xffffffff
call fcn.004be2e0
or ax, 0xffff
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0x18
ret 0x10
push 2
lea ecx, [esp + 0x10]
call fcn.004be4c0
cmp al, 0xe6
je 0x40aa84
lea ecx, [esp + 0x10]
mov byte [esp + 0x20], 1
call fcn.004be2e0
lea ecx, [esp + 0xc]
mov byte [esp + 0x20], 0
call fcn.004be2e0
lea ecx, [esp + 0x14]
mov dword [esp + 0x20], 0xffffffff
call fcn.004be2e0
xor ax, ax
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0x18
ret 0x10
push 1
push 0x520014
lea ecx, [esp + 0x18]
call fcn.004be740
cmp bl, 1
jne 0x40aac0
push 4
lea ecx, [esp + 0x10]
call fcn.004be4c0
xor bx, bx
push 5
mov bl, al
lea ecx, [esp + 0x10]
shl ebx, 8
call fcn.004be4c0
movzx ax, al
add ebx, eax
mov word [esi], bx
push 0
lea ecx, [esp + 0x10]
call fcn.004be4c0
cmp al, 6
ja 0x40ab14
lea ecx, [esp + 0x10]
mov byte [esp + 0x20], 1
call fcn.004be2e0
lea ecx, [esp + 0xc]
mov byte [esp + 0x20], 0
call fcn.004be2e0
lea ecx, [esp + 0x14]
mov dword [esp + 0x20], 0xffffffff
call fcn.004be2e0
mov ax, 1
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0x18
ret 0x10
xor esi, esi
lea ecx, [esp + 0xc]
push esi
call fcn.004be4c0
and eax, 0xff
sub eax, 4
test eax, eax
jle 0x40ab5b
lea ecx, [esi + 5]
push ecx
lea ecx, [esp + 0x10]
call fcn.004be4c0
push eax
lea ecx, [esp + 0x14]
call fcn.004be4a0
push 0
lea ecx, [esp + 0x10]
inc esi
call fcn.004be4c0
and eax, 0xff
sub eax, 4
cmp esi, eax
jl 0x40ab2c
lea ecx, [esp + 0x10]
call fcn.004be660
dec al
lea ecx, [esp + 0x10]
push eax
push 0
call fcn.004be5e0
mov edx, dword [esp + 0x34]
lea eax, [esp + 0x10]
push edx
push ecx
mov ecx, esp
mov dword [esp + 0x30], esp
push eax
call fcn.004be1b0
mov ecx, dword [esp + 0x34]
push ecx
push 2
mov ecx, edi
call fcn.00404220
lea ecx, [esp + 0x10]
mov esi, eax
mov byte [esp + 0x20], 1
call fcn.004be2e0
lea ecx, [esp + 0xc]
mov byte [esp + 0x20], 0
call fcn.004be2e0
lea ecx, [esp + 0x14]
mov dword [esp + 0x20], 0xffffffff
call fcn.004be2e0
mov ecx, dword [esp + 0x18]
mov ax, si
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
add esp, 0x18
ret 0x10