Function at 0x1003d970
Capabilities:
Access peb ldr_data
Get common file path
Get number of processors
Set console window title

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101009c0
mov eax, dword fs:[0]
push eax
sub esp, 0x134
mov eax, dword [0x101385c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
sub eax, 0
je 0x1003dc06
sub eax, 1
jne 0x1003dc16
mov esi, dword [sym.imp.KERNEL32.dll_AllocConsole]
call esi
test eax, eax
jne 0x1003d9ce
call dword [sym.imp.KERNEL32.dll_FreeConsole]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
call esi
push str.Debug
call dword [sym.imp.KERNEL32.dll_SetConsoleTitleA]
push 0
call fcn.100d5f3c
push eax
push 0x1010ccd0
lea eax, [ebp - 0x13c]
push str.conin_
push eax
call fcn.100e42cb
push 1
call fcn.100d5f3c
push eax
push 0x1010ccdc
lea eax, [ebp - 0x140]
push str.conout_
push eax
call fcn.100e42cb
add esp, 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x12c]
push eax
call fcn.1003cbf0
add esp, 8
cmp dword [eax + 0x14], 0xf
mov ecx, dword [eax + 0x10]
jbe 0x1003da39
mov eax, dword [eax]
push 0xc
push str.S4Client.exe
push ecx
push eax
call fcn.1003c280
add esp, 0x10
lea ecx, [ebp - 0x12c]
mov bl, al
call fcn.1001bf30
test bl, bl
je 0x1003dc16
push 0x104
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x1010ccf8
lea eax, [ebp - 0x114]
push 0x104
push eax
call fcn.100e4160
add esp, 0xc
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x1013adfc], eax
test eax, eax
je 0x1003dc16
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x1010cd04
push eax
call esi
push 0x1010cd14
push dword [0x1013adfc]
mov dword [0x1013ad40], eax
call esi
mov dword [0x1013ad44], eax
mov dword [ebp - 0x138], 0
mov dword [ebp - 0x134], 0
mov dword [ebp - 0x130], 0
mov eax, dword fs:[0x30]
mov dword [ebp - 4], 0
mov eax, dword [eax + 0xc]
add eax, 0xc
mov esi, dword [eax]
cmp esi, eax
je 0x1003db8a
mov ecx, dword [ebp + 8]
test esi, esi
je 0x1003db8a
cmp dword [esi + 0x18], ecx
je 0x1003db18
mov esi, dword [esi]
cmp esi, eax
jne 0x1003db07
jmp 0x1003db8a
mov eax, dword [esi + 4]
mov dword [ebp - 0x128], ecx
lea ecx, [ebp - 0x138]
mov dword [ebp - 0x118], esi
mov eax, dword [eax]
mov dword [ebp - 0x124], eax
mov eax, dword [esi + 0x14]
mov eax, dword [eax]
mov dword [ebp - 0x11c], eax
mov eax, dword [esi + 0xc]
mov eax, dword [eax]
mov dword [ebp - 0x120], eax
lea eax, [ebp - 0x128]
push eax
push 0
call fcn.1003c0d0
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
mov dword [ecx + 4], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 0x10]
mov dword [ecx], eax
mov ecx, dword [esi + 8]
mov eax, dword [esi + 0xc]
mov dword [ecx + 4], eax
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov dword [ecx], eax
call fcn.10048110
call fcn.1003e090
call fcn.10058ec0
call fcn.10060720
call fcn.10057930
call fcn.10057730
call fcn.10057d60
call fcn.1005f080
call fcn.10051750
mov esi, dword [ebp - 0x138]
test esi, esi
je 0x1003dc16
mov ecx, dword [ebp - 0x130]
mov eax, 0x66666667
sub ecx, esi
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*4]
mov eax, esi
shl ecx, 2
cmp ecx, 0x1000
jb 0x1003dbfa
mov esi, dword [eax - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1003dc35
push ecx
push esi
call fcn.100b62d6
add esp, 8
jmp 0x1003dc16
mov eax, dword [0x1013adfc]
test eax, eax
je 0x1003dc16
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100b62e4
mov esp, ebp
pop ebp
ret 0xc
call fcn.100e1715
int3