does anybody here remember how to make a jump talbe? becouse i have forgot it.

Thanks
Posted on 2005-01-01 04:05:44 by Ateneo



Jump_table dd offset Routine_1
dd offset Routine_2
dd offset Routine_3 ;etc.....

routine_num dd 0

lea esi,Jump_table
mov eax,routine_num
; then call or jump
call dword ptr[esi+(eax*4)]
; jmp dword ptr[esi+(eax*4)]


Routine_1:
; your code
ret
Routine_2:
; your code
ret
Routine_3:
; your code
ret
Posted on 2005-01-01 07:45:41 by Siekmanski
thanks!! :)
Posted on 2005-01-01 12:30:32 by Ateneo
Also check out BitRake's JumpTable Macro here
Posted on 2005-01-01 13:46:07 by JimmyClif