MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / Dump_Disassemble

Function Dump_Disassemble

Source/Debug/Dump.cpp:151–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void Dump_Disassemble(u32 start, u32 end, const char * p_file_name)
152{
153 IO::Filename file_path;
154
155 // Cute hack - if the end of the range is less than the start,
156 // assume it is a length to disassemble
157 if (end < start)
158 end = start + end;
159
160 if (p_file_name == NULL || strlen(p_file_name) == 0)
161 {
162 Dump_GetDumpDirectory(file_path, "");
163 IO::Path::Append(file_path, "dis.txt");
164 }
165 else
166 {
167 IO::Path::Assign(file_path, p_file_name);
168 }
169
170 u8 * p_base;
171 if (!Memory_GetInternalReadAddress(start, (void**)&p_base))
172 {
173 DBGConsole_Msg(0, "[Ydis: Invalid base 0x%08x]", start);
174 return;
175 }
176
177 FILE * fp( fopen(file_path, "w") );
178 if (fp == NULL)
179 return;
180
181 DBGConsole_Msg(0, "Disassembling from 0x%08x to 0x%08x ([C%s])", start, end, file_path);
182
183 const OpCode * op_start( reinterpret_cast< const OpCode * >( p_base ) );
184 const OpCode * op_end( reinterpret_cast< const OpCode * >( p_base + (end-start) ) );
185
186 Dump_DisassembleMIPSRange(fp, start, op_start, op_end);
187
188 fclose(fp);
189}
190#endif
191
192#ifndef DAEDALUS_SILENT

Callers 1

Patch_PatchAllFunction · 0.85

Calls 4

Dump_GetDumpDirectoryFunction · 0.85
AssignFunction · 0.85
AppendFunction · 0.50

Tested by

no test coverage detected