Skip to content

Instantly share code, notes, and snippets.

@WWelna

WWelna/hard.asm Secret

Created June 21, 2023 02:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
x: ; void __cdecl x(void *, unsigned int, void *, unsigned int);
push ebp
mov ebp, esp
push edi
push esi
mov ecx, [ebp+12] ;
mov eax, [ebp+20] ;
cmp eax, ecx
jg .donejg ;
sub ecx, eax ;
xor eax, eax
.for:
push eax
push ecx
mov eax, [ebp+20] ; 1
mov ecx, [ebp+16] ; 2
mov edx, [ebp+8] ; 3
push eax
push ecx
push edx
call mycmp
add esp, 12
cmp eax, 1
jne .nada
mov eax, [ebp+8]
jmp .done
.nada:
inc dword [ebp+8]
pop ecx
pop eax
inc eax
cmp eax, ecx
jne .for
.donejg: ;
xor eax, eax ;
.done:
pop esi
pop edi
mov esp, ebp
pop ebp
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment