Function at 0x1004f170
Capabilities:
Check if file exists
Get common file path
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100aeac5
mov eax, dword fs:[0]
push eax
sub esp, 0x6d8
mov eax, dword [0x100dbc1c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x63c], ebx
mov dword [ebp - 0x630], 0
cmp dword [ebx + 0xc], 0
jne 0x1004f5b2
push 0x208
lea eax, [ebp - 0x218]
mov dword [ebx + 0xc], 1
push 0
push eax
call fcn.100837f0
push 0x208
lea eax, [ebp - 0x420]
push 0
push eax
call fcn.100837f0
mov esi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x218]
add esp, 0x18
push 0
push 0x1a
push eax
push 0
call esi
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push 0x100b72f0
push eax
call edi
push 0
push 0x1a
lea eax, [ebp - 0x420]
push eax
push 0
call esi
push str.ldsqlshare.set
lea eax, [ebp - 0x420]
push eax
call edi
lea ecx, [ebp - 0x420]
lea edi, [ebx + 4]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1004f240
sub ecx, edx
lea eax, [ebp - 0x420]
sar ecx, 1
push ecx
push eax
mov ecx, edi
call fcn.10009e80
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
test eax, eax
je 0x1004f383
push dword [edi]
push 0xffffffffffffffff
push str.guide
push str.CouponHelper
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp eax, 0xffffffff
jne 0x1004f2c0
lea eax, [ebp - 0x218]
push eax
push 0
push str.guide
push str.CouponHelper
call esi
test eax, eax
je 0x1004f2c0
push dword [edi]
push 0x100b4348
push str.guide
push str.CouponHelper
call ebx
push dword [edi]
push 0xffffffffffffffff
push str.enable
push str.CouponHelper
call esi
cmp eax, 0xffffffff
jne 0x1004f301
lea eax, [ebp - 0x218]
push eax
push 1
push str.enable
push str.CouponHelper
call esi
test eax, eax
jne 0x1004f301
push dword [edi]
push 0x100b530c
push str.enable
push str.CouponHelper
call ebx
push dword [edi]
push 0xffffffffffffffff
push str.hide_big_coupon
push str.CouponHelper
call esi
cmp eax, 0xffffffff
jne 0x1004f342
lea eax, [ebp - 0x218]
push eax
push 0
push str.hide_big_coupon
push str.CouponHelper
call esi
test eax, eax
je 0x1004f342
push dword [edi]
push 0x100b4348
push str.hide_big_coupon
push str.CouponHelper
call ebx
push dword [edi]
push 0xffffffffffffffff
push str.flash_wake
push str.CouponHelper
call esi
cmp eax, 0xffffffff
jne 0x1004f383
lea eax, [ebp - 0x218]
push eax
push 1
push str.flash_wake
push str.CouponHelper
call esi
test eax, eax
jne 0x1004f383
push dword [edi]
push 0x100b530c
push str.flash_wake
push str.CouponHelper
call ebx
push 0x208
lea eax, [ebp - 0x628]
push 0
push eax
call fcn.100837f0
add esp, 0xc
lea eax, [ebp - 0x628]
push 0
push 0x1a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push str.ldslds.set
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1004f5b2
lea eax, [ebp - 0x628]
push eax
push 0
push str.stat_rand
push str.statistic
call esi
mov dword [ebp - 0x638], eax
lea eax, [ebp - 0x644]
push eax
call fcn.1003b6a0
add esp, 4
cmp dword [eax], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x630], 1
je 0x1004f447
lea eax, [ebp - 0x64c]
push eax
call fcn.1003b6a0
add esp, 4
mov ecx, dword [eax]
mov dword [ebp - 4], 1
mov dword [ebp - 0x630], 3
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov byte [ebp - 0x629], 1
test al, al
jne 0x1004f44e
mov byte [ebp - 0x629], 0
mov esi, dword [ebp - 0x648]
or ebx, 0xffffffff
test esi, esi
je 0x1004f483
test byte [ebp - 0x630], 2
je 0x1004f483
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1004f483
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x1004f483
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov esi, dword [ebp - 0x640]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x1004f4b3
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1004f4b3
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x1004f4b3
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp byte [ebp - 0x629], 0
je 0x1004f547
lea eax, [ebp - 0x644]
push eax
call fcn.1003b6a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0x6e4]
mov dword [ebp - 4], 2
call fcn.10015e70
mov esi, eax
push str.per:
push esi
mov byte [ebp - 4], 3
call fcn.10012080
add esp, 8
mov ecx, esi
push dword [ebp - 0x638]
call fcn.10015fc0
mov eax, dword [edi]
mov ecx, edi
push esi
call dword [eax + 0x14]
lea ecx, [ebp - 0x6e4]
call fcn.10012280
mov esi, dword [ebp - 0x640]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x1004f547
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1004f547
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x1004f547
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lea eax, [ebp - 0x634]
push eax
call fcn.10021e40
add esp, 4
mov ecx, dword [eax]
mov dword [ebp - 4], 4
mov eax, dword [ecx]
call dword [eax + 0x20]
cmp dword [ebp - 0x638], eax
mov esi, dword [ebp - 0x630]
setle cl
mov byte [ebp - 0x629], cl
test esi, esi
je 0x1004f5a1
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x1004f5a1
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x1004f59b
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov cl, byte [ebp - 0x629]
test cl, cl
je 0x1004f5b2
mov eax, dword [ebp - 0x63c]
mov dword [eax + 0x10], 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100763b4
mov esp, ebp
pop ebp
ret