Question: Hi I need to convert the following into C code. The following is the gdb output for ex3: 0x40079a mov $0x0, %eax 0x40079f jmp 0x4007bc
Hi I need to convert the following into C code. The following is the gdb output for ex3:
0x40079a
mov $0x0, %eax
0x40079f
jmp 0x4007bc 
0x4007a1
movslq %eax, %rcx
0x4007a4
lea (%rdi, %rcx, 1), %r8
0x4007a8
movzbl (%r8), %r9d0x10(%rsp)
0x4007ac
add %rsi, %rcx, 0x18(%rsp)
0x4007af
movzbl (%rcx), %r10d
0x4007b3
mov %r10b, (%r8)
0x4007b6
mov %r9b, (%rcx)
0x4007b9
add $0x1, %eax
0x4007bc
cmp %edx, %eax
0x4007be
jl 0x4007a1 
0x4007c0
repz retq
The code should be converted into the function
void ex3 () {}
where void should be replaced by int or other comparable data type and parameters should be inferred from the assembly, Please only answer if you know assembly, do not copy and paste the code I gave.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
