Function at 0x402650
Capabilities:
Get common file path

Disassembly:
mov eax, 0x1340
call fcn.0040ac50
push ebx
push ebp
push esi
lea eax, [esp + 0x14]
push edi
lea ecx, [esp + 0x10]
xor esi, esi
push eax
push ecx
push esi
push esi
push 4
push esi
push 6
mov dword [esp + 0x30], esi
xor ebx, ebx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x34], esi
call sub.WINSPOOL.DRV_EnumPrintersA
test eax, eax
jne 0x4026dc
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
call ebp
cmp eax, 0x7a
jne 0x4026b3
cmp ebx, esi
je 0x4026a6
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [esp + 0x10]
push edx
push 0x40
call edi
mov ebx, eax
jmp 0x4026be
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x18]
lea ecx, [esp + 0x10]
push eax
push ecx
push edx
push ebx
push 4
push esi
push 6
call sub.WINSPOOL.DRV_EnumPrintersA
test eax, eax
je 0x402694
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x22d]
mov byte [esp + 0x22c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x2d]
mov byte [esp + 0x2c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x408
xor eax, eax
lea edi, [esp + 0x32d]
mov byte [esp + 0x32c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0x12d]
mov byte [esp + 0x12c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x12c]
push 0xff
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea ecx, [esp + 0x12c]
push ecx
push str._s_spoolPRINTERS_
push 0x412c44
call dword [sym.imp.MSVCRT.dll_sprintf]
push 0x412c44
push str.DefaultSpoolDirectory
push str.SYSTEMCurrentControlSetControlPrintPrinters
call fcn.00401f00
mov eax, dword [esp + 0x30]
add esp, 0x18
cmp eax, esi
mov dword [esp + 0x1c], esi
jle 0x4028e5
mov ebp, ebx
or ecx, 0xffffffff
mov edi, str.SYSTEMCurrentControlSetControlPrintPrinters_
xor eax, eax
lea edx, [esp + 0x22c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x412c44
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x30]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push str.SpoolDirectory
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x234]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x34]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x34]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.00401fd0
xor ecx, ecx
add esp, 0xc
mov dword [esp + 0x20], ecx
lea edx, [esp + 0x20]
mov dword [esp + 0x24], ecx
lea eax, [esp + 0x14]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x28], 0xf000c
mov ecx, dword [ebp]
push edx
push eax
push ecx
call sub.WINSPOOL.DRV_OpenPrinterA
test eax, eax
je 0x4028cd
mov edx, dword [esp + 0x14]
push edx
call fcn.00402610
add esp, 4
test eax, eax
je 0x4028cd
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x330]
push 0x1024
push ecx
push 2
push edx
call sub.WINSPOOL.DRV_GetPrinterA
test eax, eax
je 0x4028c2
test byte [esp + 0x360], 2
mov eax, dword [esp + 0x360]
jne 0x4028a0
test ah, 1
jne 0x4028c2
mov ecx, dword [esp + 0x14]
and al, 0xfd
or ah, 1
push 0
mov dword [esp + 0x364], eax
lea eax, [esp + 0x330]
push eax
push 2
push ecx
call sub.WINSPOOL.DRV_SetPrinterA
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
inc eax
add ebp, 0xc
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x402796
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1340
ret