Function at 0x10036938
Capabilities:
Read file via mapping

Disassembly:
sub esp, 0x12c
push ebx
push ebp
push esi
push edi
xor edi, edi
xor ebp, ebp
cmp dword [esp + 0x144], edi
push edi
push edi
push 3
push edi
push 1
mov dword [esp + 0x40], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x44], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x48], edi
push 0x80000000
je 0x10036986
push dword [esp + 0x158]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x10036993
push dword [esp + 0x158]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x10036ccf
push edi
push edi
push edi
push 2
push edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, edi
mov dword [esp + 0x28], eax
je 0x10036ccf
push edi
push edi
push edi
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, edi
mov dword [esp + 0x30], eax
je 0x10036ccf
cmp word [eax], 0x4d42
jne 0x100369f0
movzx ecx, word [eax + 0xc]
movzx edx, word [eax + 0xa]
shl ecx, 0x10
or ecx, edx
lea ebx, [eax + 0xe]
add ecx, eax
mov dword [esp + 0x18], ecx
jmp 0x100369f2
mov ebx, eax
push ebx
call fcn.100368e2
movzx esi, ax
mov dword [esp + 0x10], esi
lea eax, [esi*4 + 0x2c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebp, eax
cmp ebp, edi
jne 0x10036a2e
cmp byte [0x100420c8], 0
je 0x10036ccf
push edi
push str.Error
push str.Out_of_memory.
jmp 0x10036a62
movzx eax, word [ebx + 2]
movzx ecx, word [ebx]
shl eax, 0x10
or eax, ecx
cmp eax, 0xc
je 0x10036db5
push 0x28
pop ecx
cmp eax, ecx
je 0x10036a74
cmp byte [0x100420c8], 0
je 0x10036ccf
push edi
push str.Error
push str.Unknown_DIB_file_format.
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x10036ccf
mov dword [ebp], ecx
lea edi, [ebp + 0x28]
movzx eax, word [ebx + 6]
movzx ecx, word [ebx + 4]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 4], eax
movzx eax, word [ebx + 0xa]
movzx ecx, word [ebx + 8]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 8], eax
mov ax, word [ebx + 0xc]
mov word [ebp + 0xc], ax
mov ax, word [ebx + 0xe]
mov word [ebp + 0xe], ax
movzx eax, word [ebx + 0x12]
movzx ecx, word [ebx + 0x10]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 0x10], eax
movzx eax, word [ebx + 0x16]
movzx ecx, word [ebx + 0x14]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 0x14], eax
movzx eax, word [ebx + 0x1a]
movzx ecx, word [ebx + 0x18]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 0x18], eax
movzx eax, word [ebx + 0x1e]
movzx ecx, word [ebx + 0x1c]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 0x1c], eax
movzx eax, word [ebx + 0x22]
movzx ecx, word [ebx + 0x20]
shl eax, 0x10
or eax, ecx
mov dword [ebp + 0x20], eax
movzx eax, word [ebx + 0x26]
movzx ecx, word [ebx + 0x24]
shl eax, 0x10
or eax, ecx
cmp dword [esp + 0x18], 0
mov ecx, esi
lea esi, [ebx + 0x28]
mov dword [ebp + 0x24], eax
rep movsd dword es:[edi], dword [esi]
jne 0x10036b24
mov eax, dword [esp + 0x10]
lea eax, [ebx + eax*4 + 0x28]
mov dword [esp + 0x18], eax
mov esi, dword [esp + 0x10]
xor eax, eax
cmp dword [ebp + 0x14], eax
jne 0x10036b46
movzx ecx, word [ebp + 0xe]
mov edx, dword [ebp + 4]
imul edx, ecx
add edx, 7
shr edx, 3
imul edx, dword [ebp + 8]
mov dword [ebp + 0x14], edx
cmp dword [ebp + 0x20], eax
jne 0x10036b4e
mov dword [ebp + 0x20], esi
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov ebx, eax
xor edi, edi
cmp ebx, edi
mov dword [esp + 0x14], ebx
jne 0x10036b74
cmp byte [0x100420c8], 0
je 0x10036ccd
push edi
jmp 0x10036ca2
push 0x2c
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, edi
mov dword [esp + 0x34], esi
je 0x10036c33
mov dword [esi], 0x28
mov eax, dword [ebp + 4]
mov dword [esi + 4], eax
mov eax, dword [ebp + 8]
mov dword [esi + 8], eax
push edi
cdq
xor eax, edx
push edi
sub eax, edx
mov word [esi + 0xc], 1
imul eax, dword [esi + 4]
mov word [esi + 0xe], 0x18
mov dword [esi + 0x10], edi
lea eax, [eax + eax*2]
mov dword [esi + 0x14], eax
lea eax, [esp + 0x40]
push eax
push edi
push esi
push ebx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov ebx, eax
cmp ebx, edi
mov dword [esp + 0x24], ebx
je 0x10036c33
push ebx
push dword [esp + 0x18]
call dword [sym.imp.GDI32.dll_SelectObject]
test eax, eax
je 0x10036c33
push edi
push ebp
push dword [esp + 0x20]
push dword [ebp + 8]
push edi
push ebx
push dword [esp + 0x2c]
call dword [sym.imp.GDI32.dll_SetDIBits]
test eax, eax
jne 0x10036c1a
cmp byte [0x100420c8], al
je 0x10036ccd
push edi
push str.Error
push str.Image_file_conversion_error.
jmp 0x10036cac
call dword [sym.imp.GDI32.dll_GdiFlush]
push dword [esi + 0x14]
call sub.MSVCR100.dll_malloc
pop ecx
mov ecx, eax
cmp ecx, edi
mov dword [esp + 0x20], ecx
jne 0x10036c42
cmp byte [0x100420c8], 0
je 0x10036ccd
jmp 0x10036ca1
mov edx, dword [ebp + 4]
mov eax, dword [esp + 0x38]
mov esi, edx
mov dword [esp + 0x10], edi
and esi, 3
cmp dword [ebp + 8], edi
jle 0x10036c88
xor ebx, ebx
cmp edx, edi
jle 0x10036c79
mov dl, byte [eax + 2]
mov byte [ecx], dl
mov dl, byte [eax + 1]
inc ecx
mov byte [ecx], dl
mov dl, byte [eax]
inc ecx
add eax, 3
mov byte [ecx], dl
mov edx, dword [ebp + 4]
inc ecx
inc ebx
cmp ebx, edx
jl 0x10036c5d
add eax, esi
inc dword [esp + 0x10]
mov ebx, dword [esp + 0x10]
cmp ebx, dword [ebp + 8]
jl 0x10036c57
push 0xc
call sub.MSVCR100.dll_malloc
cmp eax, edi
pop ecx
mov dword [esp + 0x2c], eax
jne 0x10036cbb
cmp byte [0x100420c8], 0
je 0x10036ccd
push edi
push str.Error
push str.Out_of_memory.
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x10036ccd
mov ecx, dword [ebp + 4]
mov dword [eax], ecx
mov ecx, dword [ebp + 8]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x20]
mov dword [eax + 8], ecx
xor edi, edi
cmp dword [esp + 0x14], edi
je 0x10036cdf
push dword [esp + 0x14]
call dword [sym.imp.GDI32.dll_DeleteDC]
cmp dword [esp + 0x24], edi
je 0x10036cef
push dword [esp + 0x24]
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp dword [esp + 0x34], edi
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
je 0x10036d01
push dword [esp + 0x34]
call esi
cmp ebp, edi
je 0x10036d08
push ebp
call esi
mov edi, dword [esp + 0x30]
test edi, edi
je 0x10036d17
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ebp, dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
je 0x10036d28
push ebp
call esi
mov ebx, dword [esp + 0x1c]
cmp ebx, 0xffffffff
je 0x10036d34
push ebx
call esi
xor esi, esi
cmp dword [esp + 0x2c], esi
jne 0x10036da4
cmp dword [esp + 0x20], esi
je 0x10036d4c
push dword [esp + 0x20]
call sub.MSVCR100.dll_free
pop ecx
cmp ebx, 0xffffffff
je 0x10036d59
cmp ebp, esi
je 0x10036d59
cmp edi, esi
jne 0x10036da4
cmp dword [esp + 0x144], esi
push dword [esp + 0x140]
je 0x10036d70
push str.Failed_to_open_DIB_file__ws._n
jmp 0x10036d75
push str.Failed_to_open_DIB_file__s._n
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp byte [0x100420c8], 0
je 0x10036da4
push esi
lea eax, [esp + 0x40]
push str.Error
push eax
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [esp + 0x2c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x12c
ret 8
mov dword [ebp], 0x28
movzx eax, word [ebx + 4]
mov dword [ebp + 4], eax
movzx eax, word [ebx + 6]
mov dword [ebp + 8], eax
mov ax, word [ebx + 8]
mov word [ebp + 0xc], ax
mov ax, word [ebx + 0xa]
mov word [ebp + 0xe], ax
mov dword [ebp + 0x10], edi
mov dword [ebp + 0x14], edi
mov dword [ebp + 0x18], edi
mov dword [ebp + 0x1c], edi
mov dword [ebp + 0x20], esi
test esi, esi
mov dword [ebp + 0x24], esi
lea eax, [ebp + 0x28]
lea edi, [ebx + 0xc]
jle 0x10036e15
mov ecx, esi
mov dl, byte [edi + 2]
mov byte [eax + 2], dl
mov dl, byte [edi + 1]
mov byte [eax + 1], dl
mov dl, byte [edi]
and byte [eax + 3], 0
mov byte [eax], dl
add eax, 4
add edi, 3
dec ecx
jne 0x10036df8
cmp dword [esp + 0x18], 0
jne 0x10036b28
lea eax, [ebx + esi*2]
lea eax, [esi + eax + 0x28]
mov dword [esp + 0x18], eax
jmp 0x10036b28