Function at 0x476980
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x4130
call fcn.0047c630
push ebx
push ebp
mov ebp, dword [esp + 0x4148]
push esi
cmp ebp, 3
push edi
mov esi, ecx
je 0x4769c0
cmp ebp, 2
je 0x476a88
cmp ebp, 1
je 0x476a88
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x4130
ret 0x10
mov eax, dword [esi + 4]
mov edi, dword [esp + 0x4144]
or ebx, 0xffffffff
cmp edi, eax
je 0x476a2f
cmp eax, ebx
je 0x4769e0
mov eax, dword [esi]
push eax
call fcn.004762b0
add esp, 4
mov eax, dword [esi]
mov dword [esi + 4], ebx
cmp edi, dword [eax + 4]
jl 0x4769fc
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x4130
ret 0x10
cmp edi, dword [eax + 0x10]
jge 0x476a0a
push eax
call fcn.00475cc0
add esp, 4
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x476a21
push eax
call fcn.00475d10
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x476a11
mov ecx, dword [esi]
push ecx
call fcn.00475f90
add esp, 4
mov dword [esi + 4], edi
mov edx, dword [esp + 0x414c]
mov eax, dword [esp + 0x4148]
mov ecx, dword [esi]
push edx
push eax
push ecx
call fcn.004760c0
mov edi, eax
add esp, 0xc
test edi, edi
jle 0x476a62
pop edi
pop esi
pop ebp
mov eax, 0x600
pop ebx
add esp, 0x4130
ret 0x10
mov edx, dword [esi]
push edx
call fcn.004762b0
add esp, 4
mov eax, edi
neg eax
mov dword [esi + 4], ebx
pop edi
sbb eax, eax
pop esi
pop ebp
and eax, 0x5000000
pop ebx
add esp, 0x4130
ret 0x10
mov eax, dword [esi + 4]
or ebx, 0xffffffff
cmp eax, ebx
je 0x476a9d
mov eax, dword [esi]
push eax
call fcn.004762b0
add esp, 4
mov eax, dword [esi]
mov edi, dword [esp + 0x4144]
mov dword [esi + 4], ebx
cmp edi, dword [eax + 4]
jl 0x476ac0
pop edi
pop esi
pop ebp
mov eax, 0x10000
pop ebx
add esp, 0x4130
ret 0x10
cmp edi, dword [eax + 0x10]
jge 0x476ace
push eax
call fcn.00475cc0
add esp, 4
mov eax, dword [esi]
cmp dword [eax + 0x10], edi
jge 0x476ae5
push eax
call fcn.00475d10
mov eax, dword [esi]
add esp, 4
cmp dword [eax + 0x10], edi
jl 0x476ad5
lea ecx, [esp + 0x14]
push ecx
push edi
mov ecx, esi
call fcn.004764b0
mov edx, dword [esp + 0x4148]
cmp ebp, 1
je 0x476b24
cmp byte [edx], 0
je 0x476b24
mov edi, edx
mov ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov cl, byte [ecx + edx - 1]
cmp cl, 0x5c
je 0x476c3f
cmp cl, 0x2f
je 0x476c3f
mov eax, dword [esp + 0x11c]
test al, 0x10
jne 0x476c3f
cmp ebp, 1
jne 0x476b3c
mov edi, edx
jmp 0x476b55
push 0
push eax
push 2
push 0
push 0
push 0x40000000
push edx
call fcn.00471960
add esp, 0x1c
mov edi, eax
cmp edi, ebx
jne 0x476b6b
pop edi
pop esi
pop ebp
mov eax, 0x200
pop ebx
add esp, 0x4130
ret 0x10
mov edx, dword [esi]
push edx
call fcn.00475f90
mov ecx, dword [esi]
lea eax, [esp + 0x144]
push 0x4000
push eax
push ecx
xor bl, bl
call fcn.004760c0
add esp, 0x10
test eax, eax
jl 0x476bd3
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x476bd9
lea edx, [esp + 0x10]
push 0
push edx
push eax
lea eax, [esp + 0x14c]
push eax
push edi
call ebp
test eax, eax
je 0x476bd7
mov edx, dword [esi]
lea ecx, [esp + 0x140]
push 0x4000
push ecx
push edx
call fcn.004760c0
add esp, 0xc
test eax, eax
jge 0x476b97
mov ebp, dword [esp + 0x4150]
mov bl, 1
jmp 0x476be0
mov bl, 1
mov ebp, dword [esp + 0x4150]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x476c0f
test bl, bl
jne 0x476c0f
lea eax, [esp + 0x130]
lea ecx, [esp + 0x120]
push eax
lea edx, [esp + 0x12c]
push ecx
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp ebp, 1
je 0x476c1b
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
push eax
call fcn.004762b0
add esp, 4
neg bl
sbb ebx, ebx
pop edi
and ebx, 0x400
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x4130
ret 0x10
cmp ebp, 1
je 0x476c58
lea ecx, [esp + 0x18]
add esi, 0x138
push ecx
push esi
call fcn.004768f0
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x4130
ret 0x10