Function at 0x402420
Capabilities:
Access peb ldr_data
Get graphical window text
Get kernel32 base address
Get number of processors
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ecx, 0xc
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x48c]
lea edx, [ebp - 0x49e]
push ebx
xor ebx, ebx
mov eax, ebx
sub esp, 0x56c
mov dword [ebp - 0x48e], 0
mov dword [ebp - 0x460], 0
rep stosd dword es:[edi], eax
mov dword [esp], edx
mov dword [ebp - 0x49e], 0x42
mov dword [ebp - 0x48a], 0x104
mov eax, dword [0x40a024]
mov dword [ebp - 0x482], 0xffff0001
mov dword [ebp - 0x49a], eax
mov eax, dword [0x40b1f4]
mov dword [ebp - 0x496], eax
mov eax, dword [0x40b1f8]
mov dword [ebp - 0x492], eax
mov eax, dword [0x40a020]
mov dword [ebp - 0x47c], eax
call sym._PrintDlgW_4
sub esp, 4
test eax, eax
jne 0x4024b8
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x496]
mov dword [esp + 4], 1
mov dword [0x40b1f4], eax
mov eax, dword [ebp - 0x492]
mov dword [0x40b1f8], eax
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._SetMapMode_8
mov dword [ebp - 0x4f0], 0x14
mov dword [ebp - 0x4ec], 0x40a6ac
sub esp, 8
mov dword [ebp - 0x4e8], 0
mov dword [ebp - 0x4e4], 0
mov dword [ebp - 0x4e0], 0
test byte [ebp - 0x48a], 0x20
je 0x402592
mov eax, ebx
mov ecx, 0x14
lea edi, [ebp - 0x3f8]
mov esi, dword [ebp - 0x49a]
rep stosd dword es:[edi], eax
lea edx, [ebp - 0x400]
mov dword [ebp - 0x400], 0x58
mov dword [esp], edx
mov dword [ebp - 0x3cc], 0x806
mov dword [ebp - 0x3fc], esi
mov dword [ebp - 0x3e4], str.output.prn
mov dword [ebp - 0x3e0], 0x104
mov dword [ebp - 0x3c4], 0x408104
call sym._GetSaveFileNameW_4
sub esp, 4
test eax, eax
je 0x4024b0
mov dword [ebp - 0x4e8], str.output.prn
mov eax, dword [0x40a02c]
mov dword [esp], eax
call sym._GetWindowTextLengthW_4
lea ebx, [eax + 1]
sub esp, 4
lea edx, [ebx + ebx]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x53c], eax
call eax
mov dword [ebp - 0x544], eax
sub esp, 0xc
test eax, eax
je 0x403086
mov edi, dword [ebp - 0x544]
mov eax, dword [0x40a02c]
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call sym._GetWindowTextW_12
sub esp, 0xc
mov dword [ebp - 0x51c], eax
lea eax, [ebp - 0x4f0]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._StartDocW_8
sub esp, 8
test eax, eax
jg 0x402667
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._DeleteDC_4
mov edi, dword [ebp - 0x544]
sub esp, 4
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x48e]
mov dword [esp + 4], 0x5a
lea edi, [ebp - 0x45c]
mov dword [esp], eax
call sym._GetDeviceCaps_8
mov ebx, dword [sym.imp.kernel32.dll_MulDiv]
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [0x40ad84]
mov dword [esp + 8], 0x9ec
mov dword [esp], eax
call ebx
mov esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 0xc
mov dword [esp + 4], 0x71
mov dword [esp], eax
call sym._GetDeviceCaps_8
sub esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 8
mov dword [esp + 4], 0x6f
mov dword [esp], eax
mov dword [ebp - 0x4fc], esi
call sym._GetDeviceCaps_8
mov esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 8
mov dword [esp + 4], 0x5a
mov dword [esp], eax
call sym._GetDeviceCaps_8
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [0x40ad88]
mov dword [esp + 8], 0x9ec
mov dword [esp], eax
call ebx
sub esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 0xc
mov dword [esp + 4], 0x58
mov dword [esp], eax
mov dword [ebp - 0x4f4], esi
call sym._GetDeviceCaps_8
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [0x40ad8c]
mov dword [esp + 8], 0x9ec
mov dword [esp], eax
call ebx
mov esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 0xc
mov dword [esp + 4], 0x70
mov dword [esp], eax
call sym._GetDeviceCaps_8
sub esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 8
mov dword [esp + 4], 0x6e
mov dword [esp], eax
mov dword [ebp - 0x500], esi
call sym._GetDeviceCaps_8
mov esi, eax
mov eax, dword [ebp - 0x48e]
sub esp, 8
mov dword [esp + 4], 0x58
mov dword [esp], eax
call sym._GetDeviceCaps_8
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [0x40ad90]
mov dword [esp + 8], 0x9ec
mov dword [esp], eax
call ebx
mov ecx, 0x17
sub esp, 0xc
sub esi, eax
mov dword [ebp - 0x4f8], esi
mov esi, 0x40a034
rep movsd dword es:[edi], dword [esi]
call dbg.get_dpi
mov dword [esp + 4], 0x5a
mov esi, eax
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._GetDeviceCaps_8
sub esp, 8
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x45c]
mov dword [esp + 8], esi
mov dword [esp], eax
call ebx
sub esp, 0xc
mov dword [ebp - 0x45c], eax
lea eax, [ebp - 0x45c]
mov dword [esp], eax
sub dword [ebp - 0x44c], 0x64
call sym._CreateFontIndirectW_4
sub esp, 4
mov dword [ebp - 0x548], eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._SelectObject_8
sub esp, 8
cmp word [ebp - 0x47e], 0
mov dword [ebp - 0x54c], eax
je 0x402e88
mov edi, dword [ebp - 0x544]
mov eax, dword [ebp - 0x51c]
xor edx, edx
mov dword [ebp - 0x540], 1
lea eax, [edi + eax*2]
mov dword [ebp - 0x538], eax
mov dword [ebp - 0x534], 1
xor edi, edi
mov esi, dword [ebp - 0x544]
mov ebx, edi
lea esi, [esi]
nop
test byte [ebp - 0x48a], 2
je 0x402f68
movzx eax, word [ebp - 0x484]
mov edi, dword [ebp - 0x534]
cmp eax, edi
jl 0x403004
movzx eax, word [ebp - 0x486]
cmp eax, edi
setle al
movzx eax, al
mov dword [ebp - 0x524], eax
mov eax, dword [ebp - 0x48e]
mov dword [ebp - 0x528], eax
movzx eax, word [0x40af9c]
test ax, ax
je 0x402f98
mov dword [ebp - 0x51c], esi
mov edx, 0x40af9e
xor ecx, ecx
xor edi, edi
jmp 0x40291b
cmp ax, 0x26
je 0x402ca0
mov esi, ecx
xor edi, edi
add ecx, 0xb
cmp ax, 0x70
cmovne ecx, esi
movzx eax, word [edx]
add edx, 2
test ax, ax
je 0x402937
test edi, edi
jne 0x4028f8
cmp ax, 0x26
je 0x402cb0
movzx eax, word [edx]
add edx, 2
add ecx, 1
test ax, ax
jne 0x40291b
mov esi, dword [ebp - 0x51c]
lea edx, [ecx + ecx + 2]
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x53c]
call eax
mov dword [ebp - 0x52c], eax
sub esp, 0xc
test eax, eax
je 0x402e88
movzx eax, word [0x40af9c]
test ax, ax
je 0x402fa2
mov edx, 0x40af9e
xor ecx, ecx
mov dword [ebp - 0x51c], esi
xor edi, edi
mov dword [ebp - 0x520], ebx
mov esi, ecx
mov ebx, edx
mov edx, dword [ebp - 0x52c]
jmp 0x4029d1
cmp ax, 0x26
je 0x402cc0
xor edi, edi
cmp ax, 0x70
je 0x402f30
movzx eax, word [ebx]
add ebx, 2
test ax, ax
je 0x4029f4
lea ecx, [edx + esi*2]
test edi, edi
jne 0x4029b0
cmp ax, 0x26
je 0x402cd8
add ebx, 2
mov word [ecx], ax
add esi, 1
movzx eax, word [ebx - 2]
test ax, ax
jne 0x4029d1
mov eax, dword [ebp - 0x52c]
mov ecx, esi
mov ebx, dword [ebp - 0x520]
mov esi, dword [ebp - 0x51c]
lea eax, [eax + ecx*2]
mov ecx, dword [ebp - 0x524]
xor edx, edx
mov word [eax], dx
test ecx, ecx
je 0x402a33
mov eax, dword [ebp - 0x528]
mov dword [esp], eax
call sym._StartPage_4
sub esp, 4
test eax, eax
jle 0x402fad
lea eax, [ebp - 0x4dc]
xor edi, edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x528]
mov dword [esp], eax
call sym._GetTextMetricsW_8
mov eax, dword [ebp - 0x4fc]
sub esp, 8
cmp word [0x40a4a4], 0
mov dword [ebp - 0x51c], eax
je 0x402a8e
mov dword [esp + 4], 0x40a4a4
mov ecx, dword [ebp - 0x524]
lea edx, [ebp - 0x500]
mov dword [esp], 1
mov eax, dword [ebp - 0x528]
call sym._notepad_print_header.part.0
mov edi, eax
mov eax, dword [ebp - 0x4f4]
imul edi, dword [ebp - 0x4dc]
add edi, dword [ebp - 0x51c]
mov dword [ebp - 0x51c], eax
mov eax, dword [ebp - 0x52c]
cmp word [eax], 0
jne 0x402ce8
mov edx, edi
mov edi, dword [ebp - 0x538]
nop
mov ecx, dword [0x40a090]
test ebx, ebx
je 0x402b60
test ecx, ecx
jne 0x402bc0
mov ecx, ebx
mov eax, dword [ebp - 0x524]
mov dword [ebp - 0x50c], ecx
test eax, eax
jne 0x402d70
cmp edi, esi
jbe 0x402de0
cmp edx, dword [ebp - 0x51c]
jge 0x402de0
mov ebx, dword [ebp - 0x4dc]
add ebx, dword [ebp - 0x4cc]
jmp 0x402b31
cmp ax, 0xa
lea ecx, [edx + ebx]
cmove edx, ecx
add esi, 2
cmp edi, esi
jbe 0x402de0
cmp edx, dword [ebp - 0x51c]
jge 0x402de0
movzx eax, word [esi]
cmp ax, 0xa
je 0x402b10
cmp ax, 0xd
je 0x402b10
cmp edi, esi
jbe 0x402de0
xor ebx, ebx
mov ecx, dword [0x40a090]
test ebx, ebx
jne 0x402ace
lea esi, [esi]
nop
cmp edi, esi
ja 0x402b8e
jmp 0x403018
mov word [ebp + ebx*2 - 0x400], ax
add ebx, 1
cmp ebx, 0x1f3
ja 0x402bb7
add esi, 2
cmp edi, esi
jbe 0x402ace
movzx eax, word [esi]
cmp ax, 0xd
je 0x402ace
cmp ax, 0xa
je 0x402ace
cmp ax, 9
je 0x402d38
cmp ebx, 0x1f3
jbe 0x402b70
test ecx, ecx
je 0x402b83
lea esi, [esi]
nop
lea eax, [ebp - 0x508]
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x50c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x4f8]
sub eax, dword [ebp - 0x500]
mov dword [esp + 8], ebx
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x400]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x528]
mov dword [ebp - 0x520], edx
mov dword [esp], eax
call sym._GetTextExtentExPointW_28
mov eax, dword [ebp - 0x50c]
mov edx, dword [ebp - 0x520]
sub esp, 0x1c
cmp eax, ebx
mov ecx, eax
jae 0x402c32
cmp word [ebp + eax*2 - 0x400], 0x20
jne 0x402ee0
mov ecx, dword [ebp - 0x524]
test ecx, ecx
jne 0x402ed0
sub ebx, eax
je 0x402aec
lea eax, [ebp + eax*2 - 0x400]
lea ecx, [ebx + ebx]
mov dword [ebp - 0x520], edx
mov dword [esp + 4], eax
lea eax, [ebp - 0x400]
mov dword [esp + 8], ecx
mov dword [esp], eax
call sym._memcpy
mov edx, dword [ebp - 0x520]
mov eax, dword [ebp - 0x4cc]
add eax, dword [ebp - 0x4dc]
add edx, eax
cmp edi, esi
jbe 0x402de2
cmp edx, dword [ebp - 0x51c]
jl 0x402ac0
jmp 0x402de2
add ecx, 1
xor edi, edi
jmp 0x402910
mov edi, 1
jmp 0x402910
mov edi, 0x26
add esi, 1
mov word [ecx], di
xor edi, edi
jmp 0x4029c6
mov edi, 1
jmp 0x4029c6
add eax, 2
cmp word [eax], 0
jne 0x402ce8
lea edx, [ebp - 0x508]
mov dword [esp + 0xc], edx
mov edx, dword [ebp - 0x52c]
sub eax, edx
mov dword [esp + 4], edx
sar eax, 1
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x528]
mov dword [esp], eax
call sym._GetTextExtentPoint32W_16
mov eax, dword [ebp - 0x4dc]
sub esp, 0x10
add eax, eax
sub dword [ebp - 0x51c], eax
jmp 0x402ab7
mov eax, 8
jmp 0x402d56
mov word [ebp + ebx*2 - 0x400], 0x20
add ebx, 1
sub eax, 1
je 0x402b7b
cmp ebx, 0x1f3
jbe 0x402d40
test ecx, ecx
je 0x402d4d
jmp 0x402bc0
mov dword [ebp - 0x530], ebx
lea eax, [ebp - 0x400]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x500]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x500]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x528]
mov dword [esp + 0x1c], 0
mov dword [esp + 0xc], 4
mov dword [esp], eax
mov dword [ebp - 0x520], edx
call sym._ExtTextOutW_32
mov eax, dword [ebp - 0x50c]
mov ebx, dword [ebp - 0x530]
mov edx, dword [ebp - 0x520]
sub esp, 0x20
jmp 0x402c40
xor ebx, ebx
mov eax, dword [ebp - 0x52c]
cmp word [eax], 0
je 0x402e10
mov dword [esp + 4], eax
mov ecx, dword [ebp - 0x524]
lea edx, [ebp - 0x500]
mov dword [esp], 0
mov eax, dword [ebp - 0x528]
call sym._notepad_print_header.part.0
mov eax, dword [ebp - 0x524]
test eax, eax
jne 0x402f77
mov edi, dword [ebp - 0x52c]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edi
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
add dword [ebp - 0x534], 1
mov edx, 1
sub esp, 0xc
cmp dword [ebp - 0x538], esi
ja 0x402890
add dword [ebp - 0x540], 1
mov edi, dword [ebp - 0x540]
mov edx, 1
movzx eax, word [ebp - 0x47e]
cmp eax, edi
jge 0x402877
lea esi, [esi]
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._EndDoc_4
mov eax, dword [ebp - 0x54c]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._SelectObject_8
mov eax, dword [ebp - 0x548]
sub esp, 8
mov dword [esp], eax
call sym._DeleteObject_4
sub esp, 4
jmp 0x402624
mov dword [ebp - 0x530], ebx
mov ebx, eax
jmp 0x402d76
test eax, eax
je 0x402c32
mov dword [ebp - 0x520], edi
nop
mov edi, ecx
sub ecx, 1
je 0x402f8d
cmp word [ebp + ecx*2 - 0x400], 0x20
jne 0x402ef0
mov dword [ebp - 0x530], edi
mov edi, dword [ebp - 0x520]
test ecx, ecx
jle 0x402c32
mov eax, dword [ebp - 0x530]
mov dword [ebp - 0x50c], eax
jmp 0x402c32
mov eax, dword [ebp - 0x534]
mov dword [esp + 8], 0x4080c0
mov dword [esp + 4], 0xb
mov dword [esp + 0xc], eax
mov dword [esp], ecx
mov dword [ebp - 0x530], edx
call sym._wnsprintfW
mov edx, dword [ebp - 0x530]
add esi, eax
jmp 0x4029c6
mov dword [ebp - 0x524], 1
jmp 0x4028c7
mov eax, dword [ebp - 0x528]
mov dword [esp], eax
call sym._EndPage_4
sub esp, 4
jmp 0x402e1e
mov edi, dword [ebp - 0x520]
jmp 0x402c32
mov edx, 2
jmp 0x402941
mov eax, dword [ebp - 0x52c]
jmp 0x402a0b
mov eax, dword [0x40a024]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.Print_Error
mov dword [esp + 4], str.StartPage_failed
mov dword [esp], eax
call sym._MessageBoxW_16
mov edi, dword [ebp - 0x52c]
sub esp, 0x10
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x402e88
test edx, edx
jne 0x402e60
jmp 0x402e88
test ecx, ecx
je 0x402ad8
lea eax, [ebp - 0x508]
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x50c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x4f8]
sub eax, dword [ebp - 0x500]
mov dword [esp + 8], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x400]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x528]
mov dword [ebp - 0x520], edx
mov dword [esp], eax
call sym._GetTextExtentExPointW_28
mov eax, dword [ebp - 0x50c]
mov edx, dword [ebp - 0x520]
sub esp, 0x1c
jmp 0x402c32
mov eax, dword [ebp - 0x48e]
mov dword [esp], eax
call sym._DeleteDC_4
sub esp, 4
call dbg.ShowLastError
jmp 0x4024b0