首页
社区
课程
招聘
[原创]请版主帮我看看,我样汇编通不过!
发表于: 2007-4-18 18:49 4548

[原创]请版主帮我看看,我样汇编通不过!

2007-4-18 18:49
4548

0055232A >  60              pushad
0055232B    6A 40           push    40
0055232D    68 C0235500     push    005523C0
00552332    68 0A235500     push    0055230A                         ; ASCII ".\Gms\User"
00552337    68 15235500     push    00552315                         ; ASCII "FilesPath"
0055233C    68 1F235500     push    0055231F                         ; ASCII "Program"
00552341    68 FF225500     push    005522FF                         ; ASCII 09,".\Pds.ini"
00552346  - FF25 34534F00   jmp     dword ptr [<&kernel32.GetPrivate>; kernel32.GetPrivateProfileStringA
0055234C    61              popad

在0055234C处设断看到INI文件名变成那样了,GetPrivateProfileString这个函数的参数都有了,请帮我看看我错在哪?
0012FF8C  /CALL 到 GetPrivateProfileStringA
0012FF90  |Section = "Program"
0012FF94  |Key = "FilesPath"
0012FF98  |Default = ".\Gms\User"
0012FF9C  |ReturnBuffer = 复件_(3).005523C0
0012FFA0  |BufSize = 40 (64.)
0012FFA4  \IniFileName = ""FF,"",FF,"",FF,"",FF,"]?,96,"|f?,96,"|3?,8B,"?,8B,"蚜?,02,"?,AB,"",8B,"?,83,"?,03,"螵閨",FF,"",FF,"",FF,"",90,"",90,"",90,"",90,"",90,"",8B,"",FF,"U",8B,"?,83,"?,1C,"SVW3劭",A0,"?,99,"|?,80,"?,99,"|",83,"M?,FF,"岴"...

如果先把INI文件名压栈  这样也不行.
push 5522ff
push 40
push 5523c0
push 55230a
push 552315
push 55231f
call GetPrivateProfileString

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
按求助,按到原创了.
自己顶一下,请高手帮忙看看啊!
2007-4-18 22:42
0
雪    币: 44229
活跃值: (19955)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
3
你参数有问题,

DWORD GetPrivateProfileString(

    LPCTSTR lpAppName,        // points to section name
    LPCTSTR lpKeyName,        // points to key name
    LPCTSTR lpDefault,        // points to default string
    LPTSTR lpReturnedString,        // points to destination buffer
    DWORD nSize,        // size of destination buffer
    LPCTSTR lpFileName         // points to initialization filename
   );

汇编形式:
push  lpFileName
push  nSize
push  lpReturnedString
push  lpDefault
push  lpKeyName
push  lpAppName
call GetPrivateProfileString

你的:
0055232B    6A 40           push    40
0055232D    68 C0235500     push    005523C0
00552332    68 0A235500     push    0055230A                         ; ASCII ".\Gms\User"
00552337    68 15235500     push    00552315                         ; ASCII "FilesPath"      
0055233C    68 1F235500     push    0055231F                         ; ASCII "Program"         
00552341    68 FF225500     push    005522FF                         ; ASCII 09,".\Pds.ini"     
00552346  - FF25 34534F00   jmp     dword ptr [<&kernel32.GetPrivate>; kernel32.GetPrivateProfileStringA
2007-4-19 09:22
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
GetPrivateProfileStringA的参数如下:
lpApplicationName String [0055231F=(ASCII "Program")]
lpKeyName String [00552315=(ASCII "FilesPath")]
lpDefault String [0055230A=(ASCII ".\Gms\User")]
lpReturnedString String [5522C0]
nSize Long [40]
lpFileName [00552300=(ASCII ".\Pds.ini")]

我第一次就是这样,然后在552346处设断
0055232B    68 00235500     push    00552300                         ; ASCII ".\Pds.ini"
00552330    6A 40           push    40
00552332    68 C0235500     push    005523C0
00552337    68 0A235500     push    0055230A                         ; ASCII ".\Gms\User"
0055233C    68 15235500     push    00552315                         ; ASCII "FilesPath"
00552341    68 1F235500     push    0055231F                         ; ASCII "Program"
00552346  - FF25 34534F00   jmp     dword ptr [<&kernel32.GetPrivate>; kernel32.GetPrivateProfileStringA

断下后,INI文件名变成那样,每个参数都不对,我的错在哪?
0012FF8C   0055231F  /CALL 到 GetPrivateProfileStringA
0012FF90   00552315  |Section = "FilesPath"
0012FF94   0055230A  |Key = ".\Gms\User"
0012FF98   005523C0  |Default = ""
0012FF9C   00000040  |ReturnBuffer = 00000040
0012FFA0   00552300  |BufSize = 552300 (5579520.)
0012FFA4   7C930738  \IniFileName = ""FF,"",FF,"",FF,"",FF,"]?,96,"|f?,96,"|3?,8B,"?,8B,"蚜?,02,"?,AB,"",8B,"?,83,"?,03,"螵閨",FF,"",FF,"",FF,"",90,"",90,"",90,"",90,"",90,"",8B,"",FF,"U",8B,"?,83,"?,1C,"SVW3劭",A0,"?,99,"|?,80,"?,99,"|",83,"M?,FF,"岴"...
2007-4-19 12:23
0
雪    币: 44229
活跃值: (19955)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
5
好像是你OD堆栈提示有问题,正确:

                      /CALL 到 GetPrivateProfileStringA
0012FF8C   0055231F  |Section
0012FF90   00552315  |Key
0012FF94   0055230A  |Default
0012FF98   005523C0  |ReturnBuffer
0012FF9C   00000040  |BufSize
0012FFA0   00552300  \lpFileName
2007-4-19 13:03
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
问题找到了
00552346  - FF25 34534F00   jmp     dword ptr [<&kernel32.GetPrivate>; kernel32.GetPrivateProfileStringA
把上一句改成下面这样就好了.
00552346    FF15 34534F00   call    dword ptr [<&kernel32.GetPrivate>; kernel32.GetPrivateProfileStringA

另外GetPrivateProfileStringA函数的返回值不在EAX中吗?我想把返回值送到4f25c3处,因此我在CALL后面有一句
mov dword ptr ds:[4F25C3],eax
并在这一句上设断,查看EAX的值为OC,但在字符缓冲区的字符串为"I:\Gms\User\"这是怎么了?
2007-4-19 19:26
0
雪    币: 62
活跃值: (1972)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
EAX中的OC刚好是这个字符串的长度,是不是返回的长度呢?
2007-4-19 19:38
0
雪    币: 290
活跃值: (383)
能力值: ( LV9,RANK:375 )
在线值:
发帖
回帖
粉丝
8
你可以查下msdn
Return Value

The return value is the number of characters copied to the buffer, not including the terminating null character.
这个函数返回的就是字符串的长度
函数的参数中不是有个 LPTSTR lpReturnedString,  // points to destination buffer
字符串是放在那里面的
2007-4-20 00:11
0
游客
登录 | 注册 方可回帖
返回
//