Function at 0x47d180
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x463c
call fcn.004b6c70
mov eax, dword [0x510620]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, ecx
cmp esi, 3
je 0x47d4c5
cmp esi, 2
je 0x47d1cd
cmp esi, 1
je 0x47d1cd
mov eax, 0x10000
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
cmp dword [edi + 4], 0xffffffff
je 0x47d1da
mov ecx, dword [edi]
call fcn.0047c960
mov eax, dword [edi]
mov ecx, dword [ebp + 8]
mov dword [edi + 4], 0xffffffff
cmp ecx, dword [eax + 4]
jge 0x47d1b5
cmp ecx, dword [eax + 0x10]
jge 0x47d1fa
mov ecx, eax
call fcn.0047c1c0
mov ecx, dword [ebp + 8]
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jge 0x47d257
mov esi, dword [edi]
test esi, esi
je 0x47d24d
cmp dword [esi + 0x18], 0
je 0x47d24d
mov edx, dword [esi + 0x10]
inc edx
cmp edx, dword [esi + 4]
je 0x47d24d
mov ecx, dword [esi + 0x50]
sub esp, 0x10
mov eax, dword [esi + 0x48]
add ecx, dword [esi + 0x4c]
add eax, 0x2e
add eax, ecx
mov dword [esi + 0x10], edx
add dword [esi + 0x14], eax
lea edx, [esi + 0x28]
push 0
lea eax, [esi + 0x78]
mov ecx, esi
push 0
push eax
call fcn.0047bd80
mov ecx, dword [ebp + 8]
add esp, 0x1c
neg eax
sbb eax, eax
inc eax
mov dword [esi + 0x18], eax
mov eax, dword [edi]
cmp dword [eax + 0x10], ecx
jl 0x47d201
mov esi, dword [ebp + 0x14]
lea eax, [ebp - 0x4638]
push eax
push ecx
mov ecx, edi
call fcn.0047cb10
test byte [ebp - 0x4434], 0x10
je 0x47d2cf
cmp esi, 1
je 0x47d2ba
push 0x3fe
lea eax, [ebp - 0x408]
push 0
push eax
call fcn.0049aba0
add esp, 0xc
lea eax, [ebp - 0x408]
push 0x1ff
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x4634]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ecx, [edi + 0x234]
lea edx, [ebp - 0x408]
call fcn.0047d080
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
cmp esi, 1
je 0x47d3d9
movzx eax, word [ebx]
mov edx, ebx
mov ecx, ebx
test ax, ax
je 0x47d3bd
cmp ax, 0x2f
je 0x47d2f4
cmp ax, 0x5c
jne 0x47d2f7
lea edx, [ecx + 2]
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x47d2e8
cmp edx, ebx
je 0x47d3bd
lea esi, [ebp - 0x408]
mov ecx, ebx
sub esi, ebx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [esi + ecx - 2], ax
test ax, ax
jne 0x47d315
sub edx, ebx
sar edx, 1
lea edx, [edx*2 - 2]
cmp edx, 0x400
jae 0x47d572
xor eax, eax
mov word [ebp + edx - 0x408], ax
mov ax, word [ebp - 0x408]
cmp ax, 0x2f
je 0x47d36a
cmp ax, 0x5c
je 0x47d36a
cmp word [ebp - 0x406], 0x3a
mov byte [ebp - 0x4639], 0
jne 0x47d371
mov byte [ebp - 0x4639], 1
lea eax, [ebp - 0x408]
push 0x4ee3fc
push eax
call fcn.004cafdc
mov esi, eax
lea eax, [ebp - 0x408]
push 0x4efb48
push eax
call fcn.004cafdc
add esp, 0x10
test eax, eax
setne cl
test esi, esi
setne al
or cl, al
or cl, byte [ebp - 0x4639]
jne 0x47d3bd
lea ecx, [edi + 0x234]
lea edx, [ebp - 0x408]
call fcn.0047d080
push 0
push dword [ebp - 0x4434]
push 2
push 0
push 0
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x47d3f6
mov eax, 0x200
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.0047c6b0
mov ecx, dword [edi]
lea edx, [ebp - 0x4408]
push 0x4000
mov byte [ebp - 0x4639], 0
call fcn.0047c7d0
add esp, 4
test eax, eax
js 0x47d456
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x47d45d
push 0
lea ecx, [ebp - 0x440c]
push ecx
push eax
lea eax, [ebp - 0x4408]
push eax
push ebx
call esi
test eax, eax
je 0x47d456
mov ecx, dword [edi]
lea edx, [ebp - 0x4408]
push 0x4000
call fcn.0047c7d0
add esp, 4
test eax, eax
jns 0x47d423
mov byte [ebp - 0x4639], 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x47d48e
cmp byte [ebp - 0x4639], 0
jne 0x47d48e
lea eax, [ebp - 0x4420]
push eax
lea eax, [ebp - 0x4430]
push eax
lea eax, [ebp - 0x4428]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x47d49b
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.0047c960
xor eax, eax
mov ecx, 0x400
cmp byte [ebp - 0x4639], al
cmovne eax, ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [edi + 4]
mov esi, dword [ebp + 8]
cmp esi, eax
je 0x47d518
cmp eax, 0xffffffff
je 0x47d4db
mov ecx, dword [edi]
call fcn.0047c960
mov ecx, dword [edi]
mov dword [edi + 4], 0xffffffff
cmp esi, dword [ecx + 4]
jge 0x47d1b5
cmp esi, dword [ecx + 0x10]
jge 0x47d4f7
call fcn.0047c1c0
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jge 0x47d50e
mov edi, edi
mov ecx, dword [edi]
call fcn.0047c200
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x47d500
mov ecx, dword [edi]
call fcn.0047c6b0
mov dword [edi + 4], esi
push dword [ebp + 0x10]
mov ecx, dword [edi]
mov edx, ebx
call fcn.0047c7d0
mov esi, eax
add esp, 4
test esi, esi
jle 0x47d545
mov eax, 0x600
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [edi]
call fcn.0047c960
mov ecx, dword [ebp - 4]
neg esi
mov dword [edi + 4], 0xffffffff
sbb esi, esi
xor ecx, ebp
and esi, 0x5000000
pop edi
mov eax, esi
pop esi
pop ebx
call fcn.00494c10
mov esp, ebp
pop ebp
ret 0x10
call fcn.00499daf
int3