예제 #1
0
        static public IntPtr FindData(int width, int height, LibLoader2 lib, res_table tdata, ImageType tobyte)
        {
            IntPtr hImage;
            IntPtr res = FindData(lib, tdata);
            IntPtr lr  = LoadResource(lib.hModule, res);
            IntPtr lo  = LockResource(lr);

            using (Mart name = (_isint(tdata._n)) ? new Mart(_i(tdata.name), false) : new Mart(tdata.name, false, true))
            {
                if (tobyte == ImageType.bitmap)
                {
                    hImage = User32.LoadBitmap(lib.hModule, (IntPtr)name);
                }
                else if (tobyte == ImageType.srcbitmap)
                {
                    //hImage = User32.LoadBitmap(lib.hModule,(IntPtr)name);
                    hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, width, height, (uint)iflags.LR_COPYFROMRESOURCE);
                }
                else
                {
                    hImage = LoadImage(lib.hModule, (IntPtr)name, (uint)tobyte, 0, 0, (uint)iflags.LR_VGACOLOR);
                }
            }
            FreeResource(lr);
            return(hImage);
        }
예제 #2
0
        /// attempts to reverse restable to a newly found pointer
        static public IntPtr FindData(LibLoader2 lib, res_table tdata)
        {
            Mart   type, name;
            IntPtr res;

            using (type = (_isres(tdata._t)) ? new Mart(_i(tdata._t), false) : new Mart(tdata.type, false, true))
            {
                using (name = (_isint(tdata._n)) ? new Mart(_i(tdata.name), false) : new Mart(tdata.name, false, true))
                {
//				nam = _isint(tdata._n) ? "#"+tdata.name : tdata.name;
                    res = FindResource(lib.hModule, (IntPtr)name, (IntPtr)type);
//				Global.cstat(ConsoleColor.Green,"{0}:{1}",(IntPtr)type,nam);
                }
            }
            return(res);
        }
예제 #3
0
        static public byte[] FindData(LibLoader2 lib, res_table tdata, bool tobyte)
        {
            IntPtr res = FindData(lib, tdata);
            int    siz = SizeofResource(lib.hModule, res);

            byte[] newmemory = new byte[siz];
            IntPtr lr        = LoadResource(lib.hModule, res);
            IntPtr lo        = LockResource(lr);

            using (Mart newmem = new Mart(new byte[siz]))
            {
                Kernel32.CopyMemory((IntPtr)newmem, lo, siz);
                newmemory = newmem.GetByteData(siz);
            }
            FreeResource(lr);
            lr = IntPtr.Zero;
//			Global.cstat(ConsoleColor.Green,"{0}:{1}",(IntPtr)type,nam);
            return(newmemory);
        }
예제 #4
0
 public res_info(LibLoader2 lib)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public thought(LibLoader2 lib, object typ, object nam, ushort lang)
 {
     loader = lib; table = new res_table(typ, nam, lang);
 }
예제 #6
0
 public thought(LibLoader2 lib, res_table res)
 {
     loader = lib; table = res;
 }