#elif defined(FIRMWARE_4_65) // Ported by Habib, Joonie, Haxxxen and Aldostools (Sep 11/2014)

#define TOC                                             0x34F960 // same as mamba 4.65

#define create_kernel_object_symbol                     0x11FB0 //  bytes matched: 0x44  F821FF617C0802A6FB610078F80100B0E80308007C9B2378FB8100802FA00000
#define destroy_kernel_object_symbol                    0x11914 //  bytes matched: 0x78  F821FF717C0802A6FB810070FBA10078FBC10080FBE10088F80100A07C681B78
#define destroy_shared_kernel_object_symbol             0x11288 //  bytes matched: 0x80  5480063E3D6080012B80007F540A2536616B00057D0A1A14409D000C7D6307B4
#define open_kernel_object_symbol                       0x12600 //  bytes matched: 0x80  F821FF517C0802A6FBA10098FBC100A0FBE100A8789E8402789FC622789D0620
#define open_shared_kernel_object_symbol                0x12410 // same as mamba 4.65
#define close_kernel_object_handle_symbol               0x11A30 // same as mamba 4.65

#define alloc_symbol                                    0x6479C // same as mamba 4.65
#define dealloc_symbol                                  0x64BD8 // same as mamba 4.65
#define copy_to_user_symbol                             0xF86C // same as mamba 4.65
#define copy_from_user_symbol                           0xFA88 // same as mamba 4.65
#define copy_to_process_symbol                          0xF924 // same as mamba 4.65
#define copy_from_process_symbol                        0xF734 // same as mamba 4.65
#define page_allocate_symbol                            0x6030C // same as mamba 4.65
#define page_free_symbol                                0x5FD70 // same as mamba 4.65
#define page_export_to_proc_symbol                      0x604A8 // same as mamba 4.65
#define page_unexport_from_proc_symbol                  0x5FC64 // same as mamba 4.65
#define kernel_ea_to_lpar_addr_symbol                   0x700C4 // same as mamba 4.65
#define map_process_memory_symbol                       0x771E4 // same as mamba 4.65
#define process_ea_to_lpar_addr_ex_symbol               0x776D8 // verified
#define set_pte_symbol                                  0x5E308 // verified.  Before it was 0x5E318 // Thanks Habib!
#define panic_symbol                                    0x276258 // verified

#define memcpy_symbol                                   0x7E8A4 // same as mamba 4.65
#define memset_symbol                                   0x4D66C // same as mamba 4.65
#define memcmp_symbol                                   0x4C97C // same as mamba 4.65

#define memchr_symbol                                   0x4C92C //  bytes matched: 0x30****  F821FF517C0802A6FB610088EB6219C8FBA100987C7D1B787F63DB78F8E10100
#define printf_symbol                                   0x27933C //  bytes matched: 0x30****  F821FF517C0802A6FB610088EB6219C8FBA100987C7D1B787F63DB78F8E10100
#define printfnull_symbol                               0x27DDB0 //  bytes matched: 0x24  386000004E800020F821FF717C0802A6FB810070FBA100787C9C23787C7D1B78


#define sprintf_symbol                                  0x4EA94 // same as mamba 4.65
#define snprintf_symbol                                 0x4EA00 // same as mamba 4.65
#define strcpy_symbol                                   0x4D818 // same as mamba 4.65
#define strncpy_symbol                                  0x4D8E0 // same as mamba 4.65
#define strlen_symbol                                   0x4D840 // same as mamba 4.65
#define strcat_symbol                                   0x4D748 // same as mamba 4.65
#define strcmp_symbol                                   0x4D7C4 // same as mamba 4.65
#define strncmp_symbol                                  0x4D86C // same as mamba 4.65
#define strchr_symbol                                   0x4D780 // same as mamba 4.65

#define strrchr_symbol                                  0x4D950 // bytes matched: 0x80  392000004800000C38630001419A0020880300007F8020002F000000409EFFEC

#define spin_lock_irqsave_ex_symbol                     0x276428 // same as mamba 4.65
#define spin_unlock_irqrestore_ex_symbol                0x2763FC // same as mamba 4.65

