Function at 0x4787c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x6044
call fcn.004aa4c0
mov eax, dword [0x4efc64]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov dword [ebp - 0x603c], eax
mov eax, dword [ebp + 0x14]
push esi
mov ebx, ecx
push edi
mov dword [ebp - 0x6038], ebx
cmp eax, 3
je 0x478b8c
cmp eax, 2
je 0x478822
cmp eax, 1
je 0x478822
cmp eax, 4
je 0x478b8c
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 4
je 0x478b8c
or esi, 0xffffffff
cmp dword [ebx + 4], esi
je 0x47883a
mov edi, dword [ebx]
call fcn.00477c00
mov edi, dword [ebp + 8]
mov dword [ebx + 4], esi
mov esi, dword [ebx]
cmp edi, dword [esi + 4]
jge 0x47880a
cmp edi, dword [esi + 0x10]
jge 0x478851
call fcn.00477430
mov ecx, dword [ebx]
cmp dword [ecx + 0x10], edi
jge 0x478866
mov esi, dword [ebx]
call fcn.00477470
mov edx, dword [ebx]
cmp dword [edx + 0x10], edi
jl 0x478858
push edi
mov edi, dword [ebp - 0x6038]
lea ebx, [ebp - 0x6030]
mov ecx, edi
call fcn.00477f90
test byte [ebp - 0x402c], 0x10
je 0x4788ef
cmp dword [ebp + 0x14], 1
je 0x4788da
mov ecx, dword [ebp - 0x603c]
movzx eax, word [ecx]
cmp ax, 0x2f
je 0x4788aa
cmp ax, 0x5c
je 0x4788aa
test ax, ax
je 0x4788ca
cmp word [ecx + 2], 0x3a
jne 0x4788ca
push ecx
push 0
call fcn.00478680
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
push ecx
add edi, 0x203c
push edi
call fcn.00478680
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebp + 0x14], 1
jne 0x478900
mov esi, dword [ebp - 0x603c]
jmp 0x4789c3
mov edx, dword [ebp - 0x603c]
movzx eax, word [edx]
mov ebx, edx
mov ecx, edx
test ax, ax
je 0x478930
movzx eax, ax
cmp ax, 0x2f
je 0x478921
cmp ax, 0x5c
jne 0x478924
lea ebx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x478915
lea edi, [ebp - 0x2008]
mov eax, edx
sub edi, edx
lea ebx, [ebx]
movzx ecx, word [eax]
mov word [edi + eax], cx
add eax, 2
test cx, cx
jne 0x478940
cmp ebx, edx
jne 0x4789e4
xor eax, eax
mov word [ebp - 0x2008], ax
mov edi, dword [ebp - 0x6038]
push ebx
lea eax, [ebp - 0x2008]
push eax
add edi, 0x203c
push edi
lea ecx, [ebp - 0x4008]
push str._s_s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
lea edx, [ebp - 0x2008]
push edx
push edi
call fcn.00478680
add esp, 8
mov eax, dword [ebp - 0x402c]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x4008]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, dword [ebp - 0x6038]
mov esi, eax
cmp esi, 0xffffffff
jne 0x478a4e
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
mov ecx, ebx
sub ecx, edx
sar ecx, 1
xor edx, edx
mov word [ebp + ecx*2 - 0x2008], dx
mov ax, word [ebp - 0x2008]
cmp ax, 0x2f
je 0x478a1e
cmp ax, 0x5c
je 0x478a1e
test ax, ax
je 0x478960
cmp word [ebp - 0x2006], 0x3a
jne 0x478960
push ebx
lea eax, [ebp - 0x2008]
push eax
lea ecx, [ebp - 0x4008]
push str._s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [ebp - 0x2008]
push edx
push 0
call fcn.00478680
add esp, 0x18
jmp 0x47899a
cmp dword [ebp - 0x400c], 0
mov dword [ebp - 0x603c], 0
jle 0x478b43
mov edx, dword [edi + 0x2034]
mov ebx, dword [edi]
push edx
call fcn.00477830
add esp, 4
cmp dword [edi + 0x2038], 0
jne 0x478a92
push 0x20000
call fcn.0049605d
add esp, 4
mov dword [edi + 0x2038], eax
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x478aa0
mov ecx, dword [edi + 0x2038]
lea eax, [ebp - 0x6031]
push eax
mov eax, dword [edi]
push ecx
mov ecx, 0x20000
call fcn.004779a0
mov edi, eax
add esp, 8
cmp edi, 0xffffff96
je 0x478b07
test edi, edi
jl 0x478b19
jle 0x478ae8
mov eax, dword [ebp - 0x6038]
mov ecx, dword [eax + 0x2038]
push 0
lea edx, [ebp - 0x6040]
push edx
push edi
push ecx
push esi
call ebx
test eax, eax
je 0x478b2b
cmp byte [ebp - 0x6031], 0
jne 0x478b3d
test edi, edi
mov edi, dword [ebp - 0x6038]
jne 0x478aa0
mov dword [ebp - 0x603c], 0x5000000
jmp 0x478b5f
mov edi, dword [ebp - 0x6038]
mov dword [ebp - 0x603c], 0x1000
jmp 0x478b5f
mov edi, dword [ebp - 0x6038]
mov dword [ebp - 0x603c], 0x5000000
jmp 0x478b5f
mov edi, dword [ebp - 0x6038]
mov dword [ebp - 0x603c], 0x400
jmp 0x478b5f
mov edi, dword [ebp - 0x6038]
lea edx, [ebp - 0x4018]
push edx
lea eax, [ebp - 0x4028]
push eax
lea ecx, [ebp - 0x4020]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x478b6c
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [edi]
call fcn.00477c00
mov eax, dword [ebp - 0x603c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebx + 4]
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x478c3f
cmp eax, 0xffffffff
je 0x478ba6
mov edi, dword [ebx]
call fcn.00477c00
mov eax, dword [ebx]
mov dword [ebx + 4], 0xffffffff
cmp esi, dword [eax + 4]
jge 0x47880a
cmp esi, dword [eax + 0x10]
jge 0x478bc7
mov esi, eax
call fcn.00477430
mov esi, dword [ebp + 8]
mov edx, dword [ebx]
cmp dword [edx + 0x10], esi
jge 0x478c20
mov edi, edi
mov esi, dword [ebx]
test esi, esi
je 0x478c16
cmp dword [esi + 0x18], 0
je 0x478c16
mov eax, dword [esi + 0x10]
inc eax
cmp eax, dword [esi + 4]
je 0x478c16
mov ecx, dword [esi + 0x50]
add ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
lea ecx, [ecx + edx + 0x2e]
add dword [esi + 0x14], ecx
mov dword [esi + 0x10], eax
push 0
lea edx, [esi + 0x78]
push edx
lea eax, [esi + 0x28]
push eax
xor eax, eax
mov ecx, esi
call fcn.004771c0
add esp, 0xc
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov ecx, dword [ebx]
mov edx, dword [ebp + 8]
cmp dword [ecx + 0x10], edx
jl 0x478bd0
mov eax, dword [ebx + 0x2034]
mov ebx, dword [ebx]
push eax
call fcn.00477830
mov edx, dword [ebp - 0x6038]
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [edx + 4], ecx
mov ebx, edx
mov ecx, dword [ebp - 0x603c]
lea eax, [ebp - 0x6031]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, dword [ebp + 0x10]
call fcn.004779a0
mov esi, eax
add esp, 8
test esi, esi
jg 0x478c6e
mov edi, dword [ebx]
call fcn.00477c00
mov dword [ebx + 4], 0xffffffff
cmp byte [ebp - 0x6031], 0
jne 0x4788da
test esi, esi
jle 0x478c97
mov eax, 0x600
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp - 4]
mov eax, esi
sub eax, 0xffffff96
neg eax
sbb eax, eax
pop edi
and eax, 0x4fff000
pop esi
xor ecx, ebp
add eax, 0x1000
pop ebx
call fcn.004a4491
mov esp, ebp
pop ebp
ret 0x10