Function at 0x10007870
Capabilities:
Query environment variable
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1005abd7
mov eax, dword fs:[0]
push eax
sub esp, 0x890
mov eax, dword [0x1006a2a8]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
lea edx, [ebp - 0x898]
mov dword [ebp - 0x890], ebx
push edx
mov dword [ebp - 0x89c], ecx
mov dword [ebp - 0x898], eax
mov byte [ebp - 0x894], bl
call fcn.10008b00
push 0x7fe
lea ecx, [ebp - 0x832]
xor eax, eax
push ebx
mov dword [ebp - 4], 1
push ecx
mov word [ebp - 0x834], ax
call fcn.10029f30
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
push 0x400
lea eax, [ebp - 0x834]
push eax
xor edx, edx
push str._USERPROFILE_FunShion.ini
mov word [ebp - 0x30], dx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea ecx, [ebp - 0x834]
push ecx
push 0xd
lea edx, [ebp - 0x30]
push edx
push 0x10061174
push 0x10060ff0
push str.FunShion_Player
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
xor eax, eax
mov word [ebp - 0x86c], ax
lea eax, [ebp - 0x30]
mov dword [ebp - 0x858], 7
mov dword [ebp - 0x85c], ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10007960
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x30]
lea esi, [ebp - 0x86c]
call fcn.100041a0
cmp dword [ebp - 0x85c], 0xc
mov edi, 0x10
jne 0x100079e2
mov ecx, esi
push ecx
lea edx, [ebp - 0x888]
push edx
call fcn.100573c0
mov esi, eax
lea eax, [ebp - 0x86c]
push eax
lea ecx, [ebp - 0x850]
push ecx
call fcn.100573c0
add esp, 0x10
mov dword [ebp - 4], 4
mov esi, dword [esi + 0x10]
mov ebx, 3
mov dword [ebp - 0x890], ebx
cmp dword [eax + 0x14], edi
jb 0x100079cf
mov eax, dword [eax]
push esi
mov ecx, eax
call fcn.10006670
mov byte [ebp - 0x889], 0
test al, al
je 0x100079e9
mov byte [ebp - 0x889], 1
test bl, 2
je 0x10007a29
and ebx, 0xfffffffd
mov dword [ebp - 0x890], ebx
cmp dword [ebp - 0x83c], edi
jb 0x10007a0e
mov edx, dword [ebp - 0x850]
push edx
call fcn.100281c4
add esp, 4
mov dword [ebp - 0x83c], 0xf
mov dword [ebp - 0x840], 0
mov byte [ebp - 0x850], 0
mov dword [ebp - 4], 2
test bl, 1
je 0x10007a55
and ebx, 0xfffffffe
mov dword [ebp - 0x890], ebx
cmp dword [ebp - 0x874], edi
jb 0x10007a55
mov eax, dword [ebp - 0x888]
push eax
call fcn.100281c4
add esp, 4
cmp byte [ebp - 0x889], 0
mov edi, 8
je 0x10007afe
xor eax, eax
lea ecx, [ebp - 0x888]
push ecx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov byte [ebp - 0x24], al
call fcn.10054f10
add esp, 4
push eax
mov eax, str.FunShion.ini
lea ecx, [ebp - 0x850]
mov byte [ebp - 4], 5
call fcn.10008ce0
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x874], edi
jb 0x10007ab7
mov edx, dword [ebp - 0x888]
push edx
call fcn.100281c4
add esp, 4
mov eax, dword [ebp - 0x850]
cmp dword [ebp - 0x83c], edi
jae 0x10007acb
lea eax, [ebp - 0x850]
push eax
push 0xd
lea eax, [ebp - 0x30]
push eax
push 0x10061174
push 0x10060ff0
push str.participation
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
cmp dword [ebp - 0x83c], edi
jb 0x10007afe
mov ecx, dword [ebp - 0x850]
push ecx
call fcn.100281c4
add esp, 4
xor edx, edx
lea eax, [ebp - 0x30]
mov word [ebp - 0x850], dx
mov dword [ebp - 0x83c], 7
mov dword [ebp - 0x840], 0
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x10007b21
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x30]
lea esi, [ebp - 0x850]
call fcn.100041a0
mov eax, esi
mov esi, dword [ebp - 0x89c]
push eax
push esi
call fcn.100573c0
add esp, 8
or ebx, 4
mov dword [ebp - 0x890], ebx
cmp dword [ebp - 0x83c], edi
jb 0x10007b71
mov ecx, dword [ebp - 0x850]
push ecx
call fcn.100281c4
add esp, 4
xor edx, edx
mov ebx, 7
mov dword [ebp - 0x83c], ebx
mov dword [ebp - 0x840], 0
mov word [ebp - 0x850], dx
cmp dword [ebp - 0x858], edi
jb 0x10007ba6
mov eax, dword [ebp - 0x86c]
push eax
call fcn.100281c4
add esp, 4
xor ecx, ecx
mov byte [ebp - 4], cl
mov dword [ebp - 0x858], ebx
mov dword [ebp - 0x85c], 0
mov word [ebp - 0x86c], cx
cmp byte [ebp - 0x894], cl
je 0x10007c0e
mov eax, dword [ebp - 0x898]
dec dword [eax]
jne 0x10007c0e
xor edx, edx
lea ecx, [eax + 4]
xchg dword [ecx], edx
add eax, 8
mov ecx, SysReAllocString
mov edx, eax
lock xadd dword [edx], ecx
test ecx, 0x40000000
jne 0x10007c0e
cmp ecx, 0x80000000
jle 0x10007c0e
mov ecx, eax
lock bts dword [ecx], 0x1e
jb 0x10007c0e
call fcn.10006340
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.100281cf
mov esp, ebp
pop ebp
ret 4