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

Disassembly:
sub esp, 0x16c
push ebx
push ebp
mov ebp, dword [esp + 0x178]
push esi
test ebp, ebp
push edi
jne 0x10004189
lea eax, [esp + 0x2c]
push str.PriamEnhance.cpp_RawImage512__orgRawFileName__NULL_n
push eax
call fcn.100049dc
add esp, 8
lea ecx, [esp + 0x2c]
push ecx
call sub.Log.dll_TimeLog
lea edx, [esp + 0x2c]
push edx
call sub.Log.dll_DebugPrint
mov al, byte [0x1001c796]
test al, al
je 0x100045fe
push ebp
lea eax, [esp + 0x30]
push str.Debug
push eax
push ebp
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x16c
ret 0xc
mov eax, dword [esp + 0x184]
test eax, eax
jne 0x100041ea
lea ecx, [esp + 0x2c]
push str.PriamEnhance.cpp_RawImage512__stRawFileName__NULL_n
push ecx
call fcn.100049dc
add esp, 8
lea edx, [esp + 0x2c]
push edx
call sub.Log.dll_TimeLog
lea eax, [esp + 0x2c]
push eax
call sub.Log.dll_DebugPrint
mov al, byte [0x1001c796]
test al, al
je 0x100045fe
push 0
lea ecx, [esp + 0x30]
push str.Debug
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x16c
ret 0xc
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
push 3
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 0x1000ea00
xor bl, bl
lea esi, [ecx + ebp - 3]
push esi
call fcn.10004ee0
add esp, 0xc
test eax, eax
jne 0x10004212
mov bl, 1
push 3
push 0x1000e9fc
push esi
call fcn.10004ee0
add esp, 0xc
test eax, eax
je 0x10004263
test bl, bl
jne 0x10004263
push esi
lea edx, [esp + 0x80]
push str.Invalid_file_extension___s
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x7c]
push 0
push str.Debug
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x16c
ret 0xc
push 0x200000
call fcn.10004aa7
mov edi, eax
add esp, 4
test edi, edi
mov dword [esp + 0x14], edi
jne 0x1000429b
push eax
push str.Error
push str.Out_of_Memory__creating_image_buffer_
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x16c
ret 0xc
push 0x200
call fcn.10004aa7
add esp, 4
mov esi, eax
test esi, esi
push 0
jne 0x100042da
push str.Error
push str.Out_of_Memory__creating_image_scale_buffer_
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push edi
call fcn.10004abe
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x16c
ret 0xc
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0x80
push 3
push 0
push 1
push 0x80000000
push ebp
call edi
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x18], ebx
jne 0x1000434a
push ebp
lea ecx, [esp + 0x80]
push str.Could_not_open__s_for_reading._n
push ecx
call fcn.100049dc
add esp, 0xc
lea edx, [esp + 0x7c]
push 0
push str.Error
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call fcn.10004abe
mov eax, dword [esp + 0x18]
push eax
call fcn.10004abe
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x16c
ret 0xc
xor eax, eax
xor ecx, ecx
add eax, 0x800
push 0
adc ecx, ecx
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], ecx
lea ecx, [esp + 0x2c]
push ecx
push eax
push ebx
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x100043b1
push str.RawImage512____Cine_Bitmap_could_not_be_created_due_to_frame_position_failure._n
call sub.Log.dll_TimeLog
mov al, byte [0x1001c796]
test al, al
je 0x100043a5
push 0
push str.Error
push str.Cine_Bitmap_could_not_be_created_due_to_frame_position_failure_
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x100045eb
mov eax, dword [esp + 0x184]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call edi
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x20], ebp
jne 0x10004412
mov ecx, dword [esp + 0x184]
lea edx, [esp + 0x7c]
push ecx
push str.RawFile512____Could_not_create_destination_cine_file:__s_n
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x7c]
push 0
push str.Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1000464f
movsx eax, word [esp + 0x188]
test eax, eax
mov dword [esp + 0x10], 0
jle 0x100044f7
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push 0
push edx
push 0x200000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000460d
cmp dword [esp + 0x1c], 0x200000
jne 0x1000460d
mov ecx, dword [esp + 0x14]
xor ebx, ebx
lea edi, [ecx + 0x800]
xor ecx, ecx
mov eax, edi
mov dx, word [eax - 0x800]
add dx, word [eax - 0x7fe]
add eax, 4
add dx, word [eax - 2]
add dx, word [eax - 4]
and edx, 0xffff
shr edx, 2
mov dx, word [edx*2 + 0x1001bb5c]
shr edx, 2
mov byte [ecx + esi], dl
inc ecx
cmp ecx, 0x200
jl 0x10004468
lea eax, [esp + 0x1c]
push 0
push eax
push 0x200
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100045ad
cmp dword [esp + 0x1c], 0x200
jne 0x100045ad
inc ebx
add edi, 0x1000
cmp ebx, 0x200
jl 0x10004464
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
movsx ecx, word [esp + 0x188]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x1000442a
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
mov ebx, dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ebp, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
jne 0x10004549
push 0
lea edx, [esp + 0x14]
push 0
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call ebx
push 0x40
push str.CloseHandle_Error
mov eax, dword [esp + 0x18]
push eax
push 0
call edi
mov ecx, dword [esp + 0x10]
push ecx
call ebp
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x1000458b
push eax
push eax
lea eax, [esp + 0x18]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call ebx
push 0x40
push str.CloseHandle_Error
mov ecx, dword [esp + 0x18]
push ecx
push 0
call edi
mov edx, dword [esp + 0x10]
push edx
call ebp
push esi
call fcn.10004abe
mov eax, dword [esp + 0x18]
push eax
call fcn.10004abe
add esp, 8
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x16c
ret 0xc
mov ecx, dword [esp + 0x184]
lea edx, [esp + 0x7c]
push ecx
push str.Error_writing__s_cine_file_n
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x7c]
push 0
push str.Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x18]
push ecx
call edi
push ebp
call edi
push esi
call fcn.10004abe
mov edx, dword [esp + 0x18]
push edx
call fcn.10004abe
add esp, 8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x16c
ret 0xc
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x180]
push eax
push ecx
lea edx, [esp + 0x84]
push str.Error_reading_file__s__i___d
push edx
call fcn.100049dc
add esp, 0x10
lea eax, [esp + 0x7c]
push 0
push str.Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call edi
push ebp
call edi
push esi
call fcn.10004abe
mov ecx, dword [esp + 0x18]
push ecx
call fcn.10004abe
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x16c
ret 0xc