Function at 0x418078
Capabilities:
Write file on windows

Disassembly:
push 0x64
push 0x513f00
call fcn.0044769c
mov edi, ecx
mov dword [ebp - 0x38], edi
xor edx, edx
mov dword [ebp - 0x1c], edx
or dword [ebp - 0x20], 0xffffffff
mov dword [ebp - 0x24], edx
mov dword [ebp - 0x28], edx
mov dword [ebp - 4], edx
xor ecx, ecx
inc ecx
mov dword [ebp - 4], ecx
mov eax, dword [ebp + 0x10]
cmp eax, edx
je 0x4180aa
mov dword [eax], edx
cmp dword [ebp + 8], edx
je 0x4182ea
mov ebx, dword [ebp + 0xc]
cmp ebx, edx
je 0x4182ea
mov dword [ebp - 0x2c], 2
cmp dword [ebp + 0x18], edx
je 0x4180d9
mov eax, dword [ebp + 0x1c]
or eax, dword [ebp + 0x20]
jne 0x4180d9
mov dword [ebp - 0x2c], 4
push edx
push 0x80
push dword [ebp - 0x2c]
push edx
push ecx
push 0x40000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
jne 0x418108
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1c], eax
jmp 0x4182f1
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x30]
push eax
mov esi, dword [edi + 0x10]
mov edi, dword [edi + 8]
call fcn.004172f3
test eax, eax
je 0x4180fa
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x4c], eax
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 0x48], ecx
push ecx
push eax
push ebx
mov edi, dword [ebp + 8]
push edi
push str.RpcFileIOWrapper::DownloadFile__s_:_DLAuth_ShadowGetFileSize__s__I64d
call fcn.0048c000
add esp, 0x14
xor ebx, ebx
mov esi, dword [ebp - 0x38]
cmp dword [ebp + 0x14], ebx
je 0x4181bd
cmp dword [esi + 0x14], ebx
je 0x4181bd
push 0x28
push ebx
lea eax, [ebp - 0x74]
push eax
call fcn.004424d0
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x74], eax
push 4
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x68]
push eax
call fcn.00442550
push 4
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x6c]
push eax
call fcn.00442550
add esp, 0x24
mov eax, dword [ebp + 0x1c]
add dword [ebp - 0x6c], eax
mov eax, dword [ebp + 0x20]
adc dword [ebp - 0x68], eax
mov dword [ebp - 0x64], edi
lea eax, [ebp - 0x24]
push eax
push dword [esi + 0x18]
lea eax, [ebp - 0x74]
push eax
xor edx, edx
xor ecx, ecx
call dword [esi + 0x14]
cmp dword [ebp - 0x24], ebx
je 0x4181bd
mov eax, dword [ebp + 0x10]
cmp eax, ebx
je 0x4182f1
mov dword [eax], 1
jmp 0x4182f1
cmp dword [ebp + 0x18], ebx
je 0x4181d9
mov edi, dword [ebp + 0x1c]
mov eax, edi
or eax, dword [ebp + 0x20]
jne 0x4181ff
push 2
push ebx
push ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi]
push dword [ebp + 0x14]
push 0xffffffffffffffff
push ebx
push ebx
push dword [ebp + 0x10]
push ebx
push dword [ebp - 0x20]
push ebx
push dword [ebp + 0xc]
mov ecx, esi
call dword [eax + 8]
test eax, eax
jne 0x4182f1
jmp 0x4180fa
push 0x2000
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x28], eax
cmp eax, ebx
jne 0x418226
mov dword [ebp - 0x1c], 0xe
jmp 0x4182f1
and edi, 0x1fff
push ebx
lea ecx, [ebp + 8]
push ecx
push edi
push eax
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4180fa
cmp dword [ebp + 0x14], ebx
je 0x418277
mov eax, dword [esi + 0x14]
cmp eax, ebx
je 0x418277
mov dword [ebp - 0x68], edi
lea ecx, [ebp - 0x24]
push ecx
push dword [esi + 0x18]
lea ecx, [ebp - 0x74]
push ecx
xor edx, edx
xor edi, edi
inc edi
mov ecx, edi
call eax
cmp dword [ebp - 0x24], ebx
je 0x41827a
mov eax, dword [ebp + 0x10]
cmp eax, ebx
je 0x4182f1
mov dword [eax], edi
jmp 0x4182f1
xor edi, edi
inc edi
mov ecx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0x20]
shrd ecx, eax, 0xd
shr eax, 0xd
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x44]
or eax, dword [ebp - 0x40]
je 0x4181d9
push ebx
lea eax, [ebp + 8]
push eax
push 0x2000
push dword [ebp - 0x28]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4180fa
cmp dword [ebp + 0x14], ebx
je 0x4182e0
mov eax, dword [esi + 0x14]
cmp eax, ebx
je 0x4182e0
mov dword [ebp - 0x68], 0x2000
lea ecx, [ebp - 0x24]
push ecx
push dword [esi + 0x18]
lea ecx, [ebp - 0x74]
push ecx
xor edx, edx
mov ecx, edi
call eax
cmp dword [ebp - 0x24], ebx
jne 0x41826c
add dword [ebp - 0x44], 0xffffffff
adc dword [ebp - 0x40], 0xffffffff
jmp 0x41828d
mov dword [ebp - 0x1c], 0x57
and dword [ebp - 4], 0
call fcn.004182fc
jmp 0x41833d
mov dword [ebp - 4], 0xfffffffe
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
cmp dword [ebp - 0x1c], eax
sete al
call fcn.004476e1
ret 0x1c