Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- searchstr:
- ;BC points to input file
- ;IX points to malware code
- ;HL is the size of the file
- ;DE is the size of the malware code
- ;Output: nz if no match, else z. HL points to match+1
- or a
- sbc hl,de
- ret c
- ;swap HL and BC
- ld a,b
- ld b,h
- ld h,a
- ld a,c
- ld c,l
- ld l,a
- ;reformat counter DE
- dec de
- inc e
- inc d
- ;begin search
- loop0:
- ld a,(ix)
- cpir
- ret nz
- jp po,compare
- push hl
- push de
- push ix
- call compare
- pop ix
- pop de
- pop hl
- ret z
- jp loop0
- compare:
- inc ix
- ld a,(ix)
- cp (hl)
- ret nz
- inc hl
- dec e
- jp nz,compare
- dec d
- jr nz,compare
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement