Function at 0x402235
Capabilities:
Get common file path
Write file on windows

Disassembly:
push 0x298
mov eax, 0x42464d
call fcn.00410a55
mov eax, dword [ebp + 8]
xor ebx, ebx
push 0x206
mov dword [ebp - 0x228], eax
lea eax, [ebp - 0x21e]
push ebx
mov dword [ebp - 0x224], ebx
push eax
mov word [ebp - 0x220], bx
call fcn.00410b00
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
push ebx
push ebx
push 0x1a
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [0x4312e4]
mov ecx, 0x4312e4
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x23c], eax
push 0x69
mov dword [ebp - 4], ebx
call fcn.004049df
cmp eax, ebx
pop ecx
je 0x4022b7
push 0x69
push eax
lea eax, [ebp - 0x23c]
push eax
call fcn.00403f1d
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x238]
push eax
call fcn.0040387b
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x23c]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x238]
call fcn.00403c7c
mov esi, 0x428ae4
lea edi, [ebp - 0x18]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x228]
movsw word es:[edi], word [esi]
jmp 0x40241f
movzx eax, word [esi]
cmp ax, 0x49
je 0x4023a5
cmp ax, 0x69
je 0x4023a5
cmp ax, 0x73
je 0x402327
cmp ax, 0x53
je 0x402327
inc esi
inc esi
jmp 0x402419
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x238]
push eax
call fcn.00403933
push 0x5b
push esi
call fcn.0040e2b1
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
je 0x4029ec
inc esi
inc esi
push 0x5d
push esi
call fcn.0040e2b1
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp - 0x234], eax
je 0x4029ec
mov edi, eax
sub edi, esi
sar edi, 1
cmp edi, 1
jle 0x402410
push esi
mov ecx, 0x4312e4
lea esi, [ebp - 0x224]
call fcn.00403c28
mov eax, esi
lea edi, [ebp - 0x238]
mov byte [ebp - 4], 3
call fcn.004038f2
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x224]
jmp 0x402408
inc esi
inc esi
push 0x5b
push esi
call fcn.0040e2b1
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
je 0x4029ec
inc esi
inc esi
push 0x5d
push esi
call fcn.0040e2b1
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp - 0x234], eax
je 0x4029ec
mov edi, eax
sub edi, esi
sar edi, 1
cmp edi, 1
jle 0x402410
push esi
mov ecx, 0x4312e4
lea esi, [ebp - 0x228]
call fcn.00403c28
mov eax, esi
push eax
mov byte [ebp - 4], 2
call fcn.00401f05
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x228]
pop ecx
add eax, 0xfffffff0
call fcn.00404c04
mov esi, dword [ebp - 0x234]
add esi, 2
lea eax, [ebp - 0x18]
push eax
mov eax, esi
call fcn.00401ec4
mov esi, eax
cmp esi, ebx
pop ecx
jne 0x4022fd
lea edi, [ebp - 0x288]
call fcn.0040a424
lea esi, [ebp - 0x230]
mov byte [ebp - 4], 4
call fcn.00408d0a
mov byte [ebp - 4], 5
cmp dword [eax], ebx
mov dword [ebp - 0x224], 1
je 0x40249c
lea esi, [ebp - 0x234]
call fcn.00409ae3
mov dword [ebp - 4], 6
cmp dword [eax], ebx
mov dword [ebp - 0x224], 3
je 0x40249c
lea ebx, [ebp - 0x228]
call fcn.004084b6
xor ebx, ebx
cmp dword [eax], ebx
mov dword [ebp - 0x224], 7
mov byte [ebp - 0x229], bl
jne 0x4024a3
mov byte [ebp - 0x229], 1
test byte [ebp - 0x224], 4
je 0x4024c8
mov edi, dword [ebp - 0x228]
and dword [ebp - 0x224], 0xfffffffb
cmp edi, ebx
je 0x4024c2
call fcn.00401000
mov dword [ebp - 0x228], ebx
mov dword [ebp - 4], 5
test byte [ebp - 0x224], 2
je 0x4024f4
mov edi, dword [ebp - 0x234]
and dword [ebp - 0x224], 0xfffffffd
cmp edi, ebx
je 0x4024ee
call fcn.00401000
mov dword [ebp - 0x234], ebx
mov dword [ebp - 4], 4
test byte [ebp - 0x224], 1
je 0x40251a
mov edi, dword [ebp - 0x230]
and dword [ebp - 0x224], 0xfffffffe
cmp edi, ebx
je 0x40251a
call fcn.00401000
cmp byte [ebp - 0x229], bl
je 0x402578
cmp dword [0x43059c], 0xffffffff
je 0x4029dd
push str.CFileDownloadMaster_or_CInstallMaster_or_CConfigMaster_instance_error_n
lea eax, [ebp - 0x228]
push eax
mov dword [ebp - 0x230], ebx
call fcn.004036ef
mov eax, dword [ebp - 0x228]
mov ecx, dword [eax - 0xc]
push ebx
lea edx, [ebp - 0x230]
push edx
push ecx
push eax
push dword [0x43059c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
call fcn.00404c04
jmp 0x4029dd
mov dword [ebp - 0x24c], ebx
mov dword [ebp - 0x248], ebx
mov dword [ebp - 0x244], ebx
lea ebx, [ebp - 0x230]
mov byte [ebp - 4], 7
call fcn.004084b6
lea ecx, [ebp - 0x250]
mov byte [ebp - 4], 8
mov eax, dword [eax]
push ecx
push eax
call fcn.00408604
mov bl, al
neg bl
sbb bl, bl
mov byte [ebp - 4], 7
mov edi, dword [ebp - 0x230]
xor esi, esi
inc bl
cmp edi, esi
je 0x4025c9
call fcn.00401000
test bl, bl
je 0x402623
cmp dword [0x43059c], 0xffffffff
je 0x4029d2
push str.CConfigMaster_GetDownloadList_error_n
lea eax, [ebp - 0x228]
push eax
mov dword [ebp - 0x230], esi
call fcn.004036ef
mov eax, dword [ebp - 0x228]
mov ecx, dword [eax - 0xc]
push esi
lea edx, [ebp - 0x230]
push edx
push ecx
push eax
push dword [0x43059c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
call fcn.00404c04
jmp 0x4029d2
cmp dword [ebp - 0x24c], esi
je 0x4029d2
mov eax, dword [ebp - 0x248]
sub eax, dword [ebp - 0x24c]
sar eax, 5
je 0x4029d2
xor edi, edi
cmp dword [0x4305d0], esi
jne 0x402654
mov dword [0x4305d0], esi
lea eax, [ebp - 0x268]
push eax
push 0x431270
mov ebx, 0x4305a0
call fcn.00404d38
pop ecx
pop ecx
movzx eax, ax
push eax
push esi
push 0
push 0x56000000
push 0
push edi
lea ebx, [ebp - 0x288]
call fcn.00404c58
push dword [ebp - 0x284]
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x4029d2
and dword [ebp - 0x234], edi
lea esi, [ebp - 0x230]
call fcn.00408d0a
mov byte [ebp - 4], 9
mov edi, dword [eax]
mov eax, dword [ebp - 0x284]
or dword [ebp - 0x224], 8
push 0x48
mov dword [edi + 0x60], eax
call fcn.0040e029
test eax, eax
pop ecx
je 0x4026d6
mov esi, eax
call fcn.004050e2
jmp 0x4026d8
xor eax, eax
lea esi, [edi + 0x30]
call fcn.00409057
mov esi, dword [esi]
test esi, esi
je 0x40271d
call fcn.004051b6
test al, al
je 0x40271d
lea esi, [ebp - 0x228]
call fcn.00409ae3
mov dword [ebp - 4], 0xa
mov edi, dword [eax]
mov eax, dword [ebp - 0x284]
or dword [ebp - 0x224], 0x10
call fcn.00409b5d
test al, al
je 0x40271d
mov bl, 1
jmp 0x40271f
xor bl, bl
mov dword [ebp - 4], 9
test byte [ebp - 0x224], 0x10
je 0x40274c
mov edi, dword [ebp - 0x228]
and dword [ebp - 0x224], 0xffffffef
test edi, edi
je 0x402745
call fcn.00401000
and dword [ebp - 0x228], 0
mov dword [ebp - 4], 7
test byte [ebp - 0x224], 8
je 0x40276b
mov edi, dword [ebp - 0x230]
test edi, edi
je 0x40276b
call fcn.00401000
test bl, bl
je 0x402982
cmp dword [0x43059c], 0xffffffff
je 0x4027c2
and dword [ebp - 0x230], 0
push str.CFileDownloadMaster_and_CInstallMaster_init_success__n
lea eax, [ebp - 0x228]
push eax
call fcn.004036ef
mov eax, dword [ebp - 0x228]
mov ecx, dword [eax - 0xc]
push 0
lea edx, [ebp - 0x230]
push edx
push ecx
push eax
push dword [0x43059c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
call fcn.00404c04
mov esi, dword [ebp - 0x24c]
cmp esi, dword [ebp - 0x248]
jbe 0x4027d5
call fcn.0040e5e3
lea eax, [ebp - 0x250]
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], esi
mov esi, dword [ebp - 0x248]
cmp dword [ebp - 0x24c], esi
jbe 0x4027fa
call fcn.0040e5e3
cmp dword [ebp - 0x258], 0
je 0x402811
lea eax, [ebp - 0x250]
cmp dword [ebp - 0x258], eax
je 0x402816
call fcn.0040e5e3
cmp dword [ebp - 0x254], esi
je 0x402979
lea esi, [ebp - 0x258]
call fcn.00403beb
lea esi, [ebp - 0x228]
mov ebx, eax
call fcn.00408d0a
mov byte [ebp - 4], 0xb
mov edx, dword [ebx + 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebx + 0x10]
push edx
push dword [ebp - 0x238]
push ebx
push eax
call fcn.00408d84
mov byte [ebp - 4], 7
mov edi, dword [ebp - 0x228]
test edi, edi
mov byte [ebp - 0x229], al
je 0x40286d
call fcn.00401000
and dword [ebp - 0x228], 0
cmp byte [ebp - 0x229], 0
je 0x402979
cmp dword [0x43059c], 0xffffffff
je 0x402911
mov eax, dword [0x4312e4]
and dword [ebp - 0x240], 0
mov ecx, 0x4312e4
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x234], eax
mov byte [ebp - 4], 0xc
push dword [ebx + 0x10]
lea eax, [ebp - 0x234]
push str.CFileDownloadMaster_AddDownloadJob:__s_n
call fcn.004044af
mov esi, dword [ebp - 0x234]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x230]
push eax
call fcn.004036ef
mov eax, dword [ebp - 0x230]
mov ecx, dword [eax - 0xc]
push 0
lea edx, [ebp - 0x240]
push edx
push ecx
push eax
push dword [0x43059c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x230]
add eax, 0xfffffff0
call fcn.00404c04
lea eax, [esi - 0x10]
mov byte [ebp - 4], 7
call fcn.00404c04
cmp dword [ebx + 0x14], 0
push ecx
mov dword [ebp - 0x234], 1
mov eax, esp
mov dword [ebp - 0x240], esp
jne 0x40293b
push str.filexml
push eax
call fcn.004036aa
mov byte [ebp - 4], 0xd
jmp 0x40294a
push str.fileexe
push eax
call fcn.004036aa
mov byte [ebp - 4], 0xe
push ecx
mov eax, esp
mov dword [ebp - 0x224], esp
push str.startDownload
push eax
call fcn.004036aa
mov byte [ebp - 4], 7
call fcn.00401c99
pop ecx
pop ecx
lea esi, [ebp - 0x258]
call fcn.00403c08
jmp 0x4027e7
cmp dword [ebp - 0x234], 0
jne 0x40299e
push dword [ebp - 0x284]
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x40299e
push dword [ebp - 0x284]
call dword [sym.imp.USER32.dll_DestroyWindow]
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
xor edi, edi
jmp 0x4029c2
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageW]
push edi
push edi
push edi
lea eax, [ebp - 0x2a4]
push eax
call esi
test eax, eax
jne 0x4029a8
lea edi, [ebp - 0x250]
call fcn.00403b60
lea eax, [ebp - 0x288]
mov byte [ebp - 4], 1
call fcn.0040a47f
mov eax, dword [ebp - 0x238]
add eax, 0xfffffff0
call fcn.00404c04
mov eax, dword [ebp - 0x23c]
add eax, 0xfffffff0
call fcn.00404c04
call fcn.00410ad8
ret