我正在创建一个 ELF 可执行文件,我需要知道操作系统需要哪些部分才能加载和执行它。
细节:
操作系统:Ubuntu 10.04(64 位) 内核版本:2.6.32-24 架构:i386
我意识到以下可能是必要的:
还有其他人吗?
所以我过去几天一直在重新研究PE格式,我还有几个问题
数据部分是否已映射到进程的内存中,或程序是否从磁盘读取它?
如果确实将其映射到其内存中,那么该进程如何获取该部分的偏移量?(和其他部分)
有没有办法获取已经映射到内存中的进程的入口点,而不触及磁盘上的文件?
我在sqlite中有两个表:
代码由XCode Generation生成:
class Event: NSManagedObject {
@NSManaged var startDate: NSDate
@NSManaged var details: EventDetail //i think this property shoud be var details Array<EventDetail> am i correct?
}
class EventDetail: NSManagedObject {
@NSManaged var title: String
@NSManaged var location: String
@NSManaged var note: String
@NSManaged var endDate: NSDate
@NSManaged var event: NSManagedObject
}
Run Code Online (Sandbox Code Playgroud)
我想将事件放在section中,将eventDetails放在行中.
我创建了加载事件的方法:
var eventList : Array<AnyObject> = []
func loadEvents(){
let appDel : AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate
let moc: NSManagedObjectContext = appDel.managedObjectContext! …Run Code Online (Sandbox Code Playgroud) 我在swift中选择多个单元格时遇到了一些问题.
我不想让用户根据需要选择多个单元格,只允许他选择三个单元格(每个部分一个).为了更清楚,我会给你一些代码.
我有三个部分:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 3
}
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let headerCell = tableView.dequeueReusableCellWithIdentifier("HeaderCell") as! CustomHeaderCell
/* let headerCell = tableView.dequeueReusableCellWithIdentifier("HeaderCell") as CustomHeaderCell */
// headerCell.backgroundColor = UIColor.set(#E6E2E1)
switch (section) {
case 0:
headerCell.headerLabel.text = "Bundesliga";
//return sectionHeaderView
case 1:
headerCell.headerLabel.text = "BBVA";
//return sectionHeaderView
case 2:
headerCell.headerLabel.text = "BPL";
//return sectionHeaderView
default:
headerCell.headerLabel.text = "Other";
}
return headerCell
}
Run Code Online (Sandbox Code Playgroud)
我想给每个用户提供例如5 Club秒的用户选择League.他必须Club在每个人中选择他最喜欢的 …
我的问题
当我处理时UITableView,我基本上有一个table_data包含我的部分和行的数组.
[
{
title : "section A title",
rows: [
{data: row_1_data},
{data: row_2_data}
]
},
{
title : "section B title",
rows: [
{data: row_1_data},
{data: row_2_data}
]
},
]
Run Code Online (Sandbox Code Playgroud)
我用heightForHeaderInSection,cellForRowAtindexPath,titleForHeaderInSection,didSelectRowAtindexPath方法是这样
if indexPath.section == 0 {
//section A
if indexPath.row == 0 {
//do something with table_data[0]["rows"][0]["data"]
}
elesif indexPath.row == 1 {
//do something else
}
}
if indexPath.section == 1 {
//do something for …Run Code Online (Sandbox Code Playgroud) 我有一个 Java 属性文件,其中有许多不同的属性用于不同的事情:
ui.datasource.st.name=MyTest
ui.datasource.st.port=111
ui.datasource.st.ip=1.1.1.1
ui.outputtype.snapshot=Snapshot
ui.outputtype.spreadsheet=Spreadsheet - xls
Run Code Online (Sandbox Code Playgroud)
该文件比这个大得多。
我想跳转到ui.outputtype部分,而不循环遍历文件并检查键值。
有没有办法做到这一点?
我想知道是否有任何技术可以使用for循环在OpenMp中创建并行部分。
例如,与创建n个不同的#pragma omp节不同,我想使用n个迭代的for循环创建它们,并为每个节使用一些更改的参数。
#pragma omp parallel sections
{
#pragma omp section
{
/* Executes in thread 1 */
}
#pragma omp section
{
/* Executes in thread 2 */
}
#pragma omp section
{
/* Executes in thread n */
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试完成这个仅用程序集制作的 PE 文件,它应该在控制台中显示一条消息。我想以这样的方式组织它,以便以后可以轻松添加更多内容(知道在哪里添加代码、数据、导入的函数)。
我现在创建了 4 个部分,分别用于代码、数据、未启动的数据和导入的元素。我现阶段的主要问题是:
首先,我将在下面显示我的所有代码。一些真正不重要的东西不会被添加,以节省时间并使其更易于阅读这是 NASM 代码
; Constants (use '$' as prefix)
$SECTION_ALIGNMENT equ 4096 ; Each section is aligned to 4096 in memory
$FILE_ALIGNMENT equ 512 ; Each section is aligned to 512 on disk
$PREFERRED_ADDRESS equ 4194304 ; Preffered address for EXE is 4 MB
$TOTAL_PE_SECTIONS equ 4 ; Code, Data, Bss and IData
; Image size = headers aligned to section alignment …Run Code Online (Sandbox Code Playgroud) 一个真棒文章约PE格式规定如下:
名称。每个节标题都有一个名称字段,长度最多八个字符,对于第一个字符必须为一个句点。
但是我知道一些违反此规则的示例,从.gnu_debuglink二进制文件内的部分开始,这些示例以DWARF格式分离了调试符号。另外侏儒的.debug_arranges,.debug_info以及其他违反本。(为了进行比较,PDB的“分离”部分名称仅为.debug。)
因此,我想知道本文是否只是过时/不完整,或者这是Windows特定的准则,还是对节名称长度没有任何限制?
如果有人给我指向任何有关PE / COFF二进制的书(ELF也会很棒),并且甚至比在线文章更全面,我也会很高兴。或关于系统编程的一般知识-有关此主题的信息非常稀缺或已过20年了。:)
它们有何不同?
我读到 SUBALIGN() 以某种方式强制进行某种对齐。还有其他区别吗?
什么时候应该使用 ALIGN(),什么时候应该使用 SUBALIGN()?