MCPcopy Create free account
hub / github.com/d35ha/CallObfuscator / ini_line_handler

Function ini_line_handler

cli/cli.cpp:13–42  ·  view source on GitHub ↗

Processed line handler.

Source from the content-addressed store, hash-verified

11
12// Processed line handler.
13void ini_line_handler(void* data, unsigned int line, const char* sec, const char* nam, const char* val)
14{
15 // Cast the needed pointer.
16 cobf* p_obf_file = (cobf*)data;
17 cobf_error ret_err;
18 char error[MAX_PATH];
19
20 // Saving the old section.
21 static string s_sec = "";
22 if (sec)
23 {
24 // Get the dll name.
25 s_sec = sec;
26 return;
27 };
28
29 // Name/ordinals checking.
30 if (*nam != '#' && *val != '#') ret_err = p_obf_file->obf_sym(s_sec.c_str(), nam, val);
31 else if (*nam != '#' && *val == '#') ret_err = p_obf_file->obf_sym(s_sec.c_str(), nam, atoi(val + 1));
32 else if (*nam == '#' && *val != '#') ret_err = p_obf_file->obf_sym(s_sec.c_str(), atoi(nam + 1), val);
33 else ret_err = p_obf_file->obf_sym(s_sec.c_str(), atoi(nam + 1), atoi(val + 1));
34
35 // Check the error.
36 if (ret_err != cobf_error::COBF_NO_ERROR)
37 {
38 // Error at processing.
39 cobf_format_message(ret_err, error, sizeof(error));
40 cout << "[-] Error at the config at line " << line << ": " << error << endl;
41 };
42};
43
44// The main entry.
45int main(int argc, char** argv)

Callers

nothing calls this directly

Calls 2

cobf_format_messageFunction · 0.85
obf_symMethod · 0.80

Tested by

no test coverage detected