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

Disassembly:
sub esp, 0x15c
push ebx
push ebp
mov ebp, dword [esp + 0x168]
push esi
test ebp, ebp
push edi
jne 0x10003c89
lea eax, [esp + 0x1c]
push str.PriamEnhance.cpp_ScaleConvertToBMP__RawFileName__NULL_n
push eax
call fcn.100049dc
add esp, 8
lea ecx, [esp + 0x1c]
push ecx
call sub.Log.dll_TimeLog
lea edx, [esp + 0x1c]
push edx
call sub.Log.dll_DebugPrint
mov al, byte [0x1001c796]
test al, al
je 0x1000410e
push ebp
lea eax, [esp + 0x20]
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, 0x15c
ret 0x1c
mov eax, dword [esp + 0x174]
test eax, eax
jne 0x10003cea
lea ecx, [esp + 0x1c]
push str.PriamEnhance.cpp_ScaleConvertToBMP__BmpFileName__NULL_n
push ecx
call fcn.100049dc
add esp, 8
lea edx, [esp + 0x1c]
push edx
call sub.Log.dll_TimeLog
lea eax, [esp + 0x1c]
push eax
call sub.Log.dll_DebugPrint
mov al, byte [0x1001c796]
test al, al
je 0x1000410e
push 0
lea ecx, [esp + 0x20]
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, 0x15c
ret 0x1c
push 0x200000
call fcn.10004aa7
mov edi, eax
add esp, 4
test edi, edi
jne 0x10003d1e
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, 0x15c
ret 0x1c
push 0x100000
call fcn.10004aa7
add esp, 4
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x14], ebx
push 0
jne 0x10003d61
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, 0x15c
ret 0x1c
push 0x80
push 3
push 0
push 1
push 0x80000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x10003dab
push ebp
lea edx, [esp + 0x70]
push str.Could_not_open__s_for_reading___A_n
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x6c]
push 0
push str.Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x100040ff
lea ecx, [esp + 0x10]
push 0
push ecx
push 0x200000
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100040d1
cmp dword [esp + 0x10], 0x200000
jne 0x100040d1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, 0x100000
xor edx, edx
mov dx, word [eax]
add eax, 2
dec ecx
mov dx, word [edx*2 + 0x1001bb5c]
mov word [eax - 2], dx
jne 0x10003de3
push 0x698
call fcn.10004aa7
add esp, 4
test eax, eax
je 0x10003e1f
push 0x3ff
push 0x400
push edi
mov ecx, eax
call fcn.10003410
jmp 0x10003e21
xor eax, eax
mov ecx, dword [esp + 0x184]
mov edx, dword [esp + 0x180]
mov dword [0x1001bb58], eax
mov eax, dword [esp + 0x188]
push eax
mov eax, dword [esp + 0x180]
push ecx
mov ecx, dword [esp + 0x180]
push edx
push eax
push ecx
call fcn.10003810
add esp, 0x14
xor eax, eax
mov ecx, edi
mov dx, word [ecx]
add ecx, 2
shr edx, 2
mov byte [eax + ebx], dl
inc eax
cmp eax, 0x100000
jl 0x10003e5a
push edi
call fcn.10004abe
mov edi, dword [esp + 0x178]
add esp, 4
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x10003edd
push edi
lea eax, [esp + 0x70]
push str.Invalid_Handle_returned_trying_to_create_file__s
push eax
call fcn.100049dc
add esp, 0xc
lea ecx, [esp + 0x6c]
push 0
push str.Error
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
call fcn.10004abe
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret 0x1c
call fcn.10003760
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
lea edx, [esp + 0x10]
push 0
push edx
push 0xe
push 0x1001c788
push esi
call ebp
test eax, eax
je 0x100040b0
cmp dword [esp + 0x10], 0xe
jne 0x100040b0
lea eax, [esp + 0x10]
push 0
push eax
push 0x28
push 0x1001c760
push esi
call ebp
test eax, eax
je 0x1000408f
cmp dword [esp + 0x10], 0x28
jne 0x1000408f
lea ecx, [esp + 0x10]
push 0
push ecx
push 0x400
push 0x1001c35c
push esi
call ebp
test eax, eax
je 0x10004049
cmp dword [esp + 0x10], 0x400
jne 0x10004049
mov edx, dword [esp + 0x14]
mov ebx, 0x3ff
lea edi, [edx + 0xffc00]
lea eax, [esp + 0x10]
push 0
push eax
push 0x400
push edi
push esi
call ebp
test eax, eax
je 0x10003ff8
cmp dword [esp + 0x10], 0x400
jne 0x10003ff8
dec ebx
sub edi, 0x400
test ebx, ebx
jge 0x10003f69
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x10003fdc
push eax
lea edx, [esp + 0x1c]
push eax
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x40
push str.CloseHandle_Error
mov eax, dword [esp + 0x20]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [esp + 0x14]
push edx
call fcn.10004abe
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret 0x1c
mov ecx, dword [esp + 0x174]
lea edx, [esp + 0x6c]
push ecx
push str.Error_writing_file__s_image
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x6c]
push 0
push str.Error
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x14]
push ecx
call fcn.10004abe
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret 0x1c
push edi
lea eax, [esp + 0x70]
push str.Error_writing_file__s_rgb_table
push eax
call fcn.100049dc
add esp, 0xc
lea ecx, [esp + 0x6c]
push 0
push str.Error
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.10004abe
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret 0x1c
push edi
lea edx, [esp + 0x70]
push str.Error_writing_file__s_info
push edx
call fcn.100049dc
add esp, 0xc
lea eax, [esp + 0x6c]
push 0
push str.Error
push eax
jmp 0x10004068
push edi
lea ecx, [esp + 0x70]
push str.Error_writing_file__s_header
push ecx
call fcn.100049dc
add esp, 0xc
lea edx, [esp + 0x6c]
push 0
push str.Error
push edx
jmp 0x10004068
push ebp
lea eax, [esp + 0x70]
push str.Error_reading_file__s
push eax
call fcn.100049dc
add esp, 0xc
lea ecx, [esp + 0x6c]
push 0
push str.Error
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.10004abe
push edi
call fcn.10004abe
add esp, 8
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x15c
ret 0x1c