Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byte-identical version of appfat_cpp_init. #110

Merged
1 commit merged into from
Jul 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions Source/appfat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,27 @@

#include "../types.h"

int appfat_terminated = 0; // weak
// +Infinity after initialization of appfat.cpp.
float appfat_cpp_init_value;

char sz_error_buf[256];
int terminating; // weak
int cleanup_thread_id; // weak
char empty_string;

void __cdecl appfat_cpp_init()
{
appfat_terminated = 0x7F800000;
}

struct j_appfat_cpp_init
{
j_appfat_cpp_init()
{
appfat_cpp_init();
// appfat_cpp_init initializes the C++ runtime of appfat.cpp.
struct appfat_cpp_init {
appfat_cpp_init() {
appfat_cpp_init_value = INFINITY;
}
} _j_appfat_cpp_init;
/*
bool __cdecl appfat_cpp_free(void *a1)
{
bool result; // al
} appfat_cpp_init;

if ( a1 )
result = SMemFree(a1, "delete", -1, 0);
return result;
// delete overloads the delete operator.
void operator delete(void *ptr) {
if (ptr != NULL) {
SMemFree(ptr, "delete", -1, 0);
}
}
*/

char *__fastcall GetErr(int error_code)
{
Expand Down
5 changes: 5 additions & 0 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,8 @@ template<class T, class U> int8 __OFSUB__(T x, U y)
#endif

#endif /* IDA_GARBAGE */

#ifndef INFINITY
#include <limits>
#define INFINITY std::numeric_limits<float>::infinity()
#endif