This ia32 ASM code is from apache project and it's used for JNI calls. How can I analyze where to pass the arguments in this code?
My target is to add some code in it for the condition that the parameter number is 0.
For JNI, there're env argument at least, this code is correct. But I want to use the code for other thing, in that case, there're not env arguments. Does anybody knows how to add a "if (0 arguments) {do not push arguments} else {push arguments}" judgment?
invokeNative:
    push    %ebp
    movl    %esp, %ebp
    push    %ecx
    movl    8(%ebp), %eax
    movl    12(%ebp), %ecx
    leal    -4(%eax,%ecx,4), %eax
    subl    %esp, %eax
1:
    push    0(%esp,%eax)
    loop 1b
    movl    -4(%ebp), %ecx
    movl    16(%ebp), %eax
    call    *%eax
    leave
    ret
 
    