alloc(newmem,2048,21AF2BB0000) 
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
// DllCallAddress("uint:cdecl", DllStructGetPtr($tCodeBuffer), "ptr", DllStructGetPtr($tPixelData), "ptr", DllStructGetPtr($tStruct_ARGB), "int", $iPixels)
// ;64Bit! -> ;first 4 parameters will be saved in rcx,rdx,r8,r9
push rdi
push rsi
push rbx
push rbp

mov rsi,rcx // ;pointer to first pixel in memory from the bmp > address check $tPixelData
mov rdi,rdx // ;pointer to memory from struct                 > address save $tStruct_ARGB
mov rbx,r8 // ;amount of pixels                               > max pixel $iPixels

mov rax,[rsi] // address pixel memory xy

loop1:


cmp byte ptr [rax+0],70 // pixel xy Opt1 >= Opt2 0xFF0000
jge if01
cmp byte ptr [rax+0],FF // pixel xy Opt1 <= Opt2 0xFF0000
jle if01
cmp byte ptr [rax+1],70 // pixel xy Opt1 >= Opt2 0x00FF00
jge if01
cmp byte ptr [rax+1],FF // pixel xy Opt1 <= Opt2 0x00FF00
jle if01
cmp byte ptr [rax+2],70 // pixel xy Opt1 >= Opt2 0x0000FF
jge if01
cmp byte ptr [rax+2],FF // pixel xy Opt1 <= Opt2 0x0000FF
jle if01
mov [rdi+100],33213321
mov [rdi+200+rbx],rbx
//mov rbx,0
if01:

sub rbx,1 // for loop -1 = 0
ja loop1

pop rbp
pop rbx
pop rsi
pop rdi
ret

exit:
jmp returnhere

21AF2BB0000:
jmp newmem
nop
returnhere:

