Function at 0x4c1c60
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x18], 0
test edi, edi
jne 0x4c1c8b
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x138]
mov eax, ecx
mov edx, dword [esi + 0x13c]
or eax, edx
je 0x4c1e8f
cmp dword [esi + 0x11c], 0xffffffff
je 0x4c1e8f
mov eax, dword [esi + 0x118]
and eax, 0x1000
mov dword [ebp - 0x24], eax
neg eax
push ebx
sbb eax, eax
and eax, 0x4000
mov dword [ebp - 0x10], eax
test edx, edx
jl 0x4c1d00
jg 0x4c1cd3
test ecx, ecx
jb 0x4c1d00
mov ebx, dword [esi + 0x120]
mov eax, dword [esi + 0x124]
add ebx, edi
adc eax, 0
cmp eax, edx
jl 0x4c1d00
jg 0x4c1cee
cmp ebx, ecx
jbe 0x4c1d00
mov edi, ecx
mov dword [ebp - 0x28], 0
sub edi, dword [esi + 0x120]
mov dword [ebp - 0x20], edi
test edi, edi
je 0x4c1e3a
mov ebx, dword [ebp + 0xc]
lea ecx, [esi + 0x120]
cmp dword [ebp - 0x24], 0
mov dword [ebp - 0x1c], ecx
jne 0x4c1d29
mov eax, dword [ecx]
mov edx, edi
mov dword [ebp - 8], eax
mov eax, dword [ecx + 4]
jmp 0x4c1dc9
lea eax, [ebx + edi]
mov ecx, ebx
cmp ebx, eax
jae 0x4c1d3c
cmp byte [ecx], 0
jne 0x4c1d3c
inc ecx
cmp ecx, eax
jb 0x4c1d32
mov eax, ecx
sub eax, ebx
cdq
add eax, dword [esi + 0x120]
mov dword [ebp + 0x10], eax
mov eax, edx
adc eax, dword [esi + 0x124]
sub ebx, ecx
mov edx, dword [ebp + 0x10]
add edi, ebx
mov dword [ebp - 0x14], eax
mov ebx, ecx
mov dword [esi + 0x120], edx
mov dword [esi + 0x124], eax
je 0x4c1e3a
push 0
push dword [ebp - 0x10]
push eax
push edx
call fcn.005003f0
mov ecx, dword [ebp + 0x10]
sub ecx, eax
mov dword [ebp - 0xc], edi
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 0x14]
sbb ecx, edx
add dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 8], eax
adc ecx, 0
mov eax, edi
cdq
add eax, dword [ebp + 0x10]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x14]
adc edx, eax
cmp edx, ecx
jl 0x4c1e46
mov ecx, dword [ebp - 4]
jg 0x4c1dbb
cmp dword [ebp - 0x28], ecx
jbe 0x4c1dc6
mov edx, dword [ebp - 8]
sub ecx, edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
xorps xmm0, xmm0
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x18]
mov dword [ebp + 0x10], ecx
mov ecx, dword [ebp - 8]
push eax
push edx
push ebx
push dword [esi + 0x11c]
movlpd qword [ebp - 0x40], xmm0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x38], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4c1e4d
mov eax, dword [ebp - 0x18]
add ebx, eax
mov ecx, dword [ebp - 0x1c]
sub edi, eax
add dword [esi + 0x130], eax
adc dword [esi + 0x134], 0
add dword [ecx], eax
mov eax, dword [ecx]
adc dword [ecx + 4], 0
mov ecx, dword [ecx + 4]
mov dword [esi + 0x12c], ecx
mov ecx, dword [ebp + 0x10]
mov dword [esi + 0x128], eax
test edi, edi
jne 0x4c1d11
mov eax, dword [ebp - 0x20]
pop ebx
sub eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov edx, edi
jmp 0x4c1dc9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x4c1e65
call fcn.0050f6ae
mov dword [eax], 9
jmp 0x4c1e6e
push eax
call fcn.004f0500
add esp, 4
call fcn.0050f6ae
push str.Write_failed
push dword [eax]
push esi
call fcn.004c2100
add esp, 0xc
mov eax, 0xffffffec
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push str.Attempt_to_write_to_an_empty_file
push 0
push esi
call fcn.004c2100
add esp, 0xc
mov eax, 0xffffffec
pop edi
pop esi
mov esp, ebp
pop ebp
ret