#define create_process_common_symbol                    0x2741C4 // bytes matched: 0x80  F821FE517C0802A6FA410140FA610148EA410250EA610248FAC10160FB410180
#define create_process_base_symbol                      0x273880 // bytes matched: 0x18  F821FF117C0802A6FAC100A0FAE100A8FB0100B0FB2100B8
#define load_process_symbol                             0x5004   // same as mamba 4.65
#define process_kill_symbol                             0x273FD0 // bytes matched: 0x28  F821FF717C0802A6FBC10080FB810070FBA10078FBE10088F80100A07C7E1B78

#define ppu_thread_create_symbol                        0x13EC8 // same as mamba 4.65
#define ppu_thread_exit_symbol                          0x13F80 // same as mamba 4.65
#define ppu_thread_join_symbol                          0x13FD4 // same as mamba 4.65
#define ppu_thread_delay_symbol                         0x287A4 // same as mamba 4.65

#define create_kernel_thread_symbol                     0x24B20 // bytes matched: 0x80  F821FF117C0802A6550B0632F8010100550007FEFB2100B82F800000FB4100C0
#define create_user_thread_symbol                       0x2525C // bytes matched: 0x80  F821FF117C0802A6FB0100B0EB028B00FB8100D0EB810160F8010100FAC100A0
#define create_user_thread2_symbol                      0x25080 // same as mamba 4.65
#define start_thread_symbol                             0x23D4C // same as mamba 4.65
#define run_thread_symbol                               0x2357C // same as mamba 4.65
#define register_thread_symbol                          0x2705DC // same as mamba 4.65
#define allocate_user_stack_symbol                      0x270DC4 // same as mamba 4.65
#define deallocate_user_stack_symbol                    0x270D2C // bytes matched: 0x38  F821FF717C0802A6FBA10078F80100A0E80300307CBD2B78FBC100802FA00000

#define mutex_create_symbol                             0x1363C // same as mamba 4.65
#define mutex_destroy_symbol                            0x135D4 // same as mamba 4.65
#define mutex_lock_symbol                               0x135CC // same as mamba 4.65
#define mutex_lock_ex_symbol                            0x1DB5C // bytes matched: 0x80  F821FF017C0802A6FB6100D87C7B1B78FB0100C0FB8100E0FBA100E8FBE100F8
#define mutex_trylock_symbol                            0x135C8 // bytes matched: 0x14***  4800990C38A000004800A58CF821FF817C0802A6
#define mutex_unlock_symbol                             0x135C4 // same as mamba 4.65

#define cond_create_symbol                              0x137A8 // bytes matched: 0x2C  F821FF717C0802A6FBA10078FBC100807C9D23787C7E1B783880003638A00000
#define cond_destroy_symbol                             0x13758 // bytes matched: 0x18  F821FF717C0802A6FBA10078FBE100887C7D1B78F80100A0
#define cond_wait_symbol                                0x13750 // bytes matched: 0x18**  38A000004800B9F4F821FF717C0802A6FBA10078FBE10088
#define cond_wait_ex_symbol                             0x1F148 // bytes matched: 0x80  F821FEF17C0802A6FB6100E87C7B1B78FB2100D8FBA100F8FBC10100FBE10108
#define cond_signal_symbol                              0x1372C // bytes matched: 0x18****  F821FF917C0802A6F80100804800B829E801008038600000
#define cond_signal_all_symbol                          0x13708 //

#define semaphore_initialize_symbol                     0x30C54 // bytes matched: 0x80  F821FF717C0802A6FBA100787C7D1B78E9228E6038630018F80100A0F93D0000
#define semaphore_wait_ex_symbol                        0x3095C // bytes matched: 0x38  F821FF117C0802A6FB6100C8FB8100D0FBA100D8FBC100E0FB0100B0FB2100B8
#define semaphore_trywait_symbol                        0x30544 // bytes matched: 0x38  F821FF717C0802A6FBC10080FB810070FBA10078FBE10088F80100A07C7E1B78
#define semaphore_post_ex_symbol                        0x30690 // bytes matched: 0x80  F821FF417C0802A62F840000FBC100B03FC08001FB8100A0FBE100B8FAC10070

