Function at 0x512a10
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x57d780
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5d7050]
xor eax, esp
push eax
lea eax, [esp + 0x28]
mov dword fs:[0], eax
mov eax, dword [0x5e736c]
mov edx, dword [eax + 0xc]
xor esi, esi
mov ecx, 0x5e736c
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], esi
call edx
add eax, 0x10
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], esi
mov eax, dword [0x5e736c]
mov edx, dword [eax + 0xc]
mov ecx, 0x5e736c
call edx
add eax, 0x10
mov dword [esp + 0x20], eax
mov ebp, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
lea eax, [esp + 0x1c]
push eax
mov ecx, ebp
mov byte [esp + 0x34], 1
call fcn.00512750
mov ebx, eax
cmp ebx, esi
jl 0x512f50
mov edx, dword [esp + 0x40]
lea ecx, [esp + 0x18]
push ecx
mov ecx, ebp
call fcn.00512750
mov ebx, eax
cmp ebx, esi
jl 0x512f50
mov ecx, dword [ebp + 8]
add ebp, 4
cmp ecx, esi
mov esi, dword [esp + 0x1c]
je 0x512ac8
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp esi, eax
jb 0x512ace
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov edx, dword [ebp + 4]
lea eax, [esi*4]
mov dword [esp + 0x3c], eax
mov eax, dword [edx + eax]
mov edx, dword [eax + 0x24]
lea edi, [esp + 0x24]
call fcn.00410020
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512b00
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp dword [esp + 0x18], eax
jb 0x512b06
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x18]
mov ecx, dword [ebp + 4]
add eax, eax
add eax, eax
mov edx, dword [ecx + eax]
mov edx, dword [edx + 0x24]
lea edi, [esp + 0x20]
call fcn.00410020
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512b33
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp esi, eax
jb 0x512b39
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [ebp + 4]
mov ecx, dword [esp + 0x3c]
mov esi, dword [ecx + eax]
call fcn.00511e10
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512b5d
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp dword [esp + 0x18], eax
jb 0x512b63
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x18]
mov edx, dword [ebp + 4]
add eax, eax
add eax, eax
mov esi, dword [edx + eax]
call fcn.00511e10
mov ecx, dword [ebp + 4]
test ecx, ecx
mov edi, dword [esp + 0x1c]
je 0x512b8d
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512b93
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [ebp + 4]
mov ecx, dword [eax + edi*4]
cmp byte [ecx + 0x10], 0
je 0x512beb
mov ecx, eax
test ecx, ecx
je 0x512bb1
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512bb7
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov edx, dword [ebp + 4]
mov eax, dword [edx + edi*4]
cmp byte [eax + 0x11], 0
je 0x512beb
mov edi, dword [esp + 0x18]
mov esi, ebp
call fcn.004f8b00
mov eax, dword [eax]
cmp byte [eax + 0x10], 0
je 0x512be7
call fcn.004f8b00
mov eax, dword [eax]
cmp byte [eax + 0x12], 0
jne 0x512f50
mov edi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00512650
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512c08
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512c0e
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [ebp + 4]
lea esi, [edi*4]
add eax, esi
mov eax, dword [eax]
call fcn.00511eb0
push eax
push str.m_pList_lPublicIndex_.DisableSharing_return_0x_x
mov ecx, 0x6180b8
call fcn.00435a30
mov ecx, dword [ebp + 4]
add esp, 8
test ecx, ecx
je 0x512c47
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512c4d
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [ebp + 4]
add eax, esi
mov eax, dword [eax]
call fcn.00511f10
mov ebx, eax
test ebx, ebx
jl 0x512c90
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512c74
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp dword [esp + 0x18], eax
jb 0x512c7a
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ecx, dword [esp + 0x18]
mov eax, dword [ebp + 4]
add ecx, ecx
add ecx, ecx
add eax, ecx
mov eax, dword [eax]
call fcn.00511f60
mov ebx, eax
cmp ebx, 0x80040201
jne 0x512db0
push 1
call fcn.00513170
push 0
call fcn.00513170
mov edx, dword [esp + 0x38]
push edx
call fcn.00512650
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512cc7
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512ccd
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [ebp + 4]
mov esi, dword [eax + esi]
call fcn.00511e10
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512ced
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp dword [esp + 0x18], eax
jb 0x512cf7
mov ebx, dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
call ebx
jmp 0x512cfd
mov ebx, dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x18]
mov ecx, dword [ebp + 4]
add eax, eax
add eax, eax
mov esi, dword [ecx + eax]
call fcn.00511e10
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x512d23
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512d25
call ebx
mov eax, dword [ebp + 4]
lea esi, [edi*4]
add eax, esi
mov eax, dword [eax]
call fcn.00511eb0
push eax
push str.m_pList_lPublicIndex_.DisableSharing_return_0x_x
mov ecx, 0x6180b8
call fcn.00435a30
mov ecx, dword [ebp + 4]
add esp, 8
test ecx, ecx
je 0x512d5e
mov eax, dword [ebp + 8]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x512d60
call ebx
mov eax, dword [ebp + 4]
add eax, esi
mov eax, dword [eax]
call fcn.00511f10
mov ebx, eax
test ebx, ebx
jl 0x512f50
mov edi, dword [esp + 0x18]
mov esi, ebp
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511f60
mov ebx, eax
cmp ebx, 0x80040201
jne 0x512f50
mov edx, dword [esp + 0x44]
mov eax, dword [edx + 0x108]
or eax, 0x4000000
je 0x512f50
jmp 0x512f4e
cmp ebx, 0x800702fd
jne 0x512e92
call fcn.00512fd0
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00512650
mov esi, ebp
call fcn.004f8b00
mov esi, dword [eax]
call fcn.00511e10
mov edi, dword [esp + 0x18]
mov esi, ebp
call fcn.004f8b00
mov esi, dword [eax]
call fcn.00511e10
mov edi, dword [esp + 0x1c]
mov esi, ebp
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511eb0
push eax
push str.m_pList_lPublicIndex_.DisableSharing_return_0x_x
mov ecx, 0x6180b8
call fcn.00435a30
add esp, 8
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511f10
mov ebx, eax
test ebx, ebx
jl 0x512f50
mov edi, dword [esp + 0x18]
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511f60
mov ebx, eax
cmp ebx, 0x800702fd
jne 0x512f50
mov ecx, dword [esp + 0x44]
mov eax, dword [ecx + 0x108]
mov edx, eax
or edx, 0x4000000
je 0x512f50
or eax, 0x200
mov dword [ecx + 0x108], eax
call fcn.0046c450
push str.CIcsManager::EnableIcs_in_192.168.0.X__
mov ecx, 0x6180b8
mov byte [eax + 0x14], 1
call fcn.00435a30
add esp, 4
jmp 0x512f4e
cmp ebx, 0x80070002
je 0x512ea6
cmp ebx, 0x800702ff
jne 0x512f50
mov eax, dword [esp + 0x38]
push eax
call fcn.00512650
mov esi, ebp
call fcn.004f8b00
mov esi, dword [eax]
call fcn.00511e10
mov edi, dword [esp + 0x18]
mov esi, ebp
call fcn.004f8b00
mov esi, dword [eax]
call fcn.00511e10
mov edi, dword [esp + 0x1c]
mov esi, ebp
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511eb0
push eax
push str.m_pList_lPublicIndex_.DisableSharing_return_0x_x
mov ecx, 0x6180b8
call fcn.00435a30
add esp, 8
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511f10
mov ebx, eax
test ebx, ebx
jl 0x512f50
mov edi, dword [esp + 0x18]
call fcn.004f8b00
mov eax, dword [eax]
call fcn.00511f60
mov ebx, eax
cmp ebx, 0x80070002
je 0x512f29
cmp ebx, 0x800702ff
jne 0x512f50
mov ecx, dword [esp + 0x44]
mov edx, dword [ecx + 0x108]
or edx, 0x4000000
je 0x512f50
push ebx
push str.CIcsManager::EnableIcs_ingoreError:_x
mov ecx, 0x6180b8
call fcn.00435a30
add esp, 8
xor ebx, ebx
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
push esi
push edi
push ebx
push str.CIcsManager::EnableIcs_return_:0x_x_Pubname:_s_PrivateName:_s
mov ecx, 0x6180b8
call fcn.00435a30
lea eax, [esi - 0x10]
add esp, 0x10
mov byte [esp + 0x30], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x512f8e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
mov dword [esp + 0x30], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x512fb2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 0x10