# move\_segm

Move a segment to a new address This function moves all information to the new address It fixes up address sensitive information in the kernel The total effect is equal to reloading the segment to the target address ea - any address within the segment to move to - new segment start address flags - combination MFS\_... constants returns: MOVE\_SEGM\_... error code

long move\_segm(long ea, long to, long flags);

\#define MSF\_SILENT 0x0001 // don't display a "please wait" box on the screen #define MSF\_NOFIX 0x0002 // don't call the loader to fix relocations #define MSF\_LDKEEP 0x0004 // keep the loader in the memory (optimization) #define MSF\_FIXONCE 0x0008 // valid for [rebase\_program](https://docs.hex-rays.com/9.0/developer-guide/idc/idc-api-reference/alphabetical-list-of-idc-functions/1526)(): call loader only once #define MSF\_NETDELTA 0x0010 // change inf.netdelta if possible #define MSF\_PRIORITY 0x0020 // loader segments will overwrite any existing debugger segments when moved. #define MSF\_NETNODES 0x0080 // move netnodes instead of changing inf.netdelta (this is slower)

\#define MOVE\_SEGM\_OK 0 // all ok #define MOVE\_SEGM\_PARAM -1 // The specified segment does not exist #define MOVE\_SEGM\_ROOM -2 // Not enough free room at the target address #define MOVE\_SEGM\_IDP -3 // IDP module forbids moving the segment #define MOVE\_SEGM\_CHUNK -4 // Too many chunks are defined, can't move #define MOVE\_SEGM\_LOADER -5 // The segment has been moved but the loader complained #define MOVE\_SEGM\_ODD -6 // Can't move segments by an odd number of bytes #define MOVE\_SEGM\_ORPHAN -7 // Orphan bytes hinder segment movement #define MOVE\_SEGM\_DEBUG -8 // Debugger segments cannot be moved #define MOVE\_SEGM\_SOURCEFILES -9 // Source files ranges of addresses hinder segment movement #define MOVE\_SEGM\_MAPPING -10 // Memory mapping ranges of addresses hinder segment movement #define MOVE\_SEGM\_INVAL -11 // Invalid argument (delta/target does not fit the address space)