#define event_port_create_symbol                        0x13078 // same as mamba 4.65
#define event_port_destroy_symbol                       0x134E0 // same as mamba 4.65
#define event_port_connect_symbol                       0x13558 // same as mamba 4.65
#define event_port_disconnect_symbol                    0x13484 // same as mamba 4.65
#define event_port_send_symbol                          0x13070 // same as mamba 4.65
#define event_port_send_ex_symbol                       0x2B204 // bytes matched: 0x44  F821FF517C0802A6FBE100A87C7F1B78FBC100A03BC30018FB2100787FC3F378

#define event_queue_create_symbol                       0x13380 // same as mamba 4.65
#define event_queue_destroy_symbol                      0x13308 // same as mamba 4.65
#define event_queue_receive_symbol                      0x1314C // same as mamba 4.65
#define event_queue_tryreceive_symbol                   0x13218 // bytes matched: 0x68  F821FF617C0802A63D208001F80100B038000000FBA10088F801007080030088

#define cellFsOpen_symbol                               0x2A0590 // same as mamba 4.65
#define cellFsClose_symbol                              0x2A03F8 // same as mamba 4.65
#define cellFsRead_symbol                               0x2A0534 // same as mamba 4.65
#define cellFsWrite_symbol                              0x2A04A0 // same as mamba 4.65
#define cellFsLseek_symbol                              0x29FB28 // same as mamba 4.65
#define cellFsStat_symbol                               0x29FDAC // same as mamba 4.65
#define cellFsUtime_symbol                              0x2A1898 // Before it was 0x2A1084 // Thanks Habib!
#define cellFsUnlink_internal_symbol                    0x19C4B4 // same as mamba 4.65

#define cellFsUtilMount_symbol                          0x29F908 // same as mamba 4.65
#define cellFsUtilUmount_symbol                         0x29F8DC // Before it was 0x2A12E4 and 0x29F8BC Thanks Habib!
#define cellFsUtilNewfs_symbol                          0x2A1330 // bytes matched: 0x1C  F821FF017C0802A6FBA100E83BA10070FB6100D8FBC100F07C9B2378

#define pathdup_from_user_symbol                        0x1A23A8 // same as mamba 4.65
#define open_path_symbol                                0x2A02C8 // same as mamba 4.65 Thanks Habib!
#define open_fs_object_symbol                           0x18A7D8 // same as mamba 4.65
#define close_fs_object_symbol                          0x189714 // same as mamba 4.65

#define new_medium_listener_object_symbol               0x9743C // bytes matched: 0x48****  F821FF717C0802A6FBE10088EBE2AC183880001DF80100A0FBC10080FBA10078
#define delete_medium_listener_object_symbol            0x98C74 // bytes matched: 0x40  F821FF817C0802A62C240000FBE100783FE08001FBC10070F80100907C9E2378
#define set_medium_event_callbacks_symbol               0x98FD8 // bytes matched: 0x58  F821FF517C0802A6FB410080F80100C038000000FB610088FB8100907C9B2378
#define storage_send_device_command_symbol              0x28108C // same as mamba 4.65
#define storage_write_symbol                            0x2813D0 //
#define storage_read_symbol                             0x281500 // same as mamba 4.65
#define storage_get_device_config_symbol                0x281C20 //
#define storage_close_symbol                            0x281F90 // same as mamba 4.65
#define storage_open_symbol                             0x2821A0 // same as mamba 4.65
#define storage_unmap_io_memory_symbol                  0x282518 // same as mamba 4.65
#define storage_map_io_memory_symbol                    0x28264C // same as mamba 4.65
#define storage_get_device_info_symbol                  0x282790 // same as mamba 4.65

#define cellUsbdUnregisterLdd_symbol                    0x268EBC // bytes matched: 0x24***  F821FF817C0802A6E9220E90F8010090E8090000F801007838000000E9610078
#define cellUsbdBulkTransfer_symbol                     0x269FF0 // verified
#define cellUsbdControlTransfer_symbol                  0x26A070 // bytes matched: 0x18  F821FF617C0802A62C240000F80100B0FBE100983C008011
#define cellUsbdScanStaticDescriptor_symbol             0x26A10C // verified
#define cellUsbdOpenPipe_symbol                         0x26A1BC // verified
#define cellUsbdRegisterLdd_symbol                      0x26F3E8 // bytes matched: 0x24***  F8010090E8090000F801007838000000E9610078E80900007D6B027938000000
#define cellUsbdClosePipe_symbol                        0x26F488 // not verified yet

