Function at 0x40d431
Capabilities:
Check if file exists
Read .ini file

Disassembly:
push ebp
sub esp, 0x294
lea ebp, [esp - 4]
mov eax, dword [0x551bd0]
xor eax, ebp
mov dword [ebp + 0x294], eax
push 0x28
mov eax, 0x511094
call fcn.0049dfed
mov esi, ecx
push str.Apks
lea eax, [esi + 0x40]
push eax
lea eax, [ebp + 0x38]
push eax
call fcn.00409dbb
add esp, 0xc
xor ebx, ebx
push 8
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 0x3c]
pop edi
cmp dword [ebp + 0x50], edi
jae 0x40d47f
lea eax, [ebp + 0x3c]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
lea eax, [ebp + 0x38]
push eax
lea ecx, [ebp + 0x70]
call fcn.00403757
push 0x538040
lea ecx, [ebp + 0x70]
mov byte [ebp - 4], 1
call fcn.00403850
push str.SogouMarket.apk
lea ecx, [ebp + 0x70]
call fcn.00403850
push str.SogouMarket.ini
lea eax, [ebp + 0x38]
push eax
lea eax, [ebp + 0x54]
push eax
call fcn.00409dbb
add esp, 0xc
push str.http:__api.app.i.sogou.com_global_appdetailini_downid
lea ecx, [ebp + 0x1c]
mov byte [ebp - 4], 2
call fcn.00401685
push str.311558
lea ecx, [ebp + 0x1c]
mov byte [ebp - 4], 3
call fcn.00403850
mov eax, dword [ebp + 0x58]
push ebx
cmp dword [ebp + 0x6c], edi
jae 0x40d4f4
lea eax, [ebp + 0x58]
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
call fcn.00401685
mov byte [ebp - 4], 4
mov eax, dword [ebp + 0x20]
cmp dword [ebp + 0x34], edi
jae 0x40d511
lea eax, [ebp + 0x20]
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x14], esp
push eax
call fcn.00401685
mov byte [ebp - 4], 3
call fcn.004099a2
add esp, 0x3c
cmp eax, ebx
jge 0x40d57f
xor esi, esi
push ebx
inc esi
push esi
lea ecx, [ebp + 0x1c]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x54]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x70]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x38]
call fcn.0040184d
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x294]
xor ecx, ebp
call fcn.0049a49b
add ebp, 0x298
leave
ret
xor eax, eax
push 0x206
mov word [ebp + 0x8c], ax
lea eax, [ebp + 0x8e]
push ebx
push eax
call fcn.0049d740
mov eax, dword [ebp + 0x58]
add esp, 0xc
cmp dword [ebp + 0x6c], edi
jae 0x40d5a8
lea eax, [ebp + 0x58]
push eax
push 0x104
lea eax, [ebp + 0x8c]
push eax
mov edi, 0x535d58
push edi
push str.packagemd5
push str.AppInfo
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [ebp + 0x8c]
mov cx, word [eax]
cmp cx, word [edi]
jne 0x40d5f7
cmp cx, bx
je 0x40d5f3
mov cx, word [eax + 2]
cmp cx, word [edi + 2]
jne 0x40d5f7
add eax, 4
add edi, 4
cmp cx, bx
jne 0x40d5d1
xor eax, eax
jmp 0x40d5fc
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x40d636
mov byte [ebp - 0xd], bl
xor esi, esi
push ebx
inc esi
push esi
lea ecx, [ebp + 0x1c]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x54]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x70]
call fcn.0040184d
push ebx
push esi
lea ecx, [ebp + 0x38]
call fcn.0040184d
mov al, byte [ebp - 0xd]
jmp 0x40d55c
lea eax, [ebp + 0x8c]
push eax
lea ecx, [ebp]
call fcn.00401685
mov byte [ebp - 4], 5
cmp dword [ebp + 0x88], 8
mov eax, dword [ebp + 0x74]
jae 0x40d658
lea eax, [ebp + 0x74]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d694
lea ecx, [ebp]
lea edi, [ebp + 0x70]
call fcn.00409ab2
test eax, eax
jne 0x40d694
push 0xffffffffffffffff
push ebx
mov eax, edi
push eax
lea ecx, [esi + 0x78]
call fcn.004019f3
push ebx
push 1
lea ecx, [ebp]
call fcn.0040184d
mov byte [ebp - 0xd], 1
jmp 0x40d603
xor edi, edi
inc edi
push edi
lea eax, [ebp]
push eax
lea eax, [ebp - 0x34]
push eax
call fcn.0047c2c2
pop ecx
pop ecx
mov byte [ebp - 4], 6
cmp dword [eax + 0x18], 0x10
jb 0x40d6b6
mov eax, dword [eax + 4]
jmp 0x40d6b9
add eax, 4
push eax
push ebx
sub esp, 0x1c
lea eax, [ebp + 0x70]
mov ecx, esp
mov dword [ebp - 0x14], esp
push eax
call fcn.00403757
push 0x7a
sub esp, 0x1c
mov byte [ebp - 4], 7
mov ecx, esp
mov dword [ebp - 0x18], esp
push str.http:__api.app.i.sogou.com_download_id_311558
call fcn.00401685
mov byte [ebp - 4], 8
call fcn.004064a6
mov ecx, eax
mov byte [ebp - 4], 6
call fcn.0040a332
push ebx
cmp eax, ebx
push edi
lea ecx, [ebp - 0x34]
setne byte [ebp - 0xd]
mov byte [ebp - 4], 5
call fcn.004017de
cmp byte [ebp - 0xd], bl
je 0x40d720
push ebx
push edi
lea ecx, [ebp]
call fcn.0040184d
jmp 0x40d600
push 0xffffffffffffffff
push ebx
lea eax, [ebp + 0x70]
push eax
lea ecx, [esi + 0x78]
call fcn.004019f3
push ebx
push edi
jmp 0x40d683