Function at 0x402270
Capabilities:
Get graphical window text

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x52c
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov word [ebp - 0x48], 0
mov dword [ebp - 0x88], 0x42
mov eax, dword [0x408210]
mov dword [ebp - 0x84], eax
mov eax, dword [0x4093f8]
mov dword [ebp - 0x80], eax
mov eax, dword [0x4093fc]
mov dword [ebp - 0x7c], eax
mov eax, dword [0x40820c]
mov dword [ebp - 0x66], eax
mov dword [ebp - 0x74], 0x104
mov dword [ebp - 0x6c], 0xffff0001
lea eax, [ebp - 0x88]
push eax
call dword [sym.imp.comdlg32.dll_PrintDlgW]
test eax, eax
je 0x402c62
mov eax, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x7c]
mov dword [0x4093f8], eax
mov dword [0x4093fc], ecx
push 1
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_SetMapMode]
mov dword [ebp - 0xb0], 0x14
mov dword [ebp - 0xac], 0x4088a4
mov dword [ebp - 0xa8], 0
mov dword [ebp - 0xa4], 0
mov dword [ebp - 0xa0], 0
test byte [ebp - 0x74], 0x20
je 0x4023e9
mov edx, dword [ebp - 0x84]
lea edi, [ebp - 0x530]
xor eax, eax
mov ecx, 0x14
rep stosd dword es:[edi], eax
mov dword [ebp - 0x538], 0x58
mov dword [ebp - 0x504], 0x806
mov dword [ebp - 0x534], edx
mov dword [ebp - 0x51c], str.output.prn
mov dword [ebp - 0x518], 0x104
mov dword [ebp - 0x4fc], 0x406084
lea eax, [ebp - 0x538]
push eax
call dword [sym.imp.comdlg32.dll_GetSaveFileNameW]
test eax, eax
je 0x4023dd
mov eax, str.output.prn
mov dword [ebp - 0xa8], eax
je 0x402c62
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextLengthW]
mov esi, eax
lea ecx, [eax*2 + 2]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x538], eax
mov eax, dword [ebp - 0x538]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x402c54
mov edi, eax
inc esi
push esi
push eax
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextW]
mov esi, eax
lea eax, [ebp - 0xb0]
push eax
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_StartDocW]
test eax, eax
jle 0x402c28
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x40], edi
mov ebx, dword [sym.imp.gdi32.dll_GetDeviceCaps]
push 0x5a
push dword [ebp - 0x78]
call ebx
mov esi, dword [sym.imp.kernel32.dll_MulDiv]
push 0x9ec
push eax
push dword [0x408f7c]
call esi
mov edi, esi
mov esi, eax
push 0x71
push dword [ebp - 0x78]
call ebx
sub esi, eax
mov dword [ebp - 0x38], esi
push 0x6f
push dword [ebp - 0x78]
call ebx
mov esi, eax
push 0x5a
push dword [ebp - 0x78]
call ebx
push 0x9ec
push eax
push dword [0x408f80]
call edi
sub esi, eax
mov dword [ebp - 0x30], esi
push 0x58
push dword [ebp - 0x78]
call ebx
push 0x9ec
push eax
push dword [0x408f84]
call edi
mov esi, eax
push 0x70
push dword [ebp - 0x78]
call ebx
sub esi, eax
mov dword [ebp - 0x3c], esi
push 0x6e
push dword [ebp - 0x78]
call ebx
mov esi, eax
push 0x58
push dword [ebp - 0x78]
call ebx
push 0x9ec
push eax
push dword [0x408f88]
call edi
sub esi, eax
mov dword [ebp - 0x34], esi
lea edi, [ebp - 0x150]
mov ecx, 0x17
mov esi, 0x40822c
rep movsd dword es:[edi], dword [esi]
push dword [0x408210]
call dword [sym.imp.user32.dll_GetDpiForWindow]
mov esi, eax
push 0x5a
push dword [ebp - 0x78]
call ebx
push esi
push eax
push dword [ebp - 0x150]
call dword [sym.imp.kernel32.dll_MulDiv]
mov dword [ebp - 0x150], eax
add dword [ebp - 0x140], 0xffffff9c
lea eax, [ebp - 0x150]
push eax
call dword [sym.imp.gdi32.dll_CreateFontIndirectW]
mov dword [ebp - 0x90], eax
push eax
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_SelectObject]
mov dword [ebp - 0x8c], eax
cmp word [ebp - 0x68], 0
je 0x402c01
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x18]
lea eax, [eax + ecx*2]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x44], 1
xor eax, eax
xor edi, edi
mov esi, dword [ebp - 0x40]
mov dword [ebp - 0x2c], 1
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [ebp - 0x28], 1
test byte [ebp - 0x74], 2
je 0x4025bc
movzx ecx, word [ebp - 0x6e]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x2c], ecx
ja 0x402be3
movzx eax, word [ebp - 0x70]
xor ecx, ecx
cmp dword [ebp - 0x2c], eax
setae cl
mov dword [ebp - 0x28], ecx
movzx ebx, word [0x409194]
test bx, bx
je 0x402630
xor edx, edx
mov ecx, 0x409196
xor eax, eax
mov dword [ebp - 0x9c], edi
jmp 0x402605
xor edx, edx
mov edi, eax
xor eax, eax
cmp bx, 0x26
sete dl
setne al
add edi, eax
mov eax, edi
mov edi, dword [ebp - 0x9c]
movzx ebx, word [ecx]
add ecx, 2
test bx, bx
je 0x402632
test edx, edx
je 0x4025e0
xor edx, edx
cmp bx, 0x70
je 0x40261c
movzx ebx, bx
cmp ebx, 0x26
jne 0x4025fa
inc eax
jmp 0x4025fa
add eax, 0xb
jmp 0x4025fa
xor eax, eax
mov ebx, dword [ebp - 0x78]
lea ecx, [eax*2 + 2]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x402c01
movzx edx, word [0x409194]
mov ecx, eax
test dx, dx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x24], ebx
je 0x402709
xor ecx, ecx
mov ebx, 0x409196
xor eax, eax
jmp 0x40269e
inc ecx
xor eax, eax
movzx edx, word [ebx]
add ebx, 2
test dx, dx
je 0x402700
test eax, eax
jne 0x4026c0
mov eax, 1
cmp dx, 0x26
je 0x402693
mov eax, dword [ebp - 0x14]
mov word [eax + ecx*2], dx
jmp 0x402690
cmp dx, 0x70
je 0x4026d9
movzx eax, dx
cmp eax, 0x26
jne 0x402691
mov eax, dword [ebp - 0x14]
mov word [eax + ecx*2], 0x26
jmp 0x402690
mov eax, dword [ebp - 0x14]
lea eax, [eax + ecx*2]
push dword [ebp - 0x2c]
push 0x4060c6
push 0xb
push eax
mov dword [ebp - 0x10], ecx
call dword [sym.imp.shlwapi.dll_wnsprintfW]
mov ecx, dword [ebp - 0x10]
add esp, 0x10
add ecx, eax
jmp 0x402691
mov eax, dword [ebp - 0x14]
lea ecx, [eax + ecx*2]
mov ebx, dword [ebp - 0x24]
mov word [ecx], 0
cmp dword [ebp - 0x28], 0
je 0x402723
push ebx
call dword [sym.imp.gdi32.dll_StartPage]
test eax, eax
jle 0x402b90
lea eax, [ebp - 0xec]
push eax
push ebx
call dword [sym.imp.gdi32.dll_GetTextMetricsW]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x98], eax
xor edx, edx
cmp word [0x40869c], 0
mov ecx, 0
je 0x4027c1
xor eax, eax
nop
nop
nop
cmp word [eax + 0x40869e], 0
lea eax, [eax + 2]
jne 0x402750
sar eax, 1
lea ecx, [ebp - 0x20]
push ecx
push eax
push 0x40869c
push ebx
call dword [sym.imp.gdi32.dll_GetTextExtentPoint32W]
mov ecx, 1
cmp dword [ebp - 0x28], 0
je 0x4027bf
mov eax, 0xfffffffe
cmp word [eax + 0x40869e], 0
lea eax, [eax + 2]
jne 0x402780
sar eax, 1
mov edx, dword [ebp - 0x34]
add edx, dword [ebp - 0x3c]
sub edx, dword [ebp - 0x20]
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
sar ecx, 1
push 0
push eax
push 0x40869c
lea eax, [ebp - 0x3c]
push eax
push 4
push dword [ebp - 0x38]
push ecx
push ebx
call dword [sym.imp.gdi32.dll_ExtTextOutW]
mov ecx, 1
xor edx, edx
mov ebx, dword [ebp - 0xec]
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
cmp word [eax], 0
mov eax, ebx
je 0x40281d
mov dword [ebp - 0x94], ecx
xor eax, eax
mov edx, dword [ebp - 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp word [edx + eax + 2], 0
lea eax, [eax + 2]
jne 0x4027f0
sar eax, 1
lea ecx, [ebp - 0x20]
push ecx
push eax
push edx
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_GetTextExtentPoint32W]
mov edx, 0xfffffffe
mov eax, dword [ebp - 0xec]
mov ecx, dword [ebp - 0x94]
imul eax, edx
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
imul ebx, ecx
add ebx, dword [ebp - 0x98]
nop
test edi, edi
je 0x402840
mov eax, dword [0x408288]
jmp 0x402990
xor edi, edi
mov eax, dword [0x408288]
cmp esi, dword [ebp - 0x18]
jae 0x402990
xor edi, edi
jmp 0x40286e
mov edi, ecx
add esi, 2
cmp esi, dword [ebp - 0x18]
jae 0x402990
movzx edx, word [esi]
cmp edx, 9
je 0x4028b0
cmp edx, 0xa
je 0x402990
cmp edx, 0xd
je 0x402990
mov ecx, edi
cmp edi, 0x1f3
ja 0x40294a
mov word [ebp + edi*2 - 0x538], dx
inc edi
mov ecx, edi
jmp 0x40294a
cmp edi, 0x1f4
jae 0x402940
mov word [ebp + edi*2 - 0x538], 0x20
cmp edi, 0x1f3
je 0x402930
mov word [ebp + edi*2 - 0x536], 0x20
cmp edi, 0x1f2
jae 0x402930
mov word [ebp + edi*2 - 0x534], 0x20
cmp edi, 0x1f1
je 0x402930
mov word [ebp + edi*2 - 0x532], 0x20
cmp edi, 0x1f0
jae 0x402930
mov word [ebp + edi*2 - 0x530], 0x20
cmp edi, 0x1ef
je 0x402930
mov word [ebp + edi*2 - 0x52e], 0x20
cmp edi, 0x1ee
jb 0x402965
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, 0x1f4
mov edi, 0x1f4
jmp 0x402942
mov ecx, edi
test eax, eax
je 0x402862
cmp ecx, 0x1f4
jb 0x402860
mov edi, ecx
test eax, eax
je 0x402862
jmp 0x402ace
mov word [ebp + edi*2 - 0x52c], 0x20
mov ecx, 0x1f4
cmp edi, 0x1ed
je 0x40294a
add edi, 7
mov dx, 0x20
jmp 0x402896
test eax, eax
je 0x402a00
mov eax, dword [ebp - 0x34]
sub eax, dword [ebp - 0x3c]
lea ecx, [ebp - 0xf4]
push ecx
push 0
lea ecx, [ebp - 0x20]
push ecx
push eax
push edi
lea eax, [ebp - 0x538]
push eax
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_GetTextExtentExPointW]
mov eax, dword [ebp - 0x20]
cmp eax, edi
jae 0x402a05
test eax, eax
je 0x402a05
cmp word [ebp + eax*2 - 0x538], 0x20
je 0x402a05
mov ecx, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp word [ebp + ecx*2 - 0x538], 0x20
je 0x402abb
dec ecx
jne 0x4029e0
jmp 0x402a05
mov dword [ebp - 0x20], edi
mov eax, edi
cmp dword [ebp - 0x28], 0
je 0x402a2b
push 0
push eax
lea eax, [ebp - 0x538]
push eax
lea eax, [ebp - 0x3c]
push eax
push 4
push ebx
push dword [ebp - 0x3c]
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_ExtTextOutW]
mov eax, dword [ebp - 0x20]
sub edi, eax
jne 0x402a80
cmp esi, dword [ebp - 0x18]
jae 0x402aa9
cmp ebx, dword [ebp - 0x10]
jge 0x402aa9
mov eax, dword [ebp - 0xdc]
add eax, dword [ebp - 0xec]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi]
cmp ecx, 0xd
je 0x402a5d
cmp ecx, 0xa
jne 0x402aa9
mov edx, eax
cmp cx, 0xa
je 0x402a67
xor edx, edx
add ebx, edx
add esi, 2
cmp esi, dword [ebp - 0x18]
jae 0x402aa9
cmp ebx, dword [ebp - 0x10]
jl 0x402a50
jmp 0x402aa9
lea eax, [eax*2 - 0x538]
add eax, ebp
lea ecx, [edi + edi]
push ecx
push eax
lea eax, [ebp - 0x538]
push eax
call sym._memcpy
add esp, 0xc
add ebx, dword [ebp - 0xec]
add ebx, dword [ebp - 0xdc]
cmp esi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x10]
jae 0x402ae0
cmp ebx, eax
jl 0x402830
jmp 0x402ae0
test ecx, ecx
jle 0x402a05
inc ecx
mov dword [ebp - 0x20], ecx
mov eax, ecx
jmp 0x402a05
mov edi, ecx
jmp 0x402994
mov ebx, dword [ebp - 0x14]
cmp word [ebx], 0
je 0x402b5c
xor eax, eax
nop
nop
nop
nop
nop
cmp word [ebx + eax + 2], 0
lea eax, [eax + 2]
jne 0x402af0
sar eax, 1
lea ecx, [ebp - 0x20]
push ecx
push eax
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_GetTextExtentPoint32W]
cmp dword [ebp - 0x28], 0
je 0x402b6b
mov eax, 0xfffffffe
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp word [ebx + eax + 2], 0
lea eax, [eax + 2]
jne 0x402b20
sar eax, 1
mov ebx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
sub ecx, dword [ebp - 0x1c]
add ebx, dword [ebp - 0x3c]
sub ebx, dword [ebp - 0x20]
mov edx, ebx
shr edx, 0x1f
add edx, ebx
sar edx, 1
push 0
push eax
push dword [ebp - 0x14]
lea eax, [ebp - 0x3c]
push eax
push 4
push ecx
push edx
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_ExtTextOutW]
cmp dword [ebp - 0x28], 0
je 0x402b6b
push dword [ebp - 0x24]
call dword [sym.imp.gdi32.dll_EndPage]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], 1
mov bl, 1
jmp 0x402bbd
push 0x30
push str.Print_Error
push str.StartPage_failed
push dword [0x408210]
call dword [sym.imp.user32.dll_MessageBoxW]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
xor ebx, ebx
mov dword [ebp - 0x10], 0
mov eax, dword [eax + 0x30]
push dword [ebp - 0x14]
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
test bl, bl
je 0x402be3
inc dword [ebp - 0x2c]
mov eax, 1
cmp esi, dword [ebp - 0x18]
jb 0x402590
cmp dword [ebp - 0x10], 0
je 0x402c01
mov edx, dword [ebp - 0x44]
lea eax, [edx + 1]
movzx ecx, word [ebp - 0x68]
cmp edx, ecx
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x10]
jb 0x402577
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_EndDoc]
push dword [ebp - 0x8c]
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_SelectObject]
push dword [ebp - 0x90]
call dword [sym.imp.gdi32.dll_DeleteObject]
mov edi, dword [ebp - 0x40]
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_DeleteDC]
mov eax, dword fs:[0x18]
mov dword [ebp - 0xec], eax
mov eax, dword [ebp - 0xec]
mov eax, dword [eax + 0x30]
push edi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
jmp 0x402c62
push dword [ebp - 0x78]
call dword [sym.imp.gdi32.dll_DeleteDC]
call sym._ShowLastError
add esp, 0x52c
pop esi
pop edi
pop ebx
pop ebp
ret