Function at 0x402f20
Capabilities:
Check os version

Disassembly:
sub esp, 0x9c
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x18]
xor edi, edi
push eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edi
xor esi, esi
mov dword [esp + 0x1c], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ebp, dword [esp + 0xb0]
cmp ebp, edi
je 0x4031ff
mov eax, dword [esp + 0x28]
cmp eax, 1
jne 0x403097
lea ecx, [esp + 0x10]
push edi
push ecx
push ebp
call sub.WINSPOOL.DRV_OpenPrinterA
test eax, eax
je 0x403263
cmp dword [esp + 0x10], edi
je 0x403263
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x14]
push edx
push edi
push edi
push 2
push eax
call sub.WINSPOOL.DRV_GetPrinterA
test eax, eax
jne 0x402fc9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x402fb2
cmp dword [esp + 0x14], edi
jne 0x402fc9
mov ecx, dword [esp + 0x10]
push ecx
call sub.WINSPOOL.DRV_ClosePrinter
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
mov edx, dword [esp + 0x14]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
cmp esi, edi
jne 0x402ff3
mov eax, dword [esp + 0x10]
push eax
call sub.WINSPOOL.DRV_ClosePrinter
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ecx
push edx
push esi
push 2
push eax
call sub.WINSPOOL.DRV_GetPrinterA
test eax, eax
jne 0x40302c
mov ecx, dword [esp + 0x10]
push ecx
call sub.WINSPOOL.DRV_ClosePrinter
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
mov edx, dword [esi + 0x34]
push edi
or edx, 4
push esi
mov dword [esi + 0x34], edx
mov edx, dword [esp + 0x18]
push 2
push edx
call sub.WINSPOOL.DRV_SetPrinterA
test eax, eax
je 0x4031ee
push edi
push 0x3e8
push edi
push 0x44a3cc
push edi
push 0x1a
push 0xffff
call dword [sym.imp.USER32.dll_SendMessageTimeoutA]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x403073
push eax
call sub.WINSPOOL.DRV_ClosePrinter
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalFree]
test esi, esi
je 0x403080
push esi
call ebx
test edi, edi
je 0x403087
push edi
call ebx
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x9c
ret
cmp eax, 2
jne 0x403065
cmp dword [esp + 0x1c], 5
jb 0x403104
push 0x44a3bc
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
jne 0x4030bf
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x9c
ret
push 0x44a3a8
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x4030e3
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
push ebp
call eax
push ebx
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test ebp, ebp
jne 0x403270
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
lea ecx, [esp + 0x10]
push edi
push ecx
push ebp
call sub.WINSPOOL.DRV_OpenPrinterA
test eax, eax
je 0x403263
cmp dword [esp + 0x10], edi
je 0x403263
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x14]
push edx
push edi
push edi
push 2
push eax
call sub.WINSPOOL.DRV_GetPrinterA
test eax, eax
jne 0x403168
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x403151
cmp dword [esp + 0x14], edi
jne 0x403168
mov ecx, dword [esp + 0x10]
push ecx
call sub.WINSPOOL.DRV_ClosePrinter
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
mov edx, dword [esp + 0x14]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
cmp esi, edi
jne 0x403192
mov eax, dword [esp + 0x10]
push eax
call sub.WINSPOOL.DRV_ClosePrinter
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
push ecx
push edx
push esi
push 2
push eax
call sub.WINSPOOL.DRV_GetPrinterA
test eax, eax
je 0x403282
mov eax, dword [esi + 0x10]
cmp eax, edi
je 0x403282
cmp dword [esi + 0xc], edi
je 0x403282
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
call edi
mov ecx, dword [esi + 0xc]
mov ebx, eax
push ecx
call edi
push ebp
add ebx, eax
call edi
lea edx, [ebx + eax + 3]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
test edi, edi
jne 0x40320c
mov eax, dword [esp + 0x10]
push eax
call sub.WINSPOOL.DRV_ClosePrinter
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x44a3a4
push edi
call ebx
mov ecx, dword [esi + 0x10]
push ecx
push edi
call ebx
push 0x44a3a4
push edi
call ebx
mov edx, dword [esi + 0xc]
push edx
push edi
call ebx
push edi
push 0x44a39c
push 0x44a3cc
call dword [sym.imp.KERNEL32.dll_WriteProfileStringA]
test eax, eax
jne 0x403270
mov eax, dword [esp + 0x10]
push eax
call sub.WINSPOOL.DRV_ClosePrinter
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call esi
push edi
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret
push 0
push 0x3e8
push 0
push 0
push 0
jmp 0x403058
mov ecx, dword [esp + 0x10]
push ecx
call sub.WINSPOOL.DRV_ClosePrinter
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9c
ret