All files / src/components/Functions Functions.jsx

78.84% Statements 41/52
75% Branches 3/4
50% Functions 1/2
78.84% Lines 41/52

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 531x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 7x 7x 7x                   7x 7x 7x     7x 7x 7x 7x 7x 7x 7x 7x 70x 7x 7x 7x 7x 7x 1x 1x  
import React, { useEffect } from "react";
import { DataState } from "./../../context/DataContext";
import "./Functions.css";
import axios from "axios";
 
const data = [
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
  "sub.KERNEL32.dll_DeleteCritical_231",
];
 
const Functions = () => {
  const { refresh, functions, setFunctions } = DataState();
 
  const fetchFunctionsData = async () => {
    try {
      const data = await axios.post("http://127.0.0.1:10000/get_locals", {
        name: "program",
      });
      setFunctions(data.data.result);
    } catch (error) {
      console.error("Error fetching functions:", error);
    }
  };
 
  useEffect(() => {
    if (refresh) {
      fetchFunctionsData();
    }
  }, [refresh]);
 
  return (
    <div className="functions-parent">
      <span className="functions-heading">Functions</span>
      <div className="functions">
        {functions}
        {data.map((obj, index) => (
          <a key={index}>{obj}</a>
        ))}
      </div>
    </div>
  );
};
 
export default Functions;