Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
8b56eeea
Commit
8b56eeea
authored
8 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
Remove static buffers
Former-commit-id: b38b2fe04cdb1e3922da22f0208cbfaaac7d5f40
parent
a795b94f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libMEDSannotation/src/MEDS_FuncPrototypeAnnotation.cpp
+7
-7
7 additions, 7 deletions
libMEDSannotation/src/MEDS_FuncPrototypeAnnotation.cpp
libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
+8
-6
8 additions, 6 deletions
libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
with
15 additions
and
13 deletions
libMEDSannotation/src/MEDS_FuncPrototypeAnnotation.cpp
+
7
−
7
View file @
8b56eeea
...
...
@@ -28,8 +28,6 @@
#include
"MEDS_Register.hpp"
#include
"MEDS_FuncPrototypeAnnotation.hpp"
#define MAX_BUF_SIZE 16000
using
namespace
std
;
using
namespace
MEDS_Annotation
;
...
...
@@ -77,13 +75,15 @@ void MEDS_FuncPrototypeAnnotation::parse()
VirtualOffset
vo
(
m_rawInputLine
);
m_virtualOffset
=
vo
;
const
int
maxbufsize
=
m_rawInputLine
.
size
()
*
2
;
if
(
about_inargs
)
{
// 4046e0 71 FUNC INARGS 4 ARG0 1 ARG1 0 ARG2 0 ARG3 0
int
numargs
=
0
;
char
buf
[
MAX_BUF_SIZE
]
;
strncpy
(
buf
,
m_rawInputLine
.
c_str
(),
MAX_BUF_SIZE
-
1
);
buf
[
MAX_BUF_SIZE
-
1
]
=
'\0'
;
char
buf
[
maxbufsize
];
bzero
(
buf
,
maxbufsize
)
;
strncpy
(
buf
,
m_rawInputLine
.
c_str
(),
maxbufsize
-
1
);
buf
[
maxbufsize
-
1
]
=
'\0'
;
sscanf
(
buf
,
"%*x %*d %*s %*s %d %*s"
,
&
numargs
);
for
(
int
i
=
0
;
i
<
numargs
;
++
i
)
{
...
...
@@ -92,7 +92,7 @@ void MEDS_FuncPrototypeAnnotation::parse()
char
*
zarg
=
strstr
(
buf
,
arg
);
if
(
zarg
)
{
char
tmp
[
MAX_BUF_SIZE
];
char
tmp
[
maxbufsize
];
int
meds_type
;
sscanf
(
tmp
,
"%*s %d %*s"
,
&
meds_type
);
MEDS_Arg
marg
(
meds_type
);
...
...
@@ -108,7 +108,7 @@ void MEDS_FuncPrototypeAnnotation::parse()
else
if
(
about_return
)
{
// 404740 697 FUNC RETURNTYPE RAX 1
char
regbuf
[
MAX_BUF_SIZE
]
;
char
regbuf
[
maxbufsize
];
bzero
(
regbuf
,
maxbufsize
)
;
int
meds_retType
;
sscanf
(
m_rawInputLine
.
c_str
(),
"%*x %*d %*s %*s %s %d"
,
regbuf
,
&
meds_retType
);
RegisterName
reg
=
Register
::
getRegister
(
regbuf
);
...
...
This diff is collapsed.
Click to expand it.
libMEDSannotation/src/MEDS_InstructionCheckAnnotation.cpp
+
8
−
6
View file @
8b56eeea
...
...
@@ -171,6 +171,8 @@ void MEDS_InstructionCheckAnnotation::parse()
m_isInfiniteLoop
=
true
;
}
const
int
maxbufsize
=
m_rawInputLine
.
size
()
*
2
;
// get bit width information for overflow & underflow
if
(
m_isOverflow
||
m_isUnderflow
)
{
...
...
@@ -180,8 +182,8 @@ void MEDS_InstructionCheckAnnotation::parse()
// 80483d5 3 INSTR CHECK UNDERFLOW SIGNED 16 CX ZZ sub cx, ax
// 804d51d 2 INSTR CHECK OVERFLOW UNSIGNED 32 EBX ZZ add ebx, eax
char
buf
[
1024
]
=
""
;
char
buf
[
maxbufsize
];
bzero
(
buf
,
maxbufsize
);
sscanf
(
m_rawInputLine
.
c_str
(),
"%*s %*d %*s %*s %*s %*s %d %s"
,
&
m_bitWidth
,
buf
);
m_target
=
string
(
buf
);
if
(
m_isNoFlag
)
...
...
@@ -191,8 +193,8 @@ void MEDS_InstructionCheckAnnotation::parse()
}
else
if
(
m_isTruncation
)
// get bid width from/to information for truncation
{
char
buf
[
1024
]
=
""
;
char
buf2
[
1024
]
=
""
;
char
buf
[
maxbufsize
];
bzero
(
buf
,
maxbufsize
)
;
char
buf2
[
maxbufsize
];
bzero
(
buf2
,
maxbufsize
)
;
// [ADDR] [SIZE] INSTR CHECK TRUNCATION UNKNOWNSIGN 32 EAX 16 AX ZZ mov [esp+2Ah], ax
sscanf
(
m_rawInputLine
.
c_str
(),
"%*s %*d %*s %*s %*s %*s %d %s %d %s"
,
&
m_truncationFromWidth
,
buf
,
&
m_truncationToWidth
,
buf2
);
...
...
@@ -210,7 +212,7 @@ void MEDS_InstructionCheckAnnotation::parse()
}
else
if
(
m_isSignedness
)
{
char
buf
[
1024
]
=
""
;
char
buf
[
maxbufsize
];
bzero
(
buf
,
maxbufsize
)
;
// [ADDR] [SIZE] INSTR CHECK SIGNEDNESS SIGNED 16 AX ZZ mov [esp+28h], ax
// [ADDR] [SIZE] INSTR CHECK SIGNEDNESS UNSIGNED 16 AX ZZ mov [esp+28h], ax
sscanf
(
m_rawInputLine
.
c_str
(),
"%*s %*d %*s %*s %*s %*s %d %s"
,
&
m_bitWidth
,
buf
);
...
...
@@ -224,7 +226,7 @@ void MEDS_InstructionCheckAnnotation::parse()
// 8048293 3 INSTR MEMSET STACKOFFSET_ESP 12 SIZE 24 ZZ call memset
if
(
m_rawInputLine
.
find
(
"STACKOFFSET"
)
!=
string
::
npos
)
{
char
buf
[
1024
]
=
""
;
char
buf
[
maxbufsize
];
bzero
(
buf
,
maxbufsize
)
;
sscanf
(
m_rawInputLine
.
c_str
(),
"%*s %*d %*s %*s %*s %d %*s %d"
,
&
m_stackOffset
,
&
m_objectSize
);
if
(
m_rawInputLine
.
find
(
"STACKOFFSET_EBP"
)
!=
string
::
npos
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment