Function at 0x4052c0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x425306
mov eax, dword fs:[0]
push eax
sub esp, 0x16c
mov eax, dword [0x443624]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x108]
push eax
push 0
mov dword [ebp - 0x10c], ebx
mov dword [ebp - 0x120], ebx
mov dword [ebp - 0x108], 0
call sub.WINSPOOL.DRV_Ordinal_203
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call edi
mov ecx, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x34], ecx
mov cl, byte [ebp - 0xf9]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x98]
mov byte [ebp - 0x30], cl
lea ecx, [ebp - 0x38]
push eax
mov dword [ebp - 0x38], vtable.std::_Func_impl_no_alloc_class_std::_Binder_struct_std::_Unforced__int____stdcall___void___unsigned_long_int__void____void___int__struct_std::_Ph_1__const____int__wchar_t__.0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x74], 0
call fcn.00407920
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x74], eax
test ecx, ecx
je 0x40537c
mov edx, dword [ecx]
lea eax, [ebp - 0x38]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x70], 0
mov dword [ebp - 4], 0
test ecx, ecx
je 0x4053a6
mov edx, dword [ecx]
lea eax, [ebp - 0x38]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [ebp - 0x14], 0
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x7a
jne 0x40542b
mov eax, dword [ebp - 0x108]
add eax, eax
push eax
push 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x70]
mov byte [ebp - 4], 1
mov dword [ebp - 0x70], eax
test ecx, ecx
je 0x4053f5
mov dword [ebp - 0x118], ecx
mov ecx, dword [ebp - 0x74]
test ecx, ecx
je 0x4057f7
mov eax, dword [ecx]
lea edx, [ebp - 0x118]
push edx
call dword [eax + 8]
mov eax, dword [ebp - 0x70]
mov byte [ebp - 4], 0
test eax, eax
jne 0x40540c
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
jmp 0x405797
lea ecx, [ebp - 0x108]
push ecx
push eax
call sub.WINSPOOL.DRV_Ordinal_203
test eax, eax
jne 0x40542b
call esi
cmp eax, 2
je 0x40542b
xor ebx, ebx
jmp 0x405797
lea eax, [ebp - 0x54]
mov dword [ebp - 0x114], 0
push eax
lea eax, [ebp - 0x114]
mov dword [ebp - 0x54], 0x40fd38
push eax
mov dword [ebp - 0x4c], 2
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 2
call fcn.00401900
add esp, 8
mov dword [ebp - 0x11c], eax
lea eax, [ebp - 0x11c]
lea ecx, [ebp - 0xc8]
push eax
call fcn.004011f0
mov eax, dword [ebp - 0xa0]
mov byte [ebp - 4], 4
test eax, eax
je 0x405506
mov ecx, dword [ebp - 0x114]
test ecx, ecx
je 0x405506
imul ecx, ecx, 0x54
mov ebx, eax
mov dword [ebp - 0x104], ecx
lea esi, [eax + ecx]
cmp ebx, esi
je 0x4054d5
mov edi, dword [sym.imp.SHLWAPI.dll_StrCmpIW]
lea esp, [esp]
mov eax, dword [ebp - 0x10c]
push dword [eax + 0x14]
push dword [ebx + 0x10]
call edi
test eax, eax
je 0x4054c9
add ebx, 0x54
cmp ebx, esi
jne 0x4054b0
mov eax, dword [ebp - 0xa0]
mov ecx, dword [ebp - 0x104]
test ebx, ebx
je 0x4054fa
add eax, ecx
cmp ebx, eax
je 0x4054fa
push 0x70a
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [ebx + 0x48]
shr ebx, 2
not ebx
and ebx, 1
jmp 0x40578c
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [ebp - 0x10c]
mov ecx, 0x54
lea eax, [ebp - 0x178]
mov byte [eax], 0
lea eax, [eax + 1]
sub ecx, 1
jne 0x405511
mov dword [ebp - 0x150], str.NT_EMF_1.006
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x168], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x16c], eax
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x174], eax
lea eax, [ebp - 0x178]
push eax
push 2
push ecx
mov dword [ebp - 0x154], str.WinPrint
mov dword [ebp - 0x144], 0x41
call sub.WINSPOOL.DRV_AddPrinterW
mov edi, eax
test edi, edi
jne 0x405582
call esi
cmp eax, 0x70a
jne 0x40557b
lea ebx, [edi + 1]
jmp 0x40578c
xor ebx, ebx
jmp 0x40578c
push sub.WINSPOOL.DRV_ClosePrinter
push edi
lea ecx, [ebp - 0x124]
call fcn.004013b0
lea eax, [ebp - 0x100]
mov dword [ebp - 0x110], 1
push eax
push 0
push 0
lea eax, [ebp - 0x110]
mov dword [ebp - 0x100], 0
push eax
push str.DefaultSpoolDirectory
push edi
call sub.WINSPOOL.DRV_GetPrinterDataW
cmp eax, 0xea
je 0x4055d2
xor esi, esi
jmp 0x4056e5
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call esi
mov ecx, dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0x100]
mov dword [ebp - 0x64], ecx
mov cl, byte [ebp - 0xf9]
mov dword [ebp - 0x58], eax
lea eax, [ebp - 0x68]
push 8
mov dword [ebp - 0x68], vtable.std::_Func_impl_no_alloc_class_std::_Binder_struct_std::_Unforced__int____stdcall___void___unsigned_long_int__void____void___int__struct_std::_Ph_1__const____int__void__.0
mov byte [ebp - 0x60], cl
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x44], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [ebp - 0x44]
mov esi, eax
mov dword [ebp - 0x1c], 0
test ecx, ecx
je 0x405659
lea eax, [ebp - 0x68]
cmp ecx, eax
jne 0x405651
mov eax, dword [ecx]
lea edx, [ebp - 0x40]
push edx
call dword [eax + 4]
mov ecx, dword [ebp - 0x44]
mov dword [ebp - 0x1c], eax
test ecx, ecx
je 0x405659
mov edx, dword [ecx]
lea eax, [ebp - 0x68]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
jmp 0x405654
mov dword [ebp - 0x1c], ecx
xor ecx, ecx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x18], esi
test ecx, ecx
je 0x40567b
mov edx, dword [ecx]
lea eax, [ebp - 0x68]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0x44], 0
test esi, esi
jne 0x405693
mov edi, dword [sym.imp.KERNEL32.dll_SetLastError]
push 0xe
call edi
lea ecx, [ebp - 0x40]
call fcn.00402550
jmp 0x4056eb
lea eax, [ebp - 0x100]
push eax
push dword [ebp - 0x100]
lea eax, [ebp - 0x110]
push esi
push eax
push str.DefaultSpoolDirectory
push edi
call sub.WINSPOOL.DRV_GetPrinterDataW
test eax, eax
je 0x4056c3
lea ecx, [ebp - 0x40]
call fcn.00402550
xor esi, esi
jmp 0x4056e5
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0x1c]
test ecx, ecx
je 0x4056e5
mov edx, dword [ecx]
lea eax, [ebp - 0x40]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [ebp - 0x104]
mov dword [ebp - 0x104], esi
push eax
lea ecx, [ebp - 0xf8]
call fcn.004012a0
mov eax, dword [ebp - 0xd0]
test eax, eax
je 0x405754
cmp dword [ebp - 0x110], 1
jne 0x405754
push dword [ebp - 0x100]
lea ecx, [ebp - 0xf9]
push eax
push dword [ebx + 0x18]
call fcn.004026d0
push eax
call edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ebx, ebx
test eax, eax
sete bl
test eax, eax
jne 0x405756
mov eax, dword [ebp - 0x70]
test eax, eax
je 0x405756
cmp word [eax], 0
je 0x405756
push eax
call sub.WINSPOOL.DRV_Ordinal_204
jmp 0x405756
xor ebx, ebx
lea ecx, [ebp - 0xf8]
call fcn.00402430
mov esi, dword [ebp - 0x120]
test esi, esi
je 0x40578c
or edi, 0xffffffff
mov eax, edi
lock xadd dword [esi + 4], eax
jne 0x40578c
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], edi
dec edi
jne 0x40578c
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lea ecx, [ebp - 0xc8]
call fcn.00402430
mov eax, dword [ebp - 0x70]
mov dword [ebp - 4], 0xa
test eax, eax
je 0x4057be
mov ecx, dword [ebp - 0x74]
mov dword [ebp - 0x104], eax
test ecx, ecx
je 0x4057fc
mov eax, dword [ecx]
lea edx, [ebp - 0x104]
push edx
call dword [eax + 8]
mov ecx, dword [ebp - 0x74]
test ecx, ecx
je 0x4057d9
mov esi, dword [ecx]
lea eax, [ebp - 0x98]
cmp ecx, eax
setne dl
movzx edx, dl
push edx
call dword [esi + 0x10]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00411faa
mov esp, ebp
pop ebp
ret
call fcn.00411cb0
call fcn.00411cb0
int3