Function at 0x408034
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 0x408082
push dword [esp + 0x158]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x40808f
push dword [esp + 0x158]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x1c], eax
je 0x4083cb
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 0x4083cb
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 0x4083cb
cmp word [eax], 0x4d42
jne 0x4080ec
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 0x4080ee
mov ebx, eax
push ebx
call fcn.00407fd0
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 0x40812a
cmp byte [0x422358], 0
je 0x4083cb
push edi
push str.Error
push str.Out_of_memory.
jmp 0x40815e
movzx eax, word [ebx + 2]
movzx ecx, word [ebx]
shl eax, 0x10
or eax, ecx
cmp eax, 0xc
je 0x4084b1
push 0x28
pop ecx
cmp eax, ecx
je 0x408170
cmp byte [0x422358], 0
je 0x4083cb
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 0x4083cb
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 0x408220
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 0x408242
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 0x40824a
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 0x408270
cmp byte [0x422358], 0
je 0x4083c9
push edi
jmp 0x40839e
push 0x2c
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, edi
mov dword [esp + 0x34], esi
je 0x40832f
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 0x40832f
push ebx
push dword [esp + 0x18]
call dword [sym.imp.GDI32.dll_SelectObject]
test eax, eax
je 0x40832f
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 0x408316
cmp byte [0x422358], al
je 0x4083c9
push edi
push str.Error
push str.Image_file_conversion_error.
jmp 0x4083a8
call dword [sym.imp.GDI32.dll_GdiFlush]
push dword [esi + 0x14]
call fcn.0040ce9c
pop ecx
mov ecx, eax
cmp ecx, edi
mov dword [esp + 0x20], ecx
jne 0x40833e
cmp byte [0x422358], 0
je 0x4083c9
jmp 0x40839d
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 0x408384
xor ebx, ebx
cmp edx, edi
jle 0x408375
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 0x408359
add eax, esi
inc dword [esp + 0x10]
mov ebx, dword [esp + 0x10]
cmp ebx, dword [ebp + 8]
jl 0x408353
push 0xc
call fcn.0040ce9c
cmp eax, edi
pop ecx
mov dword [esp + 0x2c], eax
jne 0x4083b7
cmp byte [0x422358], 0
je 0x4083c9
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 0x4083c9
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 0x4083db
push dword [esp + 0x14]
call dword [sym.imp.GDI32.dll_DeleteDC]
cmp dword [esp + 0x24], edi
je 0x4083eb
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 0x4083fd
push dword [esp + 0x34]
call esi
cmp ebp, edi
je 0x408404
push ebp
call esi
mov edi, dword [esp + 0x30]
test edi, edi
je 0x408413
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 0x408424
push ebp
call esi
mov ebx, dword [esp + 0x1c]
cmp ebx, 0xffffffff
je 0x408430
push ebx
call esi
xor esi, esi
cmp dword [esp + 0x2c], esi
jne 0x4084a0
cmp dword [esp + 0x20], esi
je 0x408448
push dword [esp + 0x20]
call fcn.0040cc89
pop ecx
cmp ebx, 0xffffffff
je 0x408455
cmp ebp, esi
je 0x408455
cmp edi, esi
jne 0x4084a0
cmp dword [esp + 0x144], esi
push dword [esp + 0x140]
je 0x40846c
push str.Failed_to_open_DIB_file__ws._n
jmp 0x408471
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 [0x422358], 0
je 0x4084a0
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 0x408511
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 0x4084f4
cmp dword [esp + 0x18], 0
jne 0x408224
lea eax, [ebx + esi*2]
lea eax, [esi + eax + 0x28]
mov dword [esp + 0x18], eax
jmp 0x408224