Function at 0x402610
Capabilities:
Write file on windows

Disassembly:
push ecx
push ebx
mov ebx, dword [esp + 0xc]
push ebp
push esi
mov eax, dword [ebx]
push edi
cmp eax, 0xffffffff
mov esi, ecx
jne 0x40274e
cmp dword [esi + 0x63c], 0xffffffff
jne 0x4026c0
lea edi, [esi + 0x10]
push 1
push ebx
push edi
call fcn.00402860
test eax, eax
jne 0x40274e
mov eax, dword [0x413560]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x402674
push edi
push 0x400
push 0x843
push 0x413560
call fcn.00401b70
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x40269e
push 0x800
push 8
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x402853
push edi
push str.ERROR:_Could_not_open__s_r_n
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push esi
push 0x410cd0
call fcn.004031d6
add esp, 8
push esi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 8
lea edi, [esi + 0x218]
push 0
push ebx
push edi
mov ecx, esi
call fcn.00402860
test eax, eax
jne 0x40274e
mov eax, dword [0x413560]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x402702
push edi
push 0x400
push 0x843
push 0x413560
call fcn.00401b70
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x40272c
push 0x800
push 8
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x402853
push edi
push str.ERROR:_Could_not_open__s_r_n
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push esi
push 0x410cd0
call fcn.004031d6
add esp, 8
push esi
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 8
mov ebp, dword [esp + 0x1c]
push 0x413568
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x402853
push ebp
mov dword [esp + 0x14], 0
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
mov eax, dword [esi + 0x638]
shl edi, 1
cmp eax, 2
push 0
jne 0x40279e
mov ecx, dword [ebx]
lea eax, [esp + 0x14]
push eax
push edi
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 8
lea edx, [edi + 0x10000]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_HeapCreate]
test eax, eax
mov dword [esi + 0x648], eax
jne 0x4027bd
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
lea ecx, [edi + 2]
push ecx
push 8
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x4027ea
push str.HeapAlloc_in_AppendToFile_failed__r_n
push 0x410cd0
call fcn.004031d6
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 8
push 0
push 0
push edi
push ebx
push 0xffffffffffffffff
push ebp
push 0
push 1
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x40281e
lea edx, [esp + 0x10]
push 0
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esp + 0x24]
push ebx
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi + 0x648]
test eax, eax
jne 0x40282e
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esi + 0x648]
test eax, eax
je 0x402853
push eax
call dword [sym.imp.KERNEL32.dll_HeapDestroy]
mov dword [esi + 0x648], 0
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 8