Function at 0x491660
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x49fcb7
mov eax, dword fs:[0]
push eax
sub esp, 0xc8
mov eax, dword [0x4e24e0]
xor eax, esp
mov dword [esp + 0xc0], eax
push ebx
push esi
push edi
mov eax, dword [0x4e24e0]
xor eax, esp
push eax
lea eax, [esp + 0xd8]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0xc]
lea eax, [esp + 0x20]
push eax
mov edi, ebx
call fcn.00403310
mov ecx, dword [eax + 4]
mov esi, dword [eax]
lea edx, [esp + 0x5c]
push edx
mov dword [esp + 0x20], ecx
call fcn.004032b0
mov ecx, dword [esp + 0x1c]
mov edx, dword [eax + 4]
mov eax, dword [eax]
push ecx
push esi
push edx
push eax
lea ecx, [esp + 0x28]
push ecx
push ebx
call fcn.00403170
mov edx, dword [0x4e768c]
mov eax, dword [edx + 0xc]
mov ecx, 0x4e768c
call eax
add eax, 0x10
mov dword [esp + 0x20], eax
mov ecx, dword [ebp + 8]
push ecx
xor esi, esi
push 0x4c0b9c
lea edi, [esp + 0x28]
mov dword [esp + 0xe8], esi
call fcn.00410c60
mov edx, dword [esp + 0x28]
add esp, 8
push esi
push esi
push 3
push esi
push 7
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [esp + 0x18], edi
cmp edi, 0xffffffff
je 0x4918e7
xor eax, eax
push eax
lea ecx, [esp + 0x14]
push ecx
push 0x18
lea edx, [esp + 0x50]
push edx
push eax
push eax
push 0x74080
push edi
mov dword [esp + 0x30], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x4918cf
push 0x4e777e
push 0x221
call fcn.00446936
mov esi, eax
add esp, 8
test esi, esi
je 0x4918cf
push 0
lea eax, [esp + 0x14]
push eax
push 0x221
push esi
push 0x21
push esi
push 0x7c088
mov byte [esi + 0xa], 0xec
push edi
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x4918cf
push 0x63
lea ecx, [esp + 0x69]
push 0
push ecx
mov byte [esp + 0x70], 0
call fcn.0044b7d0
add esp, 0xc
mov ecx, 0xa
lea eax, [esp + 0x64]
mov dl, byte [esi + ecx*2 + 0x11]
mov byte [eax], dl
movzx edx, word [esi + ecx*2 + 0x10]
inc eax
and edx, 0x800000ff
jns 0x4917fd
dec edx
or edx, 0xffffff00
inc edx
mov byte [eax], dl
inc ecx
inc eax
cmp ecx, 0x13
jle 0x4917e1
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x68]
call fcn.00402630
lea ecx, [esp + 0x14]
push ecx
mov byte [esp + 0xe4], 1
call fcn.00405310
mov edi, eax
call fcn.004053a0
mov edx, dword [esp + 0x14]
mov eax, edx
mov dword [esp + 0x40], 0xf
mov dword [esp + 0x3c], 0
mov byte [esp + 0x2c], 0
lea edi, [eax + 1]
jmp 0x491850
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x491850
sub eax, edi
push eax
push edx
lea ecx, [esp + 0x30]
call fcn.004100e0
lea edx, [esp + 0x28]
push ebx
push edx
mov byte [esp + 0xe8], 2
call fcn.0048fe60
add esp, 8
cmp dword [esp + 0x40], 0x10
jb 0x49188e
mov eax, dword [esp + 0x2c]
push eax
call fcn.0044556f
add esp, 4
mov byte [esp + 0xe0], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x40], 0xf
mov dword [esp + 0x3c], 0
mov byte [esp + 0x2c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4918cb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [esp + 0x18]
test edi, edi
je 0x4918da
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x4918e7
push esi
call fcn.00446717
add esp, 4
cmp dword [ebx + 0x14], 0
mov dword [esp + 0xe0], 0xffffffff
mov eax, dword [esp + 0x20]
setne bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x491919
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, bl
mov ecx, dword [esp + 0xd8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xc0]
xor ecx, esp
call fcn.0044557a
mov esp, ebp
pop ebp
ret