View Single Post
  #6  
Old 01-05-2022, 17:42
DavidXanatos DavidXanatos is offline
Family
 
Join Date: Jun 2018
Posts: 169
Rept. Given: 2
Rept. Rcvd 41 Times in 28 Posts
Thanks Given: 54
Thanks Rcvd at 317 Times in 107 Posts
DavidXanatos Reputation: 41
I have created a other test, where with a global variable i can toggle between the c and the asm version thats how it looks in code
Code:
.text:000000014001C66A                 mov     eax, cs:g_test
.text:000000014001C670                 mov     rcx, [rcx+18h]
.text:000000014001C674                 test    eax, eax
.text:000000014001C676                 jnz     Sbie_InvokeSyscall5_asm
.text:000000014001C67C                 jmp     Sbie_InvokeSyscall5
The dispatch function is compiled with optimization and as it does not need local variables the compiler optimized the calls away.
I checked again that Sbie_InvokeSyscall5_asm and Sbie_InvokeSyscall5 are binary same, and they are.
Still toggling the variable breaks 32 bit apps.

At this point its just wired, I mean the "calling" convention is the same and the functions are the same yet the result is not, WTF :/
Reply With Quote