'im trying to make a window hook in python 3.8.10

im trying to make a simulation of a troijan called "memz troijan destructive" and the problem is in the playload.

heres a bit of my playload code

from win32gui import *
from win32ui import *
from win32api import *
import time

hwnd = GetDesktopWindow( )
hdc2 = GetWindowDC(0)
x2 = GetSystemMetrics(0)
y2 = GetSystemMetrics(0)

def tunnel_effect():
    for i in range(0, 50):
        StretchBlt(hdc2, 25, 25, x2 - 50, y2 - 50, hdc2, 0, 0, x2, 0x00CC002)
        
def paintinvert():
    for i in range(0, 7):
        PatBlt(hdc2, 0, 0, x2, y2, 589313)
        time.sleep(2)



tunnel_effect()
paintinvert()

and heres the result

line 13, in tunnel_effect
    StretchBlt(hdc2, 25, 25, x2 - 50, y2 - 50, hdc2, 0, 0, x2, 0x00CC002)
TypeError: StretchBlt() takes exactly 11 arguments (10 given)

is there an argument that i am missing?



Solution 1:[1]

yes, you need 11 args.
please refer to the MS docs: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-stretchblt

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Beliaev Maksim