Skip to content

Commit

Permalink
Fix Michaelsoft Binbows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
condret committed Dec 7, 2024
1 parent 6aeca9d commit dc2642c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions libr/core/dmh_windows.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static bool GetHeapGlobalsOffset(RDebug *dbg, HANDLE h_proc) {
return false;
}
bool doopen = lastNdtllAddr != map->addr;
char *ntdllopen = dbg->coreb.cmdstrf (dbg->coreb.core, "ob~%s", ntdll);
char *ntdllopen = dbg->coreb.cmdStrF (dbg->coreb.core, "ob~%s", ntdll);
if (*ntdllopen) {
char *save_ptr = NULL;
char *saddr = r_str_tok_r (ntdllopen, " ", &save_ptr);
Expand All @@ -284,7 +284,7 @@ static bool GetHeapGlobalsOffset(RDebug *dbg, HANDLE h_proc) {
if (doopen) {
// Close to reopen at the right address
int fd = atoi (ntdllopen);
dbg->coreb.cmdstrf (dbg->coreb.core, "o-%d", fd);
dbg->coreb.cmdStrF (dbg->coreb.core, "o-%d", fd);
RtlpHpHeapGlobalsOffset = RtlpLFHKeyOffset = 0;
}
}
Expand All @@ -299,12 +299,12 @@ static bool GetHeapGlobalsOffset(RDebug *dbg, HANDLE h_proc) {
r_list_free (modules);

if (!RtlpHpHeapGlobalsOffset || !RtlpLFHKeyOffset) {
char *res = dbg->coreb.cmdstrf (dbg->coreb.core, "idpi~RtlpHpHeapGlobals");
char *res = dbg->coreb.cmdStrF (dbg->coreb.core, "idpi~RtlpHpHeapGlobals");
if (!*res) {
// Try downloading the pdb
free (res);
dbg->coreb.cmd (dbg->coreb.core, "idpd");
res = dbg->coreb.cmdstrf (dbg->coreb.core, "idpi~RtlpHpHeapGlobals");
res = dbg->coreb.cmdStrF (dbg->coreb.core, "idpi~RtlpHpHeapGlobals");
}
if (*res) {
RtlpHpHeapGlobalsOffset = r_num_math (NULL, res);
Expand All @@ -313,7 +313,7 @@ static bool GetHeapGlobalsOffset(RDebug *dbg, HANDLE h_proc) {
return false;
}
free (res);
res = dbg->coreb.cmdstrf (dbg->coreb.core, "idpi~RtlpLFHKey");
res = dbg->coreb.cmdStrF (dbg->coreb.core, "idpi~RtlpLFHKey");
if (*res) {
RtlpLFHKeyOffset = r_num_math (NULL, res);
}
Expand All @@ -322,7 +322,7 @@ static bool GetHeapGlobalsOffset(RDebug *dbg, HANDLE h_proc) {

if (doopen) {
// Close ntdll.dll
char *res = dbg->coreb.cmdstrf (dbg->coreb.core, "o~%s", ntdll);
char *res = dbg->coreb.cmdStrF (dbg->coreb.core, "o~%s", ntdll);
int fd = atoi (res);
free (res);
dbg->coreb.cmdf (dbg->coreb.core, "o-%d", fd);
Expand Down
6 changes: 3 additions & 3 deletions libr/debug/p/debug_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,16 @@ static RDebugReasonType r_debug_native_wait(RDebug *dbg, int pid) {

/* Check if autoload PDB is set, and load PDB information if yes */
RCore *core = dbg->coreb.core;
bool autoload_pdb = dbg->coreb.cfggeti (core, "pdb.autoload");
bool autoload_pdb = dbg->coreb.cfgGetI (core, "pdb.autoload");
if (autoload_pdb) {
PLIB_ITEM lib = r->lib;
#if 0
dbg->coreb.cmdf (core, "\"o \\\"%s\\\" 0x%p\"", lib->Path, lib->BaseOfDll);
char *o_res = dbg->coreb.cmdstrf (core, "o~+%s", lib->Name);
char *o_res = dbg->coreb.cmdStrF (core, "o~+%s", lib->Name);
int fd = atoi (o_res);
free (o_res);
if (fd) {
char *pdb_file = dbg->coreb.cmdstr (core, "i~dbg_file");
char *pdb_file = dbg->coreb.cmdStr (core, "i~dbg_file");
if (pdb_file && (r_str_trim (pdb_file), *pdb_file)) {
if (!r_file_exists (pdb_file + 9)) {
#else
Expand Down
4 changes: 2 additions & 2 deletions libr/debug/p/native/windows/windows_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ bool w32_select(RDebug *dbg, int pid, int tid) {
}
}

if (dbg->coreb.cfggeti (dbg->coreb.core, "dbg.threads")) {
if (dbg->coreb.cfgGetI (dbg->coreb.core, "dbg.threads")) {
// Suspend all other threads
r_list_foreach (dbg->threads, it, th) {
if (!th->bFinished && !th->bSuspended && th->tid != selected) {
Expand Down Expand Up @@ -688,7 +688,7 @@ int w32_kill(RDebug *dbg, int pid, int tid, int sig) {
void w32_break_process(void *user) {
RDebug *dbg = (RDebug *)user;
RW32Dw *wrap = dbg->user;
if (dbg->coreb.cfggeti (dbg->coreb.core, "dbg.threads")) {
if (dbg->coreb.cfgGetI (dbg->coreb.core, "dbg.threads")) {
w32_select (dbg, wrap->pi.dwProcessId, -1); // Suspend all threads
} else {
if (!r_w32_DebugBreakProcess (wrap->pi.hProcess)) {
Expand Down
2 changes: 1 addition & 1 deletion libr/debug/p/native/windows/windows_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static ut64 __get_dispatchmessage_offset(RDebug *dbg) {
if (!found) {
return 0;
}
char *res = dbg->coreb.cmdstr (dbg->coreb.core, "f~DispatchMessageW");
char *res = dbg->coreb.cmdStr (dbg->coreb.core, "f~DispatchMessageW");
if (!*res) {
free (res);
return 0;
Expand Down

0 comments on commit dc2642c

Please sign in to comment.