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

Disassembly:
mov eax, dword [esp + 0xc]
sub esp, 0x1c
push ebx
push ebp
xor ebx, ebx
cmp eax, ebx
push esi
push edi
je 0x5976a3
mov dword [eax], ebx
mov esi, dword [esp + 0x30]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [esp + 0x2c]
push eax
push ebx
push esi
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
call ebp
push 2
lea ecx, [esp + 0x2c]
push ecx
push ebx
push esi
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
call ebp
push ebx
lea edx, [esp + 0x2c]
push edx
push ebx
push esi
mov edi, eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
call ebp
push ebx
lea eax, [esp + 0x34]
push eax
push esi
call sym.vidcap60.exe__iff_IsAIFFFileEx_12
test eax, eax
jne 0x597705
pop edi
pop esi
pop ebp
mov eax, 0x8004e00b
pop ebx
add esp, 0x1c
ret 0xc
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x20]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x38]
push eax
push ecx
push esi
call sym.vidcap60.exe__iff_FindChunkHeader_16
cmp eax, ebx
jl 0x597900
mov ebx, dword [esp + 0x1c]
test bl, 1
je 0x597734
inc ebx
lea edx, [esp + 0x10]
push edx
add ebx, 8
push esi
mov dword [esp + 0x24], ebx
call sym.vidcap60.exe__riff_SaveLocation_8
mov eax, dword [esp + 0x10]
sub eax, 8
mov dword [esp + 0x10], eax
add eax, ebx
sub edi, eax
mov dword [esp + 0x18], eax
mov ebx, edi
je 0x597834
cmp ebx, 0x1000
jae 0x59776f
mov dword [esp + 0x34], edi
jmp 0x59777b
mov dword [esp + 0x34], 0x1000
mov edi, dword [esp + 0x34]
push edi
push 1
call dword [0x5d24c0]
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x59779c
pop edi
pop esi
pop ebp
mov eax, 0x8007000e
pop ebx
add esp, 0x1c
ret 0xc
mov eax, dword [esp + 0x18]
push eax
push esi
call sym.vidcap60.exe__riff_RestoreLocation_8
jmp 0x5977b0
mov edi, dword [esp + 0x34]
lea ecx, [ecx]
cmp ebx, edi
jae 0x5977b6
mov edi, ebx
push 0
lea ecx, [esp + 0x18]
push ecx
push edi
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x14], edi
jne 0x59790a
lea edx, [esp + 0x18]
push edx
push esi
call sym.vidcap60.exe__riff_SaveLocation_8
mov eax, dword [esp + 0x10]
push eax
push esi
call sym.vidcap60.exe__riff_RestoreLocation_8
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x24]
push ecx
push edx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x14]
jne 0x597919
lea ecx, [esp + 0x10]
push ecx
push esi
call sym.vidcap60.exe__riff_SaveLocation_8
mov edx, dword [esp + 0x18]
push edx
push esi
call sym.vidcap60.exe__riff_RestoreLocation_8
sub ebx, dword [esp + 0x20]
jne 0x5977a9
push ebp
call dword [0x5d25a4]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
add esp, 4
mov eax, dword [esp + 0x10]
push eax
push esi
call sym.vidcap60.exe__riff_RestoreLocation_8
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea ecx, [esp + 0x2c]
push ecx
mov ebx, 4
push ebx
push esi
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 0
call ebp
push 0
lea edx, [esp + 0x18]
push edx
push ebx
lea eax, [esp + 0x3c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov al, byte [esp + 0x33]
mov cl, byte [esp + 0x30]
mov dl, byte [esp + 0x31]
mov edi, dword [esp + 0x1c]
mov byte [esp + 0x30], al
mov al, byte [esp + 0x32]
mov byte [esp + 0x31], al
mov byte [esp + 0x32], dl
mov byte [esp + 0x33], cl
mov eax, dword [esp + 0x30]
sub eax, edi
mov dword [esp + 0x30], eax
mov cl, byte [esp + 0x30]
shr eax, 0x18
mov byte [esp + 0x30], al
mov byte [esp + 0x33], cl
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x30]
shr eax, 0x10
push 0
mov byte [esp + 0x35], al
lea eax, [esp + 0x2c]
push eax
push ebx
shr edx, 8
push esi
mov byte [esp + 0x42], dl
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 0
call ebp
push 0
lea ecx, [esp + 0x24]
push ecx
push ebx
lea edx, [esp + 0x3c]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x38]
test eax, eax
je 0x5978fe
mov dword [eax], edi
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x8004e008
pop ebx
add esp, 0x1c
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 0x8004e009
pop ebx
add esp, 0x1c
ret 0xc