I am trying to create a graph so that I can visualize the flow of a particular function in a game that I am interested in. I was initially using Cheat Engine to follow the flow of the function, but after going through about 20 jmps to finally get to the ret instruction, I decided to open up the executable in IDA so that I could see the graph view.
When I opened the executable in IDA, I ran into an issue where the auto-analysis gets "stuck" in a loop, never finishing.
Looking at the code, I do wonder if there is some sort of obfuscation going on, because it seems like the same thing could be coded in a far lesser number of instructions.
What should I do?
Here is an example of a piece of the code that I suspect is causing an issue (sorry if my comments don't make much sense):
cmp [rcx],rdi ; if *rcx == rdi:
cmove eax,r15d ; do eax = r15d
add rcx,08 ; rcx += 8
dec rdx ; i -= 1
mov [rsp-08],rbp ; var a = rbp
lea rsp,[rsp-08] ; rsp = &a
mov rbp,game.exe+13139A0 ; rbp = game.exe+13139A0
xchg [rsp],rbp ; swap(a, rbp) i.e.
; a = game.exe+13139A0
; rbp = rbp (original value)
lea rsp,[rsp-08] ; var b; rsp = &b
mov [rsp],rbx ; b = rbx
lea rsp,[rsp-08] ; var c; rsp = &c
mov [rsp],rax ; c = rax
mov rbx,[rsp+10] ; rbx = a
mov rax,game.exe+1313990 ; rax = game.exe+1313990
cmovne rbx,rax ; rbx = i == 0 ? rax : rbx
mov [rsp+10],rbx ; a = rbx
lea rsp,[rsp+08] ; rsp = &b
mov rax,[rsp-08] ; rax = c
mov rbx,[rsp] ; rbx = b
lea rsp,[rsp+08] ; rsp = &a
lea rsp,[rsp+08] ; rsp = &???
jmp qword ptr [rsp-08] ; jmp a i.e.
; i == 0: game.exe+1313990
; i != 0: game.exe+13139A0