Function at 0x1031172
Capabilities:
Read file on windows

Disassembly:
push 0x2bc
push 0x1006de0
call fcn.0102e874
xor ebx, ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x28], ebx
or esi, 0xffffffff
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
mov eax, dword [ebp + 0x10]
cmp eax, ebx
je 0x10311d2
add eax, 4
mov dword [ebp - 0x5c], eax
push 9
pop ecx
xor eax, eax
lea edi, [ebp - 0x80]
rep stosd dword es:[edi], eax
push 0x1f
pop ecx
lea edi, [ebp - 0xfc]
rep stosd dword es:[edi], eax
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2c], eax
cmp eax, esi
je 0x1031222
push ebx
lea ecx, [ebp - 0x100]
push ecx
push 0x24
lea ecx, [ebp - 0x80]
push ecx
push eax
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
call ebx
test eax, eax
jne 0x1031233
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], esi
jmp 0x103180b
cmp dword [ebp - 0x100], 0x24
jne 0x10317e1
push 5
pop ecx
lea edi, [ebp - 0x80]
mov esi, str.FAXCOVER_VER005w
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x10317e1
push dword [ebp - 0x6c]
mov edi, dword [sym.imp.msvcrt.dll_malloc]
call edi
pop ecx
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x10314e5
push 0
lea ecx, [ebp - 0x100]
push ecx
push dword [ebp - 0x6c]
push eax
push dword [ebp - 0x2c]
call ebx
test eax, eax
je 0x10317d9
mov eax, dword [ebp - 0x6c]
cmp eax, dword [ebp - 0x100]
jne 0x10317d9
cmp dword [ebp + 8], 0
je 0x10313f5
mov esi, dword [ebp + 0xc]
push esi
call dword [sym.imp.GDI32.dll_CreateRectRgnIndirect]
mov dword [ebp - 0x44], eax
test eax, eax
je 0x10317d9
push eax
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SelectClipRgn]
mov dword [ebp - 0x104], eax
test eax, eax
jne 0x10312d4
mov dword [ebp - 0x20], 0x1f
jmp 0x1031807
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SaveDC]
mov dword [ebp - 0x3c], eax
test eax, eax
je 0x10317d9
cmp dword [ebp - 0x6c], 0
jne 0x10312fa
mov dword [ebp - 0x20], 0x12
jmp 0x1031807
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x108], eax
push eax
push dword [ebp - 0x6c]
call dword [sym.imp.GDI32.dll_SetEnhMetaFileBits]
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x10317d9
lea eax, [ebp - 0x174]
push eax
push 0x6c
push ebx
call dword [sym.imp.GDI32.dll_GetEnhMetaFileHeader]
mov dword [ebp - 0x178], eax
test eax, eax
je 0x10317d9
push esi
push ebx
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_PlayEnhMetaFile]
test eax, eax
je 0x10317d9
push 0
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_RestoreDC]
and dword [ebp - 0x40], 0
push 1
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetBkMode]
or ebx, 0xffffffff
cmp eax, ebx
je 0x10313b9
push 8
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetMapMode]
test eax, eax
je 0x10313b9
lea eax, [ebp - 0x180]
push eax
mov eax, dword [ebp - 0x60]
neg eax
push eax
push dword [ebp - 0x64]
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetWindowExtEx]
test eax, eax
je 0x10313b9
lea eax, [ebp - 0x188]
push eax
mov eax, dword [esi + 0xc]
sub eax, dword [esi + 4]
push eax
mov eax, dword [esi + 8]
sub eax, dword [esi]
push eax
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetViewportExtEx]
test eax, eax
jne 0x10313ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], ebx
jmp 0x103180b
lea eax, [ebp - 0x190]
push eax
mov eax, dword [ebp - 0x60]
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, dword [ebp - 0x64]
cdq
push 0xfffffffffffffffe
pop ecx
idiv ecx
push eax
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetWindowOrgEx]
test eax, eax
je 0x10317d9
push 0x40
pop eax
mov dword [ebp - 0x194], eax
push eax
call edi
pop ecx
mov dword [ebp - 0x30], eax
test eax, eax
je 0x10314e5
and dword [ebp - 0x198], 0
mov ebx, dword [sym.imp.GDI32.dll_SelectObject]
mov eax, dword [ebp - 0x198]
push 0
cmp eax, dword [ebp - 0x68]
lea eax, [ebp - 0x100]
push eax
jge 0x10317ba
push 0x7c
lea eax, [ebp - 0xfc]
push eax
push dword [ebp - 0x2c]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
call esi
test eax, eax
je 0x10317d9
cmp dword [ebp - 0x100], 0x7c
jne 0x10317d9
mov eax, dword [ebp - 0x84]
lea eax, [eax + eax + 2]
mov dword [ebp - 0x19c], eax
cmp dword [ebp - 0x194], eax
jge 0x103148a
push eax
push dword [ebp - 0x30]
call dword [sym.imp.msvcrt.dll_realloc]
pop ecx
pop ecx
mov edi, eax
mov dword [ebp - 0x30], edi
test edi, edi
jne 0x103148d
jmp 0x10314e5
mov edi, dword [ebp - 0x30]
push 0
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 0x84]
push edi
push dword [ebp - 0x2c]
call esi
test eax, eax
je 0x10317d9
mov eax, dword [ebp - 0x84]
cmp dword [ebp - 0x100], eax
jne 0x10317d9
shr eax, 1
xor esi, esi
mov word [edi + eax*2], si
cmp dword [ebp - 0x34], esi
je 0x10314d4
push dword [ebp - 0x34]
call fcn.01031b59
mov dword [ebp - 0x34], esi
cmp edi, esi
je 0x10314f1
push edi
call fcn.010310ec
mov dword [ebp - 0x34], eax
cmp eax, esi
jne 0x10314f1
mov dword [ebp - 0x20], 8
jmp 0x1031807
cmp dword [ebp + 8], esi
je 0x1031546
mov eax, dword [ebp - 0xf8]
mov edi, dword [ebp - 0xf0]
cmp eax, edi
mov ecx, eax
jg 0x103150a
mov ecx, edi
mov dword [ebp - 0x1a8], ecx
mov edx, dword [ebp - 0xfc]
mov esi, dword [ebp - 0xf4]
cmp edx, esi
mov ecx, edx
jl 0x1031524
mov ecx, esi
mov dword [ebp - 0x1ac], ecx
cmp eax, edi
jl 0x1031530
mov eax, edi
mov dword [ebp - 0x1a0], eax
cmp edx, esi
mov eax, edx
jg 0x103153e
mov eax, esi
mov dword [ebp - 0x1a4], eax
xor esi, esi
mov cx, word [ebp - 0x88]
cmp cx, si
je 0x10315fe
xor eax, eax
mov dword [ebp - 0x1b0], eax
mov dword [ebp - 0x1b4], 1
cmp eax, 0x1c
jae 0x1031596
cmp cx, word [eax*2 + 0x103c0ac]
jne 0x1031776
cmp dword [ebp + 0x10], esi
je 0x1031588
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + eax*4]
jmp 0x103158a
xor eax, eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x1b4]
or dword [ebp - 0x58], eax
cmp cx, 0x80f
jne 0x10315fe
cmp dword [ebp + 8], esi
je 0x10315fe
lea esi, [ebp - 0x1ac]
lea edi, [ebp - 0x54]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push 2
lea eax, [ebp - 0x54]
push eax
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_LPtoDP]
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0xe4]
push eax
call fcn.010310fd
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x1031807
push 0x64
push 0x5a
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push eax
push dword [ebp - 0x210]
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov dword [ebp - 0x210], eax
xor esi, esi
mov eax, dword [ebp - 0x34]
cmp word [eax], si
jne 0x1031609
mov eax, dword [ebp - 0x38]
mov esi, eax
mov dword [ebp - 0x214], esi
cmp dword [ebp + 8], 0
je 0x10317af
test esi, esi
je 0x10317af
push dword [ebp - 0xec]
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetTextColor]
mov dword [ebp - 0x218], eax
or edi, 0xffffffff
cmp eax, edi
je 0x1031765
lea eax, [ebp - 0x274]
push eax
lea eax, [ebp - 0xe4]
push eax
call fcn.010310fd
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x103176e
cmp dword [ebp + 0x1c], eax
je 0x1031674
mov al, byte [ebp - 0x25c]
or al, 7
mov byte [ebp - 0x25c], al
lea eax, [ebp - 0x274]
push eax
call dword [sym.imp.GDI32.dll_CreateFontIndirectW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x1031765
push eax
push dword [ebp + 8]
call ebx
mov dword [ebp - 0x278], eax
test eax, eax
je 0x1031765
cmp dword [ebp + 0x1c], 0
je 0x103170d
and dword [ebp - 0x27c], 0
lea eax, [ebp - 0x2b8]
push eax
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_GetTextMetricsW]
test eax, eax
je 0x1031765
test byte [ebp - 0x281], 4
ja 0x103170d
push 0x1006dcc
lea eax, [ebp - 0x258]
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
lea eax, [ebp - 0x274]
push eax
call dword [sym.imp.GDI32.dll_CreateFontIndirectW]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x1031765
push eax
push dword [ebp + 8]
call ebx
mov dword [ebp - 0x27c], eax
test eax, eax
je 0x1031765
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
and dword [ebp - 0x2bc], 0
cmp word [ebp - 0x88], 0
je 0x1031737
push esi
push 0x800
call fcn.010335e4
test eax, eax
je 0x1031737
mov dword [ebp - 0x2bc], 0x20000
mov eax, dword [ebp - 0xe8]
or eax, dword [ebp - 0x2bc]
or eax, 0x810
push eax
lea eax, [ebp - 0x1ac]
push eax
push edi
push esi
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_DrawTextW]
mov dword [ebp - 0x2c0], eax
test eax, eax
jne 0x1031788
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], edi
jmp 0x103180b
inc eax
mov dword [ebp - 0x1b0], eax
shl dword [ebp - 0x1b4], 1
jmp 0x1031568
push dword [ebp - 0x278]
push dword [ebp + 8]
call ebx
push dword [ebp - 0x218]
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_SetTextColor]
push dword [ebp - 0x24]
call dword [sym.imp.GDI32.dll_DeleteObject]
and dword [ebp - 0x24], 0
inc dword [ebp - 0x198]
jmp 0x103141a
push 6
lea eax, [ebp - 0x2c8]
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10317d9
cmp dword [ebp - 0x100], 6
je 0x1031807
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1031804
mov dword [ebp - 0x20], 0xb
jmp 0x1031807
mov dword [ebp - 0x20], eax
or dword [ebp - 4], 0xffffffff
xor esi, esi
cmp dword [ebp - 0x28], esi
je 0x103181b
push dword [ebp - 0x28]
call dword [sym.imp.GDI32.dll_DeleteEnhMetaFile]
cmp dword [ebp - 0x34], esi
je 0x1031828
push dword [ebp - 0x34]
call fcn.01031b59
cmp dword [ebp - 0x24], esi
je 0x1031836
push dword [ebp - 0x24]
call dword [sym.imp.GDI32.dll_DeleteObject]
cmp dword [ebp - 0x30], esi
je 0x1031845
push dword [ebp - 0x30]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
cmp dword [ebp - 0x1c], esi
je 0x1031854
push dword [ebp - 0x1c]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
cmp dword [ebp - 0x2c], 0xffffffff
je 0x1031863
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x40], esi
je 0x1031874
push dword [ebp - 0x40]
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp dword [ebp - 0x3c], esi
je 0x1031885
push dword [ebp - 0x3c]
push dword [ebp + 8]
call dword [sym.imp.GDI32.dll_RestoreDC]
cmp dword [ebp - 0x20], esi
jne 0x10318c4
mov eax, dword [ebp + 0x18]
cmp eax, esi
je 0x10318c4
mov ecx, dword [ebp - 0x58]
mov dword [eax], ecx
lea edi, [eax + 4]
lea esi, [ebp - 0x54]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov cx, word [ebp - 0x2c6]
mov word [eax + 0x16], cx
mov cx, word [ebp - 0x2c4]
mov word [eax + 0x14], cx
lea edi, [eax + 0x18]
push 0x17
pop ecx
lea esi, [ebp - 0x210]
rep movsd dword es:[edi], dword [esi]
cmp dword [ebp - 0x44], 0
je 0x10318d3
push dword [ebp - 0x44]
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [ebp - 0x20]
call fcn.0102e8ad
ret 0x18