Function at 0x401180
Capabilities:
Read file on windows

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff0
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x98]
push ebx
mov ebx, eax
sub esp, 0xd8
mov esi, dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call esi
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x401244
mov edx, eax
lea eax, [ebp - 0xb8]
lea edi, [ebp - 0x98]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.kernel32.dll_ReadFile]
mov dword [esp], edx
mov dword [esp + 8], 0x16
mov dword [esp + 4], edi
mov dword [ebp - 0xc4], edx
mov dword [ebp - 0xc0], eax
call eax
mov edx, dword [ebp - 0xc4]
sub esp, 0x14
test eax, eax
je 0x401238
cmp dword [ebp - 0xb8], 0x16
je 0x401350
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], ebx
call esi
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x4012ca
lea eax, [ebp - 0xb8]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x6c
mov dword [esp + 4], edi
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x4012be
cmp dword [ebp - 0xb8], 0x6c
je 0x401640
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [section..bss], 0
mov dword [esp], ebx
call dword [sym.imp.gdi32.dll_GetMetaFileW]
mov dword [0x405018], eax
sub esp, 4
mov dword [esp + 4], edi
mov eax, dword [0x405448]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetClientRect]
mov eax, dword [ebp - 0x90]
sub eax, dword [ebp - 0x98]
mov dword [0x405008], eax
mov eax, dword [ebp - 0x8c]
sub esp, 8
sub eax, dword [ebp - 0x94]
mov dword [0x405004], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [0x405448]
mov dword [esp], eax
call dword [sym.imp.user32.dll_InvalidateRect]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], edx
mov dword [ebp - 0xc4], eax
call eax
sub esp, 4
cmp dword [ebp - 0x98], 0x9ac6cdd7
jne 0x401244
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], ebx
call esi
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x40168e
lea eax, [ebp - 0xb8]
lea ebx, [ebp - 0xbc]
mov dword [esp], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x16
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc0]
call eax
sub esp, 0x14
test eax, eax
je 0x401680
cmp dword [ebp - 0xbc], 0x16
jne 0x401680
movdqu xmm0, xmmword [ebp - 0xb8]
psrldq xmm0, 8
pxor xmm0, xmmword [ebp - 0xb8]
movdqu xmm1, xmm0
psrldq xmm1, 4
pxor xmm0, xmm1
movd xmm1, dword [ebp - 0xa8]
movdqu xmm2, xmm0
psrldq xmm2, 2
pxor xmm0, xmm2
pxor xmm2, xmm2
pextrw ecx, xmm0, 0
movdqu xmm0, xmm1
punpcklwd xmm0, xmm2
pshuflw xmm0, xmm0, 0xe6
pxor xmm0, xmm1
pextrw eax, xmm0, 0
xor eax, ecx
movzx ecx, word [ebp - 0xa4]
cmp cx, ax
jne 0x4016a0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x12
mov dword [esp + 4], edi
mov dword [esp], esi
mov eax, dword [ebp - 0xc0]
call eax
sub esp, 0x14
test eax, eax
je 0x401680
cmp dword [ebp - 0xbc], 0x12
jne 0x401680
mov eax, dword [ebp - 0x92]
mov dword [esp], 0x40
add eax, eax
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GlobalAlloc]
mov dword [ebp - 0xc8], eax
sub esp, 8
test eax, eax
je 0x401680
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x16
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_SetFilePointer]
sub esp, 0x10
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov eax, dword [ebp - 0x92]
add eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xc8]
mov dword [esp], esi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc0]
call eax
sub esp, 0x14
test eax, eax
je 0x4016f0
mov eax, dword [ebp - 0x92]
add eax, eax
cmp eax, dword [ebp - 0xbc]
jne 0x4016f0
mov dword [esp], esi
mov eax, dword [ebp - 0xc4]
call eax
mov eax, dword [ebp - 0xc8]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x92]
add eax, eax
mov dword [esp], eax
call dword [sym.imp.gdi32.dll_SetMetaFileBitsEx]
sub esp, 8
mov ebx, eax
test eax, eax
je 0x401715
movsx edx, word [ebp - 0xb2]
movsx eax, word [ebp - 0xae]
sub eax, edx
movsx edx, word [ebp - 0xb0]
mov dword [0x405008], eax
movsx eax, word [ebp - 0xac]
sub eax, edx
mov dword [0x405004], eax
mov eax, dword [0x405448]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetDC]
mov esi, dword [sym.imp.gdi32.dll_GetDeviceCaps]
sub esp, 4
mov edi, eax
mov dword [esp + 4], 0x58
mov dword [esp], eax
call esi
imul eax, dword [0x405008]
movzx ecx, word [ebp - 0xaa]
sub esp, 8
cdq
idiv ecx
mov dword [0x405008], eax
mov dword [esp + 4], 0x5a
mov dword [esp], edi
call esi
imul eax, dword [0x405004]
movzx ecx, word [ebp - 0xaa]
sub esp, 8
cdq
idiv ecx
mov dword [0x405004], eax
mov dword [esp + 4], edi
mov eax, dword [0x405448]
mov dword [esp], eax
call dword [sym.imp.user32.dll_ReleaseDC]
mov eax, dword [ebp - 0xc8]
mov dword [0x405010], 0
mov dword [0x40500c], 0
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalFree]
sub esp, 4
jmp 0x401690
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
xor eax, eax
sub esp, 4
cmp dword [ebp - 0x70], 0x464d4520
sete al
mov dword [section..bss], eax
jne 0x4012d4
mov dword [esp], ebx
call dword [sym.imp.gdi32.dll_GetEnhMetaFileW]
mov dword [0x405014], eax
sub esp, 4
jmp 0x4012e5
mov dword [esp], esi
mov eax, dword [ebp - 0xc4]
call eax
sub esp, 4
xor ebx, ebx
mov dword [0x405018], ebx
jmp 0x40131c
movzx eax, ax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov dword [esp + 4], str.Computed_checksum__04x___stored_checksum__04x_n
mov dword [esp], edi
call sym._sprintf.constprop.0
mov dword [esp + 0xc], 0
mov dword [esp + 8], str.Checksum_failed
mov dword [esp + 4], edi
mov eax, dword [0x405448]
mov dword [esp], eax
call dword [sym.imp.user32.dll_MessageBoxA]
sub esp, 0x10
mov dword [esp], esi
mov eax, dword [ebp - 0xc4]
call eax
sub esp, 4
jmp 0x40168e
mov eax, dword [ebp - 0xc8]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalFree]
sub esp, 4
mov dword [esp], esi
mov eax, dword [ebp - 0xc4]
call eax
sub esp, 4
jmp 0x40168e
mov eax, dword [ebp - 0xc8]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GlobalFree]
sub esp, 4
jmp 0x40168e