Function at 0x40c030
Capabilities:
Delete file
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x3f4
mov eax, dword [0x4630e0]
xor eax, esp
mov dword [esp + 0x3f0], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
imul edi, edi, 0x1008
add edi, dword [0x464c00]
xor esi, esi
push esi
push esi
mov dword [esp + 0xe0], esi
mov dword [esp + 0x5c], esi
mov ecx, dword [edi + 0xa10]
mov edx, dword [ecx + 0x24]
push 0x147
push 0xcc
push eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x50], esi
mov ebx, 1
mov dword [esp + 0x94], esi
mov dword [esp + 0x8c], edx
mov byte [esp + 0x304], 0
mov byte [esp + 0x1fc], 0
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
test eax, eax
jge 0x40c0db
push 0x8b
call fcn.0040ab70
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x3f0]
xor ecx, esp
call fcn.0043b76b
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x5c]
lea ecx, [esp + 0xe8]
push ecx
push eax
push 0x148
push 0xcc
push edx
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
cmp dword [0x465308], esi
jne 0x40c1a5
push 0
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0xf0]
push ecx
call sub.WINSPOOL.DRV_OpenPrinterA
test eax, eax
je 0x40c0c4
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x5c]
push 0
push 0
push 0
lea edx, [esp + 0xf4]
push edx
push eax
push ecx
call sub.WINSPOOL.DRV_DocumentPropertiesA
test eax, eax
mov dword [0x465308], eax
jne 0x40c14c
mov dword [esp + 0x3c], ebx
jmp 0x40c7a3
push eax
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
mov dword [0x46530c], eax
jne 0x40c16e
mov dword [esp + 0x3c], ebx
jmp 0x40c7a3
mov ecx, dword [esp + 0x5c]
push 2
push 0
push eax
mov eax, dword [esp + 0x60]
lea edx, [esp + 0xf4]
push edx
push eax
push ecx
call sub.WINSPOOL.DRV_DocumentPropertiesA
test eax, eax
jge 0x40c197
mov dword [esp + 0x3c], ebx
jmp 0x40c7a3
mov edx, dword [esp + 0x54]
push edx
call sub.WINSPOOL.DRV_ClosePrinter
mov dword [esp + 0x54], esi
mov eax, dword [0x46530c]
mov cx, word [ebp + 0x10]
mov word [eax + 0x36], cx
mov edx, dword [0x46530c]
push edx
push 0
lea eax, [esp + 0xf0]
push eax
push 0
call dword [sym.imp.GDI32.dll_CreateDCA]
mov esi, eax
test esi, esi
jne 0x40c1da
mov dword [esp + 0x3c], ebx
jmp 0x40c7a3
push 0x6e
push esi
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0x6f
push esi
mov dword [esp + 0x74], eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0x70
push esi
mov dword [esp + 0x68], eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov ecx, dword [esp + 0x6c]
neg eax
push 0x71
lea edx, [ecx + eax*2]
push esi
mov dword [esp + 0x74], edx
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov ecx, dword [esp + 0x60]
neg eax
push 0x58
lea edx, [ecx + eax*2]
push esi
mov dword [esp + 0x68], edx
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov ecx, dword [esp + 0x6c]
xor edx, edx
cmp dword [0x4652ec], edx
mov dword [esp + 0x90], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0xa0], edx
mov dword [esp + 0x9c], edx
mov dword [esp + 0xa4], ecx
mov dword [esp + 0xa8], eax
je 0x40c284
mov edx, dword [edi + 0xeec]
mov dword [esp + 0x40], edx
mov edx, dword [edi + 0xef0]
mov dword [esp + 0x44], edx
mov edx, dword [edi + 0xef4]
mov dword [esp + 0x48], edx
mov edx, dword [edi + 0xef8]
jmp 0x40c2a4
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x78]
mov edx, dword [edx + 0x114]
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x78]
mov edx, dword [edx + 0x110]
cmp dword [0x460008], 0
mov dword [esp + 0x4c], edx
je 0x40c2ef
mov eax, ecx
shl eax, 8
mov dword [esp + 0x34], eax
cdq
idiv dword [esp + 0x48]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x60]
shl eax, 8
mov dword [esp + 0x50], eax
cdq
idiv dword [esp + 0x4c]
mov ecx, dword [esp + 0x58]
cmp ecx, eax
jge 0x40c2e5
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x34]
jmp 0x40c321
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x38], eax
jmp 0x40c321
shl eax, 8
mov dword [esp + 0x50], eax
cdq
idiv dword [edi + 0xef8]
shl ecx, 8
mov dword [esp + 0x34], ecx
mov dword [esp + 0x58], eax
mov eax, ecx
cdq
idiv dword [edi + 0xef4]
mov edx, dword [esp + 0x58]
cmp eax, edx
mov dword [esp + 0x38], eax
jl 0x40c321
mov dword [esp + 0x38], edx
cmp dword [esp + 0x38], 0x100
jle 0x40c3ea
cmp dword [edi], 9
jne 0x40c3ea
lea eax, [esp + 0xe8]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x1e8]
push ecx
push 0
push 0x453718
lea edx, [esp + 0xf4]
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [esp + 0x2f0]
push eax
push 0
push 0x453714
lea ecx, [esp + 0xf4]
push ecx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0x1e8]
lea esp, [esp]
lea edx, [esp + 0x1e8]
cmp ecx, edx
lea ecx, [esp + 0x2f0]
je 0x40c3a4
mov ecx, edx
mov eax, dword [esp + 0x40]
lea edx, [eax + eax]
mov eax, dword [esp + 0x44]
mov dword [esp + 0x40], edx
lea edx, [eax + eax]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x44], edx
lea edx, [eax + eax]
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x48], edx
lea edx, [eax + eax]
mov eax, dword [esp + 0x38]
mov dword [esp + 0x4c], edx
cdq
sub eax, edx
sar eax, 1
add ebx, ebx
cmp eax, 0x100
mov dword [esp + 0x38], eax
jg 0x40c390
mov ecx, dword [esp + 0x34]
mov eax, ecx
mov ecx, dword [esp + 0x38]
cdq
idiv ecx
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x50]
cdq
idiv ecx
mov ecx, eax
mov eax, dword [esp + 0x4c]
lea eax, [ecx + eax - 1]
cdq
idiv ecx
mov edx, dword [esp + 0x48]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x64], eax
lea eax, [ecx + edx - 1]
cdq
idiv ecx
mov ecx, dword [esp + 0x64]
lea edx, [esp + 0xac]
push edx
push esi
imul ecx, eax
xor eax, eax
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], eax
mov dword [esp + 0xa0], ecx
mov dword [esp + 0xbc], eax
mov dword [esp + 0xc0], eax
mov dword [esp + 0xc4], eax
mov dword [esp + 0xb4], 0x14
mov dword [esp + 0xb8], str.Document
call dword [sym.imp.GDI32.dll_StartDocA]
test eax, eax
jg 0x40c48b
mov dword [esp + 0x3c], 1
jmp 0x40c7a3
mov eax, dword [esp + 0x38]
imul eax, ebx
mov dword [esp + 0x70], eax
push 0x7f02
push 0
fild dword [esp + 0x78]
mov dword [0x464e3c], 1
fmul qword [0x4535f0]
fstp qword [esp + 0xd8]
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x44]
add ecx, eax
cmp eax, ecx
mov dword [esp + 0x84], 0
mov dword [esp + 0x68], eax
mov dword [esp + 0x94], ecx
jge 0x40c79c
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x48]
add edx, ecx
mov dword [esp + 0x64], edx
cmp ecx, dword [esp + 0x64]
mov dword [esp + 0x74], ecx
jge 0x40c787
mov eax, dword [esp + 0x34]
neg eax
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x98]
push ecx
add eax, 1
push eax
push 0x465198
push 0x70
mov dword [esp + 0x94], eax
call fcn.00406080
add esp, 8
push eax
lea edx, [esp + 0xf4]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
mov ecx, dword [esp + 0x6c]
add esp, 0x10
lea eax, [esp + 0xe8]
push eax
push 0xcb
push ecx
call dword [sym.imp.USER32.dll_SetDlgItemTextA]
push esi
call dword [sym.imp.GDI32.dll_StartPage]
test eax, eax
jle 0x40c834
mov edx, dword [esp + 0x4c]
sub edx, dword [esp + 0x68]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x58]
add eax, edx
cmp ecx, eax
jl 0x40c59f
mov ecx, eax
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x50]
cmp edx, eax
jge 0x40c5ad
mov eax, edx
lea edx, [esp + 0xdc]
push edx
mov edx, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x68]
push edx
mov edx, dword [esp + 0x78]
push edx
mov edx, dword [esp + 0x88]
push ecx
mov ecx, dword [esp + 0x88]
push eax
mov eax, dword [esp + 0x80]
push eax
push ecx
add edx, 8
push edx
push esi
call fcn.0040ae20
mov eax, dword [esp + 0x68]
cdq
idiv ebx
add esp, 0x28
mov dword [esp + 0xc0], eax
mov eax, dword [esp + 0x44]
cdq
idiv ebx
mov dword [esp + 0xc4], eax
mov eax, dword [esp + 0x48]
cdq
idiv ebx
mov dword [esp + 0xc8], eax
mov eax, dword [esp + 0x4c]
cdq
idiv ebx
mov dword [esp + 0xcc], eax
mov eax, dword [0x4652f0]
test eax, eax
je 0x40c6d0
cmp dword [edi + 0x590], 0
mov dword [esp + 0x88], 0
jle 0x40c6d0
xor eax, eax
mov dword [esp + 0x7c], eax
mov ecx, dword [edi + 0x594]
add eax, ecx
cmp dword [eax + 4], 0
je 0x40c6a7
mov edx, dword [edi + 0xa10]
fld qword [esp + 0xd0]
mov ecx, dword [edx + 0x20]
push 0
mov eax, dword [eax + 8]
push 0
push 2
push ecx
mov ecx, dword [esp + 0x80]
push 0
lea edx, [esp + 0xd4]
push edx
sub esp, 0x10
fst qword [esp + 8]
lea edx, [esp + 0xc4]
fstp qword [esp]
push ecx
push edx
push esi
push 0xffffffffffffffff
push eax
push 0
call fcn.00424fb0
add esp, 0x40
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x7c]
add ecx, 1
add eax, 0xc
cmp ecx, dword [edi + 0x590]
mov dword [esp + 0x88], ecx
mov dword [esp + 0x7c], eax
jl 0x40c64d
mov eax, dword [0x4652f0]
mov ecx, dword [edi + 0x5a4]
test ecx, ecx
je 0x40c736
cmp dword [edi + 0x598], 0
je 0x40c6e8
cmp eax, 1
je 0x40c6ed
cmp eax, 2
jne 0x40c736
mov edx, dword [edi + 0xa10]
fld qword [esp + 0xd0]
mov eax, dword [edx + 0x20]
push 0
push 0
push 2
push eax
mov eax, dword [esp + 0x80]
push 0
lea edx, [esp + 0xd4]
push edx
sub esp, 0x10
fst qword [esp + 8]
lea edx, [esp + 0xc4]
fstp qword [esp]
push eax
push edx
push esi
push 0xffffffffffffffff
push ecx
push 0
call fcn.00424fb0
add esp, 0x40
mov eax, dword [esp + 0x90]
push eax
lea ecx, [esp + 0xa0]
push ecx
push esi
call fcn.00408330
add esp, 0xc
push esi
call dword [sym.imp.GDI32.dll_EndPage]
test eax, eax
jle 0x40c83a
mov eax, dword [esp + 0x74]
add eax, dword [esp + 0x34]
mov edx, dword [esp + 0x8c]
add dword [esp + 0x50], edx
cmp eax, dword [esp + 0x64]
mov dword [esp + 0x74], eax
jl 0x40c525
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x40]
add eax, dword [esp + 0x58]
cmp eax, dword [esp + 0x94]
mov dword [esp + 0x68], eax
jl 0x40c502
push esi
call dword [sym.imp.GDI32.dll_EndDoc]
mov eax, dword [esp + 0x80]
test eax, eax
mov dword [0x464e3c], 0
je 0x40c7bf
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov eax, dword [esp + 0x5c]
push 0x45354b
push 0xcb
push eax
call dword [sym.imp.USER32.dll_SetDlgItemTextA]
test esi, esi
je 0x40c7df
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
cmp byte [esp + 0x1e8], 0
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
je 0x40c7f9
lea ecx, [esp + 0x1e8]
push ecx
call esi
cmp byte [esp + 0x2f0], 0
je 0x40c80d
lea edx, [esp + 0x2f0]
push edx
call esi
mov eax, dword [esp + 0x54]
test eax, eax
je 0x40c81b
push eax
call sub.WINSPOOL.DRV_ClosePrinter
mov ecx, dword [esp + 0x3fc]
mov eax, dword [esp + 0x3c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0043b76b
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x3c], 1
jmp 0x40c7a3