#define decrypt_func_symbol                             0x34970 // same as mamba 4.65
#define lv1_call_99_wrapper_symbol                      0x4EEA8 // same as mamba 4.65
#define modules_verification_symbol                     0x58A4C // same as mamba 4.65
#define authenticate_program_segment_symbol             0x5A888 // verified (may need to be rechecked)

#define prx_load_module_symbol                          0x88B7C // same as mamba 4.65
#define prx_start_module_symbol                         0x87848 // same as mamba 4.65
#define prx_stop_module_symbol                          0x88C20 // same as mamba 4.65
#define prx_unload_module_symbol                        0x8757C // same as mamba 4.65
#define prx_get_module_info_symbol                      0x87004 // bytes matched: 0x4C  F821FF517C0802A6FB210078FB410080FB610088FB810090FBA100987CBB2B78
#define prx_get_module_id_by_address_symbol             0x86F14 // bytes matched: 0x28  F821FF717C0802A6FB810070FBA100787C9C23787C7D1B78F80100A04BFFFF8D
#define prx_get_module_id_by_name_symbol                0x86F64 // bytes matched: 0x28  F821FF717C0802A6FB810070FBA100787C9C23787C7D1B78F80100A04BFFFF3D
#define prx_get_module_list_symbol                      0x87084 // bytes matched: 0x58  F821FF517C0802A6FB010070FB210078FB410080FB610088FB810090FBA10098
#define load_module_by_fd_symbol                        0x881AC // bytes matched: 0x64  7D800026F821FF11FAE100A8FB0100B0FB6100C8FAC100A0FB2100B8FB4100C0
#define parse_sprx_symbol                               0x85F30 // bytes matched: 0x34  F821FF517C0802A6FB810090FBE100A87C7C1B787C9F23783860002038800000
#define open_prx_object_symbol                          0x7F470 // bytes matched: 0x18  F821FF917C0802A678840020F8010080E863020838E00023
#define close_prx_object_symbol                         0x7FD80 // bytes matched: 0x80**  E86302084BF91B902C2300007C0802A6F821FF81FBC10070FBE10078F8010090
#define lock_prx_mutex_symbol                           0x86EBC // verified
#define unlock_prx_mutex_symbol                         0x86EC8 // bytes matched: 0x1C***  E922A6C8E86900004BFF8624F821FF717C0802A6FBA100787C7D1B78

#define extend_kstack_symbol                            0x7001C // same as mamba 4.65

#define get_pseudo_random_number_symbol                 0x230E7C // same as mamba 4.65
#define md5_reset_symbol                                0x161C88 // bytes matched: 0x80  3D2067453D60EFCD3D4098BA3C0010323900000061292301616BAB89614ADCFE
#define md5_update_symbol                               0x162728 // bytes matched: 0x80  F821FF517C0802A654AB1838F80100C080030010FBC100A07D205A147C7E1B78
#define md5_final_symbol                                0x1628A8 // bytes matched: 0x54  F821FF617C0802A6FBE100987C9F2378FBC100903BC10070FBA1008838A00008
#define ss_get_open_psid_symbol                         0x233364 // bytes matched: 0x80  F821FF717C0802A6FB810070FBA100787C9C23787C7D1B78F80100A0480000F5
#define update_mgr_read_eeprom_symbol                   0x22C774 // bytes matched: 0x80  F821FF317C0802A6FBE100C83BE10070FB8100B0FBA100B87C7C1B787CBD2B78
#define update_mgr_write_eeprom_symbol                  0x22C6BC // bytes matched: 0x80  F821FF217C0802A6FBE100D83BE10070FB6100B8FBA100C87C7B1B787CBD2B78

#define ss_params_get_update_status_symbol              0x50AB4 // bytes matched: 0x80  3CA070617C0802A63CC075703CE0737460A5726160C6646160E761742C230000

