Function at 0x505470
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x70408e
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x7e6410]
xor eax, esp
push eax
lea eax, [esp + 0x50]
mov dword fs:[0], eax
mov ebx, ecx
mov eax, dword [ebx]
mov eax, dword [eax + 0x1c]
call eax
push 0
test al, al
jne 0x5054f5
push str.FileStream::removeBlock______invalid_file.
lea ecx, [esp + 0x48]
call fcn.004c5540
mov edx, dword [esp + 0x44]
mov dword [esp + 0x40], vtable.TagLib::String.0
mov eax, dword [edx + 4]
mov ecx, dword [eax]
mov eax, dword [edx + 4]
dec ecx
mov dword [eax], ecx
jne 0x5056f6
mov ecx, dword [esp + 0x44]
push 1
mov eax, dword [ecx]
call dword [eax]
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, dword [ebp + 8]
lea ecx, [esp + 0x3c]
add edi, dword [ebp + 0xc]
push 0x400
mov dword [esp + 0x28], edi
call fcn.004c2bd0
mov dword [esp + 0x58], 0
mov esi, dword [esp + 0x3c]
lea esp, [esp]
mov eax, dword [ebx]
mov ecx, ebx
push 0
push edi
call dword [eax + 0x20]
mov eax, dword [ebx + 4]
mov edi, dword [esi + 0xc]
mov dword [esp + 0x24], edi
mov edx, dword [eax]
mov eax, dword [esi]
mov dword [esp + 0x1c], edx
mov eax, dword [eax + 4]
cmp dword [eax], 1
jle 0x5055f4
mov esi, dword [esi + 0xc]
push 0x10
test esi, esi
je 0x5055b5
mov edi, dword [esp + 0x40]
mov eax, dword [edi + 4]
mov ecx, dword [edi + 8]
add ecx, dword [eax]
mov dword [esp + 0x2c], ecx
call fcn.006b6815
add esp, 4
test eax, eax
je 0x5056b6
mov dword [esp + 0x30], eax
push esi
push dword [esp + 0x2c]
mov ecx, eax
mov byte [esp + 0x60], 1
call fcn.004c2970
mov byte [esp + 0x58], 0
mov esi, eax
mov dword [esp + 0x3c], esi
test edi, edi
je 0x50559d
push ecx
mov ecx, edi
call fcn.004c2ee0
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
cmp dword [esi + 0xc], 0
jbe 0x5055fa
mov eax, dword [esi + 4]
mov ecx, dword [esi + 8]
add ecx, dword [eax]
jmp 0x5055fc
call fcn.006b6815
add esp, 4
test eax, eax
je 0x5056ca
mov dword [esp + 0x30], eax
push 0
push 0
mov ecx, eax
mov byte [esp + 0x60], 2
call fcn.004c2870
mov byte [esp + 0x58], 0
mov esi, eax
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x3c], esi
test ecx, ecx
je 0x5055a1
push ecx
call fcn.004c2ee0
jmp 0x5055a1
mov esi, dword [esp + 0x3c]
jmp 0x5055a5
xor ecx, ecx
push 0
lea eax, [esp + 0x30]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edi, eax
neg edi
sbb edi, edi
and edi, dword [esp + 0x2c]
add dword [esp + 0x20], edi
cmp edi, dword [esi + 0xc]
jae 0x505662
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x24]
mov byte [esp + 0x14], 0
cmp edi, dword [esi + 0xc]
je 0x505662
lea ecx, [esp + 0x38]
call fcn.004c3bf0
mov esi, dword [esp + 0x3c]
mov eax, dword [esi + 0xc]
add eax, dword [esi + 8]
mov ecx, dword [esi + 4]
push eax
call fcn.004c3c70
mov ecx, dword [esi + 4]
lea eax, [esp + 0x14]
push eax
mov eax, dword [esi + 8]
add eax, edi
push eax
call fcn.004c3cc0
mov dword [esi + 0xc], edi
mov eax, dword [ebx]
mov ecx, ebx
push 0
push dword [ebp + 8]
call dword [eax + 0x20]
mov eax, dword [ebx + 4]
mov edx, dword [esi + 0xc]
mov eax, dword [eax]
mov dword [esp + 0x28], eax
test edx, edx
je 0x50568c
mov eax, dword [esi + 4]
mov ecx, dword [esi + 8]
add ecx, dword [eax]
mov eax, dword [esp + 0x28]
jmp 0x50568e
xor ecx, ecx
push 0
lea edx, [esp + 0x38]
push edx
mov edx, dword [esi + 0xc]
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp + 8]
add ecx, edi
mov dword [ebp + 8], ecx
test edi, edi
je 0x5056de
mov edi, dword [esp + 0x20]
jmp 0x505520
push 0x7da8d8
lea eax, [esp + 0x1e]
mov byte [esp + 0x1e], 0
push eax
call fcn.006b4394
push 0x7da8d8
lea eax, [esp + 0x1f]
mov byte [esp + 0x1f], 0
push eax
call fcn.006b4394
mov eax, dword [ebx]
push ecx
mov ecx, ebx
call dword [eax + 0x30]
push ecx
mov ecx, esi
mov dword [esp + 0x5c], 0xffffffff
call fcn.004c2ee0
mov ecx, dword [esp + 0x50]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8