u@home:~$

  • 在Qemu sparc64虚拟机上验证了下

    还要先看sparc上的strcmp实现,这个还是关键。 sparc上没有新的SIMD向量指令,还是v9指令集。 Ghidra不知道是不是逆sparc还有点问题,好像跳转逆的位置有不对的地方。 这段代码看的我恍恍惚惚。。。 看UltraSPARC Architecture 2005,对指令和寄存器先有个大概的了解,寄存器窗口啥的。 sparc上的strcmp确实实现的比较怪,但大概知道了比较两个寄存器内容是用xor指令,两个寄存器值相等,xor的结果就是0。 ************************************************************** * FUNCTION * ************************************************************** int __stdcall strcmp(char * __s1, char * __s2) int o0:4 <RETURN> char * o0:8 __s1 char * o1:8 __s2 strcmp XREF[127]: Entry Point(*), FUN_00124074:0012429c(c), FUN_00124074:001242b8(c), FUN_00124074:001242e0(c), FUN_00124074:001242fc(c), FUN_00124074:0012436c(c), FUN_00124074:001243e8(c), FUN_00124b90:00124dfc(c), FUN_00124b90:00124e18(c), FUN_00124b90:00124e34(c), FUN_00124b90:00124e50(c), FUN_00124f38:00124f68(c), FUN_00124f38:00124fa4(c), FUN_00124f38:00124fcc(c), FUN_00124f38:00124fe4(c),...

  • Qemu Sparc64

    想先在Sparc虚拟机上装ubuntu,发现qemu模拟sparc还要麻烦些。 像装x86系统那样装sparc版的ubuntu,卡在了load kernel上。 在qemu手册上找到了模拟sparc的方法。 Sparc64 System emulator Use the executable qemu-system-sparc64 to simulate a Sun4u (UltraSPARC PC-like machine), Sun4v (T1 PC-like machine), or generic Niagara (T1) machine. The Sun4u emulator is mostly complete, being able to run Linux, NetBSD and OpenBSD in headless (-nographic) mode. The Sun4v emulator is still...

  • strcmp in Linux

    (gdb) disassemble Dump of assembler code for function __strcmp_avx2: => 0x00007ffff7f30ae0 <+0>: endbr64 0x00007ffff7f30ae4 <+4>: mov %edi,%eax 0x00007ffff7f30ae6 <+6>: xor %edx,%edx 0x00007ffff7f30ae8 <+8>: vpxor %ymm7,%ymm7,%ymm7 0x00007ffff7f30aec <+12>: or %esi,%eax 0x00007ffff7f30aee <+14>: and $0xfff,%eax 0x00007ffff7f30af3 <+19>: cmp $0xf80,%eax 0x00007ffff7f30af8 <+24>: jg 0x7ffff7f30e50 <__strcmp_avx2+880> 0x00007ffff7f30afe <+30>: vmovdqu (%rdi),%ymm1 0x00007ffff7f30b02 <+34>: vpcmpeqb (%rsi),%ymm1,%ymm0...