summaryrefslogtreecommitdiff
path: root/spell.zig
blob: 5439a6cdc8da8a3326f8420272b29f50ee9532dc (plain) (blame)
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
const std = @import("std");
const config = @import("config");
const cs = @import("capstone");
const elfo = @import("./src/elfo.zig");

var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
const alloc = gpa.allocator();

// FIXME: call capstone on the sections
// FIXME: missing reading the elf sections

pub fn main() !void {
    std.debug.print("abracadabra! -> {s}\n", .{config.vessel});
    // std.debug.print("abracadabra! -> {x} {s}\n", .{ config.vessel_contents, config.vessel });

    var child = std.process.Child.init(&.{config.vessel}, alloc);
    try child.spawn();
    child.stdin_behavior = .Pipe;
    child.stdout_behavior = .Pipe;
    child.stderr_behavior = .Pipe;

    // var buf: [8]u8 = undefined;

    // const bytes = try child.stdout.?.read(&buf);
    // std.debug.print("stdout {x}\n", .{bytes});

    _ = try child.wait();
}