#define syscall_table_symbol                            0x363A18 // same as mamba 4.65
#define syscall_call_offset                             0x27E894 // same as mamba 4.65

#define read_bdvd0_symbol                               0x1AD318 // same as mamba 4.65
#define read_bdvd1_symbol                               0x1AEF44 // same as mamba 4.65
#define read_bdvd2_symbol                               0x1BC0FC // same as mamba 4.65

#define storage_internal_get_device_object_symbol       0x280B44 // same as mamba 4.65

#define hid_mgr_read_usb_symbol                         0x1023BC // bytes matched: 0x74*  E962D0987C0802A6F821FF91F80100802F2400003800FFEB812B00002F890000
#define hid_mgr_read_bt_symbol                          0xFC294 // verified

#define bt_set_controller_info_internal_symbol          0xF0300 // bytes matched: 0x80  F821FF417C0802A62F85054CF80100D054C0043EFB410090FBA100A8FBC100B0

/* Calls, jumps */
#define device_event_port_send_call                     0x28ACFC // same as mamba 4.65

#define ss_pid_call_1                                   0x21BF98 //

#define process_map_caller_call                         0x4D24 // same as mamba 4.65

#define read_module_header_call                         0x7F364 //
#define read_module_body_call                           0x671C //
#define load_module_by_fd_call1                         0x88A18 //

#define shutdown_copy_params_call                       0xAACC //

#define fsloop_open_call                                0x2A0728 // same as mamba 4.65
#define fsloop_close_call                               0x2A0778 // same as mamba 4.65
#define fsloop_read_call                                0x2A07B8 // same as mamba 4.65

/* Patches */
#define shutdown_patch_offset                           0xAAB8 //
#define module_sdk_version_patch_offset                 0x26FE0C //
#define module_add_parameter_to_parse_sprxpatch_offset  0x88288 //

#define user_thread_prio_patch                          0x203FC // same as mamba 4.65
#define user_thread_prio_patch2                         0x20408 // same as mamba 4.65

/* Rtoc entries */

#define io_rtoc_entry_1                                 -0x1F0 // same as mamba 4.65
#define io_sub_rtoc_entry_1                             -0x7EA0 // same as mamba 4.65

#define decrypt_rtoc_entry_2                            -0x66A0 // same as mamba 4.65
#define decrypter_data_entry                            -0x7F10 //

#define storage_rtoc_entry_1                            0x1DD8 // same as mamba 4.65

#define device_event_rtoc_entry_1                       0x2048 // same as mamba 4.65

#define time_rtoc_entry_1                               -0x7640 //
#define time_rtoc_entry_2                               -0x7648 //

#define thread_rtoc_entry_1                             -0x76C0 //

#define process_rtoc_entry_1                            -0x7800 //

#define bt_rtoc_entry_1                                 -0x3680 //

/* Permissions */
#define permissions_func_symbol                         0x3560  /* before it was patch_func5+patch_func5_offset *///
#define permissions_exception1                          0x25100 /* before it was patch_func6+patch6_func6_offset *///
#define permissions_exception2                          0xC3210 /* before it was patch_func7+patch7_func7_offset */     //
#define permissions_exception3                          0x204D0 /* Added in v 3.0 *///

/* Legacy patches with no names yet */
/* Kernel offsets */
#define patch_data1_offset                              0x3E2BC0 // found after first idps on lv2 dump
#define patch_func2                                     0x59CFC  // same as mamba 4.65
#define patch_func2_offset                              0x2C     // same as mamba 4.65
#define patch_func8                                     0x5640C  // lv2open update patch // 386300087C0802A63880000038A00000F821FF91F80100804BFD // Thanks Habib!
#define patch_func8_offset1                             0xA4     // length 1             //
#define patch_func8_offset2                             0x208    // length 2             //
#define patch_func9                                     0x5A1B8  // must upgrade error   // F821FD017C0802A6FBA102E8787D0660FAA102A82FBD0000FB0102C0FB2102C8
#define patch_func9_offset                              0x4B8    // length of func9      // Thanks Habib!
#define mem_base2                                       0x3D90   //

/* vars */
// TODO: #define open_psid_buf_symbol                   0x45218C
#define thread_info_symbol                              0x37DBB0 // same as mamba 4.65

