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

Disassembly:
sub esp, 0x478
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push ebp
xor eax, eax
push esi
push edi
mov dword [esp + 0x1c], eax
mov byte [0x5f4c74], 1
mov dword [esp + 0x18], eax
cdq
sub eax, edx
xor ebp, ebp
sar eax, 1
cmp eax, 3
mov dword [esp + 0x10], ebp
mov dword [esp + 0x24], eax
ja case.default.0x51f205
jmp dword [eax*4 + 0x51f5a8]
mov ebp, 0x1f0
jmp case.default.0x51f205
mov ebp, 0x170
jmp case.default.0x51f205
mov ebp, 0x1e8
jmp case.default.0x51f205
mov ebp, 0x168
mov edi, 0x1869f
lea esi, [ebp + 7]
mov al, byte [0x5f4a5c]
test al, al
je 0x51f27a
mov al, byte [0x5f4c74]
test al, al
je 0x51f28f
lea eax, [esp + 0x7c]
push 0
push eax
mov eax, dword [0x5f4a60]
lea ecx, [esp + 0x48]
push 0xc
push ecx
lea edx, [esp + 0x50]
push 0xc
push edx
push 0x8010204c
push eax
mov word [esp + 0x60], si
mov byte [esp + 0x68], 1
call ebx
test eax, eax
je 0x51f28f
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x10], ecx
jmp 0x51f28f
lea edx, [esp + 0x10]
push 1
push edx
push esi
push 0x51ec50
call fcn.0051ec90
add esp, 0x10
mov eax, dword [esp + 0x10]
mov ecx, eax
and ecx, 0x40
cmp cl, 0x40
je 0x51f2a9
and eax, 1
cmp al, 1
je 0x51f2a9
dec edi
test edi, edi
jg 0x51f22e
cmp edi, 1
jl 0x51f587
mov eax, dword [esp + 0x18]
and eax, reloc.WS2_32.dll_accept
jns 0x51f2c2
dec eax
or eax, 0xfffffffe
inc eax
mov dword [esp + 0x20], eax
jne 0x51f328
mov cl, byte [0x5f4a5c]
mov edi, 0xa0
test cl, cl
mov dword [esp + 0x14], edi
lea eax, [ebp + 6]
je 0x51f31f
mov cl, byte [0x5f4c74]
test cl, cl
je 0x51f396
mov ecx, dword [0x5f4a60]
lea edx, [esp + 0x80]
push 0
push edx
mov word [esp + 0x54], ax
push 0
push 0
lea eax, [esp + 0x5c]
push 0xc
push eax
push 0x80102048
push ecx
mov dword [esp + 0x70], edi
mov byte [esp + 0x74], 1
call ebx
jmp 0x51f396
lea edx, [esp + 0x14]
push 1
push edx
jmp 0x51f388
mov cl, byte [0x5f4a5c]
mov edi, 0xb0
test cl, cl
mov dword [esp + 0x14], edi
lea eax, [ebp + 6]
je 0x51f381
mov cl, byte [0x5f4c74]
test cl, cl
je 0x51f396
mov edx, dword [0x5f4a60]
mov word [esp + 0x64], ax
lea eax, [esp + 0x84]
push 0
push eax
push 0
push 0
lea ecx, [esp + 0x74]
push 0xc
push ecx
push 0x80102048
push edx
mov dword [esp + 0x88], edi
mov byte [esp + 0x8c], 1
call ebx
jmp 0x51f396
lea ecx, [esp + 0x14]
push 1
push ecx
push eax
push 0x51ec70
call fcn.0051ec90
add esp, 0x10
mov cl, byte [0x5f4a5c]
mov eax, 0xec
test cl, cl
mov dword [esp + 0x14], eax
je 0x51f3e6
mov cl, byte [0x5f4c74]
test cl, cl
je 0x51f3fb
mov ecx, dword [0x5f4a60]
lea edx, [esp + 0x70]
push 0
push edx
mov dword [esp + 0x64], eax
push 0
push 0
lea eax, [esp + 0x68]
push 0xc
push eax
push 0x80102048
push ecx
mov word [esp + 0x78], si
mov byte [esp + 0x80], 1
call ebx
jmp 0x51f3fb
lea edx, [esp + 0x14]
push 1
push edx
push esi
push 0x51ec70
call fcn.0051ec90
add esp, 0x10
mov edi, 0x1869f
mov al, byte [0x5f4a5c]
test al, al
je 0x51f44c
mov al, byte [0x5f4c74]
test al, al
je 0x51f461
lea eax, [esp + 0x74]
push 0
push eax
mov eax, dword [0x5f4a60]
lea ecx, [esp + 0x30]
push 0xc
push ecx
lea edx, [esp + 0x38]
push 0xc
push edx
push 0x8010204c
push eax
mov word [esp + 0x48], si
mov byte [esp + 0x50], 1
call ebx
test eax, eax
je 0x51f461
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x10], ecx
jmp 0x51f461
lea edx, [esp + 0x10]
push 1
push edx
push esi
push 0x51ec50
call fcn.0051ec90
add esp, 0x10
mov eax, dword [esp + 0x10]
mov ecx, eax
and ecx, 0x48
cmp cl, 0x48
je 0x51f47e
mov edx, eax
and edx, 1
cmp dl, 1
je 0x51f47e
dec edi
test edi, edi
jg 0x51f400
cmp edi, 1
jl 0x51f587
test al, 1
jne 0x51f587
lea esi, [esp + 0x88]
mov edi, 0x100
mov al, byte [0x5f4a5c]
mov dword [esi], 0
test al, al
je 0x51f4eb
mov al, byte [0x5f4c74]
test al, al
je 0x51f4fc
lea eax, [esp + 0x78]
push 0
push eax
mov eax, dword [0x5f4a60]
lea ecx, [esp + 0x3c]
push 0xc
push ecx
lea edx, [esp + 0x44]
push 0xc
push edx
push 0x8010204c
push eax
mov word [esp + 0x54], bp
mov byte [esp + 0x5c], 2
call ebx
test eax, eax
je 0x51f4fc
mov ecx, dword [esp + 0x38]
mov dword [esi], ecx
jmp 0x51f4fc
push 2
push esi
push ebp
push 0x51ec50
call fcn.0051ec90
add esp, 0x10
add esi, 4
dec edi
jne 0x51f49b
mov edx, dword [esp + 0x494]
mov eax, dword [esp + 0x490]
mov ecx, dword [esp + 0x48c]
push edx
push eax
lea edx, [esp + 0x90]
push ecx
push edx
call fcn.0051e5d0
mov edx, dword [esp + 0x4a8]
add esp, 0x10
test edx, edx
mov dword [esp + 0x1c], 1
je 0x51f587
mov ecx, dword [esp + 0x24]
xor eax, eax
cmp ecx, 3
ja case.default.0x51f548
jmp dword [ecx*4 + 0x51f5b8]
mov eax, 1
jmp case.default.0x51f548
mov eax, 2
jmp case.default.0x51f548
mov eax, 4
jmp case.default.0x51f548
mov eax, 8
mov ecx, dword [esp + 0x20]
sub ecx, 0
je 0x51f579
dec ecx
jne 0x51f57b
or al, 0x32
jmp 0x51f57b
or al, 0x16
push eax
mov eax, dword [edx + 8]
push eax
mov ecx, edx
call fcn.0057867f
mov eax, dword [esp + 0x18]
inc eax
cmp eax, 8
mov dword [esp + 0x18], eax
jl 0x51f1f1
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x478
ret