Function at 0x507ca8
Capabilities:
Clear file content

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 0x10
add esp, 0xfffff004
push eax
dec eax
jne 0x507cb1
mov eax, dword [ebp - 4]
add esp, 0xffffffe4
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 4], ebx
mov byte [ebp - 5], cl
mov esi, edx
mov ebx, eax
xor eax, eax
push ebp
push 0x507f45
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [ebx + 0x34], 0
je 0x507cfa
push 0x40
mov ecx, dword [ebx + 0x34]
mov dl, 1
mov eax, dword [0x497b60]
call fcn.004bc4f4
mov dword [ebp - 0x20], eax
jmp 0x507d00
mov eax, dword [ebx + 4]
mov dword [ebp - 0x20], eax
mov eax, dword [ebx + 0x10]
mov edx, dword [ebx + 0x14]
add eax, dword [ebp + 0x1c]
adc edx, dword [ebp + 0x20]
push edx
push eax
mov eax, dword [ebp - 0x20]
call fcn.004ba67c
mov eax, esi
mov edx, dword [0x497b60]
call fcn.00408f9c
test al, al
je 0x507d5c
push dword [ebp + 0x10]
push dword [ebp + 0xc]
mov eax, esi
mov edx, dword [0x497b60]
call fcn.00408fc0
mov edi, eax
mov eax, edi
call fcn.004ba67c
mov eax, dword [edi + 4]
push eax
call sub.kernel32.dll_SetEndOfFile
call fcn.0042becc
push 0
push 0
mov eax, esi
call fcn.004ba67c
movzx eax, byte [ebp + 8]
dec al
je 0x507d71
sub al, 2
je 0x507d95
sub al, 2
je 0x507de6
jmp 0x507e31
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebx + 0x24]
push dword [ebx + 0x20]
mov ecx, dword [ebx + 0x28]
mov edx, esi
mov eax, dword [ebp - 0x20]
call fcn.004fda18
jmp 0x507f14
mov ecx, esi
mov dl, 1
mov eax, dword [0x4fcea8]
call fcn.004fdaf4
mov edi, eax
mov dword [edi + 0x24], ebx
mov dword [edi + 0x20], 0x5079d0
mov eax, dword [ebp + 0xc]
mov dword [edi + 0x18], eax
mov eax, dword [ebp + 0x10]
mov dword [edi + 0x1c], eax
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebx + 0x24]
push dword [ebx + 0x20]
mov ecx, dword [ebx + 0x28]
mov edx, edi
mov eax, dword [ebp - 0x20]
call fcn.005083d4
mov eax, edi
call fcn.00408c84
jmp 0x507f14
mov ecx, esi
mov dl, 1
mov eax, dword [0x4fcea8]
call fcn.004fdaf4
mov edi, eax
mov dword [edi + 0x24], ebx
mov dword [edi + 0x20], 0x5079d0
mov eax, dword [ebp + 0xc]
mov dword [edi + 0x18], eax
mov eax, dword [ebp + 0x10]
mov dword [edi + 0x1c], eax
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebx + 0x24]
push dword [ebx + 0x20]
mov ecx, dword [ebx + 0x28]
mov edx, edi
mov eax, dword [ebp - 0x20]
call fcn.00508594
mov eax, edi
call fcn.00408c84
jmp 0x507f14
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], 0x10000
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0xc]
jne 0x507e5d
cmp eax, dword [ebp - 0x10]
jae 0x507e6b
jmp 0x507e5f
jge 0x507e6b
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x507e7b
cmp dword [ebp - 0x10], 0
je 0x507f14
lea edx, [ebp - 0x10020]
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x20]
mov edi, dword [eax]
call dword [edi + 0xc]
cmp dword [ebx + 0x28], 0
je 0x507ea9
push dword [ebx + 0x24]
push dword [ebx + 0x20]
mov ecx, dword [ebx + 0x28]
lea eax, [ebp - 0x10020]
mov edx, dword [ebp - 0x10]
call fcn.004fcbd4
lea edx, [ebp - 0x10020]
mov ecx, dword [ebp - 0x10]
mov eax, esi
mov edi, dword [eax]
call dword [edi + 0x10]
cmp dword [ebx + 0x38], 0
setne al
and al, byte [ebp - 5]
je 0x507f03
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp - 0x14]
push dword [ebp - 0x18]
mov eax, 0x64
xor edx, edx
call fcn.0040d0e8
call fcn.0040d10c
mov edx, 0x64
sub edx, eax
mov dword [ebp - 0x1c], edx
lea eax, [ebp - 4]
mov edx, dword [ebx + 0xc]
call fcn.0040aebc
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 4]
mov eax, dword [ebx + 0x3c]
call dword [ebx + 0x38]
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
sub dword [ebp - 0x18], eax
sbb dword [ebp - 0x14], edx
jmp 0x507e3d
push 0
push 0
mov eax, esi
call fcn.004ba67c
cmp dword [ebx + 0x34], 0
je 0x507f2d
mov eax, dword [ebp - 0x20]
call fcn.00408c84
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x507f4c
lea eax, [ebp - 4]
call fcn.0040aa94
pop eax
jmp eax