Function at 0x415744
Capabilities:
Clear file content
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
lea eax, [ebp - 0x18]
mov dword [ebp - 0xc], ecx
push eax
push dword [ebp + 8]
mov esi, edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, dword [ebp - 0x18]
xor edi, edi
or edi, eax
mov al, byte [esi + 0x2b]
cmp al, 1
je 0x415775
cmp al, 2
je 0x415775
cmp al, 3
jne 0x4157c7
mov eax, edi
or eax, ebx
je 0x4157c7
movzx eax, byte [esi + 0x4e]
mov ecx, 0xff
shrd edi, ebx, 0x10
shr ebx, 0x10
inc eax
cmp eax, ecx
cmovb ecx, eax
cmp edi, ecx
ja 0x4157a5
xorps xmm0, xmm0
movlpd qword [ebp - 0x1c], xmm0
mov ebx, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
jmp 0x4157b0
sub edi, ecx
xor ebx, ebx
shld ebx, edi, 0x10
shl edi, 0x10
mov ecx, dword [ebp + 8]
xor edx, edx
push ebx
push edi
call fcn.0040ee40
pop ecx
pop ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
xor al, al
mov byte [ebp - 5], al
cmp byte [ebp + 0xc], al
je 0x4157fa
mov ecx, esi
call fcn.00414184
mov edx, dword [ebp + 8]
push ebx
push edi
mov edi, dword [ebp - 0xc]
mov ecx, edi
call fcn.00415466
test eax, eax
jne 0x41588b
call fcn.004127eb
mov byte [ebp - 5], 1
jmp 0x415859
cmp byte [esi + 0x29], 2
mov byte [ebp - 5], 1
jne 0x415856
cmp byte [esi + 0x2b], 0
jne 0x415856
mov edi, dword [esi + 4]
test edi, edi
je 0x415856
cmp dword [esi + 8], 0
jne 0x415856
cmp dword [esi], 0
je 0x415856
lea eax, [ebp - 0x18]
xor ebx, ebx
push eax
push dword [ebp + 8]
shld ebx, edi, 0x10
shl edi, 0x10
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [ebp - 0x18]
xor ecx, ecx
or ecx, eax
cmp edi, ecx
jne 0x415856
cmp ebx, edx
jne 0x415856
mov ecx, dword [ebp + 8]
xor edx, edx
push ebx
push edi
call fcn.0040ee40
mov edi, dword [ebp - 0xc]
xor bl, bl
pop ecx
pop ecx
jmp 0x41588e
mov edi, dword [ebp - 0xc]
push dword [ebp + 0x10]
push str.Verifying_Tape:__s
push 1
push 0x80
push 0
push 0
call fcn.00420600
add esp, 0x18
mov ecx, esi
call fcn.00414184
mov ecx, dword [ebp + 8]
xor edx, edx
push 0
push 0
call fcn.0040ee40
pop ecx
pop ecx
mov bl, byte [ebp - 5]
mov eax, dword [esi + 0x38]
mov dword [ebp - 0x10], eax
movzx eax, word [esi + 0x40]
push 0
mov dword [ebp - 0x18], eax
lea eax, [ebp + 0x10]
push eax
push 0x10000
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
neg edi
sbb edi, edi
and edi, dword [ebp + 0x10]
je 0x4159de
mov bh, byte [ebp + 0xc]
mov eax, dword [esi + 4]
mov edx, edi
mov ecx, dword [ebp - 0xc]
not eax
push eax
call fcn.0040ebe2
test eax, eax
jne 0x41599e
mov edx, dword [ebp - 0xc]
lea eax, [edi - 4]
push eax
mov ecx, esi
call fcn.00414a22
cmp eax, 1
je 0x4159b8
cmp edi, 0x10000
jne 0x415999
mov ecx, dword [esi + 4]
test ecx, ecx
jne 0x415920
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x415910
cmp eax, dword [esi + 0x38]
jne 0x415981
mov eax, dword [ebp - 0x18]
test ax, ax
je 0x415920
movzx eax, ax
cmp eax, dword [esi + 0x40]
jne 0x415981
or byte [esi + 0x47], 2
lea eax, [ecx + 1]
mov dword [esi + 4], eax
cmp dword [0x44ac4c], 0
jne 0x4159de
cmp byte [esi + 0x46], 0
jne 0x415949
cmp dword [0x449648], esi
je 0x4159de
test bh, bh
je 0x415959
test eax, 0x3fff
jne 0x415959
call fcn.0041284e
push 0
lea eax, [ebp + 0x10]
push eax
push 0x10000
push dword [ebp - 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
neg edi
sbb edi, edi
and edi, dword [ebp + 0x10]
jne 0x4158c2
jmp 0x4159de
mov ecx, esi
call fcn.00414184
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x38], eax
mov eax, dword [ebp - 0x18]
movzx eax, ax
mov dword [esi + 0x40], eax
jmp 0x4159c1
mov dword [esi + 8], edi
jmp 0x4159b8
xor eax, eax
inc eax
mov dword [ebp + 0xc], eax
cmp edi, 0x10000
jne 0x4159b8
mov dl, al
mov ecx, esi
call fcn.00410614
mov eax, dword [ebp + 0xc]
test edi, edi
je 0x4159de
cmp eax, 1
jne 0x4159de
mov ecx, dword [ebp + 8]
neg edi
mov eax, edi
cdq
push edx
xor edx, edx
push eax
inc edx
call fcn.0040ee40
pop ecx
pop ecx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret 0xc