Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.60 KB | None | 0 0
  1. [RAPass::BuildCFG]
  2.   L0: void Func(i32@ecx %0, f32@[0] %1, f64@[4] %2)
  3.   {#0}
  4.     mov %4, 0
  5.     mov qword [&%3+%4], %0
  6.     add %4, 8
  7.     movq qword [&%3+%4], %1
  8.     add %4, 8
  9.     movq qword [&%3+%4], %2
  10.     add %4, 8
  11.     lea argStruct, [&%3]
  12.     mov %6, 3
  13.     mov dword [esp], argStruct
  14.     mov dword [esp+4], %6@gpd
  15.     call A30366
  16.     mov orig_ptr, 116EF50
  17.     mov orig_ptr, [orig_ptr]
  18.     vmovss dword [esp], %1
  19.     vmovlps qword [esp+4], %2
  20.     call orig_ptr
  21.     sub esp, C
  22.   {#1}
  23.   L1:
  24.     [FuncEnd]
  25. [RAPass::BuildViews]
  26. [RAPass::BuildDominators]
  27.   IDom of #1 -> #0
  28.   Done (2 iterations)
  29. [RAPass::BuildLiveness]
  30.   LiveIn/Out Done (4 visits)
  31.   {#0}
  32.     IN   [%0, %1, %2]
  33.     GEN  [%4, %0, %1, %2, argStruct, %6, orig_ptr]
  34.     KILL [%4, argStruct, %6, orig_ptr]
  35.   {#1}
  36.   %4        {id:0260 width: 12   freq: 0.5833 priority=0.5933}: [3:15]
  37.   %3        {id:0259 width: 0    freq: 0.0000 priority=0.0100}:
  38.   %0        {id:0256 width: 33   freq: 0.0606 priority=0.0706}: [2:35]
  39.   %1        {id:0257 width: 29   freq: 0.0690 priority=0.0790}: [2:31]
  40.   %2        {id:0258 width: 31   freq: 0.0645 priority=0.0745}: [2:33]
  41.   argStruct {id:0261 width: 4    freq: 0.5000 priority=0.5100}: [17:21]
  42.   %6        {id:0262 width: 4    freq: 0.5000 priority=0.5100}: [19:23]
  43.   orig_ptr  {id:0263 width: 8    freq: 0.3750 priority=0.3850}: [27:35]
  44. [RAPass::BinPack] Available=7 (0x000000EF) Count=6
  45.   00: [3:15@260], [17:21@261], [27:35@263]
  46.   01: [2:35@256]
  47.   02: [19:23@262]
  48.   Completed.
  49. [RAPass::BinPack] Available=8 (0x000000FF) Count=2
  50.   00: [2:31@257]
  51.   01: [2:33@258]
  52.   Completed.
  53. [RAPass::Rewrite]
  54. .section .text {#0}
  55. L0:
  56. sub esp, 24                                 ; 83EC24
  57. movd xmm0, dword [esp+0x28]                 ; 660F6E442428
  58. movq xmm1, qword [esp+0x2C]                 ; F30F7E4C242C
  59. mov eax, 0                                  ; B800000000              | <00002> mov %4, 0                        | %4{W|Out}
  60. mov qword [esp+eax+0xC], ecx                ; 894C040C                | <00004> mov qword [&%3+%4], %0           | %4{R|Use} %0{R|Use}
  61. add eax, 8                                  ; 83C008                  | <00006> add %4, 8                        | %4{X|Use}
  62. movq qword [esp+eax+0xC], xmm0              ; 660FD644040C            | <00008> movq qword [&%3+%4], %1          | %4{R|Use} %1{R|Use}
  63. add eax, 8                                  ; 83C008                  | <00010> add %4, 8                        | %4{X|Use}
  64. movq qword [esp+eax+0xC], xmm1              ; 660FD64C040C            | <00012> movq qword [&%3+%4], %2          | %4{R|Use} %2{R|Use}
  65. add eax, 8                                  ; 83C008                  | <00014> add %4, 8                        | %4{X|Use|Last|Kill}
  66. lea eax, [esp+0xC]                          ; 8D44240C                | <00016> lea argStruct, [&%3]             | argStruct{W|Out}
  67. mov dl, 3                                   ; B203                    | <00018> mov %6, 3                        | %6{W|Out}
  68. mov dword [esp], eax                        ; 890424                  | <00020> mov dword [esp], argStruct       | argStruct{R|Use|Last|Kill}
  69. mov dword [esp+4], edx                      ; 89542404                | <00022> mov dword [esp+4], %6@gpd        | %6{R|Use|Last|Kill}
  70. call A30366                                 ; E800000000              | <00024> call A30366
  71. mov eax, 116EF50                            ; B850EF1601              | <00026> mov orig_ptr, 116EF50            | orig_ptr{W|Out}
  72. mov eax, [eax]                              ; 8B00                    | <00028> mov orig_ptr, [orig_ptr]         | orig_ptr{X|Use|Out}
  73. vmovss dword [esp], xmm0                    ; C5FA110424              | <00030> vmovss dword [esp], %1           | %1{R|Use|Last|Kill}
  74. vmovlps qword [esp+4], xmm1                 ; C5F8134C2404            | <00032> vmovlps qword [esp+4], %2        | %2{R|Use|Last|Kill}
  75. call eax                                    ; FFD0                    | <00034> call orig_ptr                    | orig_ptr{R|Use|Last|Kill} %0{R|Use=1|Last|Kill}
  76. sub esp, C                                  ; 83EC0C                  | <00036> sub esp, C
  77. L1:                                         ;                         | L1:
  78. add esp, 24                                 ; 83C424
  79. ret C                                       ; C20C00
  80.  
  81.     asmjit::x86::Gp orig_ptr = cc.newUIntPtr("orig_ptr");
  82.     cc.mov(orig_ptr, (uintptr_t)getTrampolineHolder());
  83.     cc.mov(orig_ptr, asmjit::x86::ptr(orig_ptr));
  84.  
  85.     auto orig_call = cc.call(orig_ptr, sig);
  86.     for (uint8_t arg_idx = 0; arg_idx < sig.argCount(); arg_idx++) {
  87.         orig_call->setArg(arg_idx, argRegisters.at(arg_idx));
  88.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement