Example #1
0
        private void BTN_ComboUpdate_Click(object sender, EventArgs e)
        {
            int  index         = LST_Combo_Data.SelectedIndices[0];
            byte Sel_ComboFunc = byte.Parse(LST_Combo_Data.Items[index].SubItems[1].Text);
            byte Sel_PItem     = LIB_ITEM.BIO3_ITEM_LUT_INVERSE[LST_Combo_Data.Items[index].SubItems[2].Text];
            byte Sel_SItem     = LIB_ITEM.BIO3_ITEM_LUT_INVERSE[LST_Combo_Data.Items[index].SubItems[3].Text];
            byte Sel_RItem     = LIB_ITEM.BIO3_ITEM_LUT_INVERSE[LST_RESULTITEM.Text];
            byte Sel_RQuantity = byte.Parse(LST_Combo_Data.Items[index].SubItems[5].Text);



            // MessageBox.Show(Sel_RItem.ToString());
            // update combo data and re parse/refresh update
            LIB_EXE.Update_ComboData(exe_path, V_OFFSET_CMB, index, Sel_ComboFunc, Sel_PItem, Sel_SItem, Sel_RItem, Sel_RQuantity);
            LIB_EXE.BIO3_ParseComboTable(exe_path, V_OFFSET_CMB, LST_Combo_Data);


            LST_Combo_Data.EnsureVisible(index);

            MessageBox.Show("Succesful Write Operation", "Success!");
        }
Example #2
0
        private void openEXEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Executable|*.exe";

            ofd.ShowDialog();

            exe_path = ofd.FileName;

            LST_ITEMDATA.Items.Clear();
            LST_ITEMDATA.SelectedItems.Clear();
            LST_Combo_Data.Items.Clear();
            LST_Combo_Data.SelectedItems.Clear();
            LST_PRIMARYITEM.Items.Clear();
            LST_SECONDARYITEM.Items.Clear();


            string version = VER_CHECK(ofd);


            // EA CHECk
            if (version == "EA")
            {
                V_OFFSET_ITEM = 0x12B3C8;
                V_OFFSET_CMB  = 0x12B678;

                MessageBox.Show("JAPAN EA RELEASE DETECTED");
            }


            if (version == "SN")
            {
                V_OFFSET_ITEM = 0x0012DF78;
                V_OFFSET_CMB  = 0x0012E278;

                MessageBox.Show("SOURCENEXT 1.1.0 DETECTED");
            }



            if (version != "NULL")
            {
                // parse exe item data and show dialog
                LIB_EXE.Parse_ItemData(exe_path, V_OFFSET_ITEM);
                LIB_EXE.BIO3_ParseComboTable(exe_path, V_OFFSET_CMB, LST_Combo_Data);
            }
            // populate item data..
            for (int i = 0; i < LIB_EXE.BIO3_ITEM_DATA.Length; i++)
            {
                LST_ITEMDATA.Items.Add(i.ToString("X"));



                if (LIB_ITEM.BIO3_ITEM_LUT.ContainsKey(byte.Parse(i.ToString())))
                {
                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_ITEM.BIO3_ITEM_LUT[byte.Parse(i.ToString())].ToString());



                    switch (i)
                    {
                    case 0x20:
                    case 0x21:
                    case 0x22:
                    case 0x23:
                    case 0x24:
                    case 0x25:
                    case 0x26:
                    case 0x27:
                    case 0x28:
                    case 0x29:
                    case 0x2A:

                        LST_ITEMDATA.Items[i].ForeColor = Color.Green;

                        break;

                    default: LST_ITEMDATA.Items[i].ForeColor = Color.White; break;
                    }


                    if (i <= 0x1F)
                    {
                        LST_ITEMDATA.Items[i].ForeColor = Color.Orange;
                    }
                    if (i <= 0x00)
                    {
                        LST_ITEMDATA.Items[i].ForeColor = Color.Orange;
                    }
                }



                LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Item_Type.ToString());
                LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Max_Quantity.ToString());
                LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Quest_Code.ToString());
                LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Display_Mode.ToString());
            }


            // populate combo data..
            for (int j = 0; j < LIB_EXE.BIO3_COMBO_ENTRIES.Length; j++)
            {
                LST_Combo_Data.Items.Add(j.ToString());

                if (LIB_ITEM.BIO3_ITEM_LUT.ContainsKey(LIB_EXE.BIO3_COMBO_ENTRIES[j].Primary_Item) && LIB_ITEM.BIO3_ITEM_LUT.ContainsKey(LIB_EXE.BIO3_COMBO_ENTRIES[j].Secondary_Item))
                {
                    LST_Combo_Data.Items[j].SubItems.Add(LIB_EXE.BIO3_COMBO_ENTRIES[j].ComboFunction.ToString());
                    LST_Combo_Data.Items[j].SubItems.Add(LIB_ITEM.BIO3_ITEM_LUT[LIB_EXE.BIO3_COMBO_ENTRIES[j].Primary_Item].ToString());
                    LST_Combo_Data.Items[j].SubItems.Add(LIB_ITEM.BIO3_ITEM_LUT[LIB_EXE.BIO3_COMBO_ENTRIES[j].Secondary_Item].ToString());
                    LST_Combo_Data.Items[j].SubItems.Add(LIB_ITEM.BIO3_ITEM_LUT[LIB_EXE.BIO3_COMBO_ENTRIES[j].Result_Item].ToString());
                    LST_Combo_Data.Items[j].SubItems.Add(LIB_EXE.BIO3_COMBO_ENTRIES[j].New_Quantity.ToString());
                }
            }


            // populate combo boxes with item list
            foreach (string item in LIB_ITEM.BIO3_ITEM_LUT.Values)
            {
                LST_PRIMARYITEM.Items.Add(item);
                LST_SECONDARYITEM.Items.Add(item);
                LST_RESULTITEM.Items.Add(item);
            }



            //******************************
            // ITEM DATA INIT
            //******************************
            Sel_Quantity.Maximum  = 255;
            Sel_QuestCode.Maximum = 255;
            Sel_Idx.Maximum       = 255;

            //******************************
            // COMBO DATA INIT
            // ****************************
            NUD_ResultQuantity.Maximum = 255;
        }
Example #3
0
        private void BTN_UPDATE_ITEM_Click_1(object sender, EventArgs e)
        {
            // convert properties to usable values
            int  sel_idx          = int.Parse(Sel_Idx.Value.ToString());
            byte selected_type    = byte.Parse(Sel_ItemType.Items[Sel_ItemType.SelectedIndex].ToString().Substring(0, 2));
            byte selected_display = byte.Parse(Sel_DisplayMode.Items[Sel_DisplayMode.SelectedIndex].ToString().Substring(0, 2));

            byte selected_quantity   = byte.Parse(Sel_Quantity.Value.ToString());
            byte selected_quest_code = byte.Parse(Sel_QuestCode.Value.ToString());

            // MessageBox.Show(exe_path + V_OFFSET_ITEM.ToString());

            // re write new values and re parse the list
            LIB_EXE.Update_ItemData(exe_path, V_OFFSET_ITEM, sel_idx, selected_type, selected_quantity, selected_quest_code, selected_display);

            LIB_EXE.Parse_ItemData(exe_path, V_OFFSET_ITEM);

            LST_ITEMDATA.Items.Clear();

            for (int i = 0; i < LIB_EXE.BIO3_ITEM_DATA.Length; i++)
            {
                LST_ITEMDATA.Items.Add(i.ToString("X"));


                if (LIB_ITEM.BIO3_ITEM_LUT.ContainsKey(byte.Parse(i.ToString())))
                {
                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_ITEM.BIO3_ITEM_LUT[byte.Parse(i.ToString())].ToString());

                    switch (i)
                    {
                    case 0x20:
                    case 0x21:
                    case 0x22:
                    case 0x23:
                    case 0x24:
                    case 0x25:
                    case 0x26:
                    case 0x27:
                    case 0x28:
                    case 0x29:
                    case 0x2A:

                        LST_ITEMDATA.Items[i].ForeColor = Color.Green;

                        break;

                    default: LST_ITEMDATA.Items[i].ForeColor = Color.White; break;
                    }


                    if (i <= 0x1F)
                    {
                        LST_ITEMDATA.Items[i].ForeColor = Color.Orange;
                    }
                    if (i <= 0x00)
                    {
                        LST_ITEMDATA.Items[i].ForeColor = Color.Orange;
                    }


                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Item_Type.ToString());
                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Max_Quantity.ToString());
                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Quest_Code.ToString());
                    LST_ITEMDATA.Items[i].SubItems.Add(LIB_EXE.BIO3_ITEM_DATA[i].Display_Mode.ToString());
                }
            }

            LST_ITEMDATA.EnsureVisible(sel_idx);
            MessageBox.Show("Succesful Write Operation", "Success!");
        }