Function at 0x402660
Capabilities:
Delete file
Write file on windows

Disassembly:
mov eax, 0x41052e
call fcn.0040ff00
sub esp, 0x5e4
push ebx
push esi
mov esi, ecx
push edi
xor ebx, ebx
mov dword [ebp - 0x10], esp
mov al, byte [esi + 4]
mov dword [ebp - 0x20], esi
cmp al, 0x22
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], ebx
je 0x402bf7
cmp al, 0xd
je 0x402bf7
cmp al, 0xa
je 0x402bf7
cmp dword [esi + 8], ebx
jne 0x4026f2
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x58]
mov byte [ebp - 0x58], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov esi, str.Invalid_category
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
lea eax, [ebp - 0x58]
lea ecx, [ebp - 0xec]
push eax
mov byte [ebp - 4], 2
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::runtime_error::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea eax, [ebp - 0xec]
push 0x411a10
push eax
call sub.MSVCRT.dll__CxxThrowException
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, ebx
mov dword [ebp - 0x1c], eax
jne 0x40275d
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x58]
mov byte [ebp - 0x58], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov esi, str.Failed_to_create_export_file.
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
lea eax, [ebp - 0x58]
lea ecx, [ebp - 0xd0]
push eax
mov byte [ebp - 4], 3
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::runtime_error::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea eax, [ebp - 0xd0]
push 0x411a10
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [esi + 8]
mov dword [ebp - 0x28], ebx
lea edx, [ebp - 0x28]
mov eax, dword [ecx]
push edx
call dword [eax + 0x20]
cmp eax, ebx
jge 0x4027bc
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x58]
mov byte [ebp - 0x58], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov esi, str.Failed_to_get_the_column_count.
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
lea eax, [ebp - 0x58]
lea ecx, [ebp - 0xb4]
push eax
mov byte [ebp - 4], 4
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::runtime_error::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea eax, [ebp - 0xb4]
push 0x411a10
push eax
call sub.MSVCRT.dll__CxxThrowException
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x2ef]
mov byte [ebp - 0x2f0], bl
lea edx, [ebp - 0x24]
rep stosd dword es:[edi], eax
mov ecx, dword [esi + 8]
push edx
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x24], 0x104
mov eax, dword [ecx]
lea edx, [ebp - 0x2f0]
push edx
call dword [eax + 0x10]
cmp eax, ebx
jge 0x402804
lea eax, [ebp - 0x2f0]
push 0x415ee0
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
pop ecx
pop ecx
push 0x3f
xor eax, eax
pop ecx
lea edi, [ebp - 0x3ef]
mov byte [ebp - 0x3f0], bl
push 0x7f
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x5ef]
mov byte [ebp - 0x5f0], bl
rep stosd dword es:[edi], eax
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x3f0]
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [0x416f0c]
push 0x100
push ecx
push 1
push eax
mov dword [ebp - 0x2c], ebx
call esi
lea eax, [ebp - 0x2f0]
push eax
lea eax, [ebp - 0x3f0]
push eax
lea eax, [ebp - 0x5f0]
push str._s:__s_r_n
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x2c]
push ebx
push eax
lea eax, [ebp - 0x5f0]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
lea eax, [ebp - 0x5f0]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x4028ab
push str.Failed_to_write_out_the_header.
push 0x416f90
call fcn.0040214f
pop ecx
pop ecx
push 0x3f
xor eax, eax
pop ecx
lea edi, [ebp - 0x1eb]
mov byte [ebp - 0x1ec], bl
push ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov al, byte [ebp + 0xb]
lea ecx, [ebp - 0x74]
mov dword [ebp - 0x18], 1
mov dword [ebp - 0x24], 0xff
mov byte [ebp - 0x74], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, dword [ebp - 0x20]
mov byte [ebp - 4], 5
mov dword [ebp - 0x14], ebx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x28]
jge 0x40297d
mov ecx, dword [edi + 8]
lea edx, [ebp - 0x24]
push edx
lea edx, [ebp - 0x1ec]
mov eax, dword [ecx]
push edx
push dword [ebp - 0x14]
call dword [eax + 0x24]
cmp eax, ebx
jge 0x402941
cmp eax, 0x800402c8
jne 0x40291d
push str.Failed_to_retrieve_column_name__buffer_too_small_
jmp 0x402922
push str.Failed_to_retrieve_column_name.
push 0x416f90
call fcn.0040214f
pop ecx
lea eax, [ebp - 0x1ec]
pop ecx
push 0x415ee0
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
lea eax, [ebp - 0x1ec]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
lea eax, [ebp - 0x1ec]
push eax
lea ecx, [ebp - 0x74]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
lea eax, [edi + 4]
push 1
push eax
lea ecx, [ebp - 0x74]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
inc dword [ebp - 0x14]
mov dword [ebp - 0x24], 0xff
jmp 0x4028e9
mov eax, dword [0x416f0c]
lea ecx, [ebp - 0x1ec]
push 0x100
push ecx
push 0x2e
push eax
call esi
lea eax, [ebp - 0x1ec]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
lea eax, [ebp - 0x1ec]
push eax
lea ecx, [ebp - 0x74]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
mov esi, 0x415130
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
lea ecx, [ebp - 0x74]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
mov eax, dword [ebp - 0x70]
cmp eax, ebx
jne 0x4029d4
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
lea ecx, [ebp - 0x2c]
push ebx
push ecx
push eax
mov esi, eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x402a05
push str.Failed_to_write_out_the_header.
push 0x416f90
call fcn.0040214f
pop ecx
pop ecx
jmp 0x402a08
inc dword [ebp - 0x18]
push ebx
lea ecx, [edi + 0x38]
call fcn.0040efe3
mov eax, dword [edi + 0x14]
cmp eax, ebx
jne 0x402a1c
xor esi, esi
jmp 0x402a24
mov esi, dword [edi + 0x18]
sub esi, eax
sar esi, 2
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x38], esi
mov byte [ebp - 0x48], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x14], ebx
cmp dword [ebp - 0x14], esi
jge 0x402bd5
cmp byte [edi + 0x34], 1
je 0x402bd5
push dword [ebp - 0x14]
lea ecx, [edi + 0x10]
mov byte [ebp - 4], 7
call fcn.00403ba8
mov ecx, dword [edi + 8]
lea edi, [ebp - 0x34]
push edi
mov edx, dword [ecx]
push dword [eax]
call dword [edx + 0x2c]
mov dword [ebp - 0x30], eax
jmp 0x402abd
cmp dword [ebp - 0x30], ebx
mov dword [ebp - 4], 6
jl 0x402b80
lea eax, [ebp - 0x48]
mov ecx, dword [ebp - 0x20]
push eax
push dword [ebp - 0x28]
push dword [ebp - 0x34]
call fcn.0040363e
cmp al, bl
jne 0x402af4
push str.Failed_to_format_event_to_string.
push 0x416f90
call fcn.0040214f
pop ecx
pop ecx
mov edi, 0x415130
push edi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push edi
lea ecx, [ebp - 0x48]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const___unsigned_int_]
mov eax, dword [ebp - 0x44]
cmp eax, ebx
jne 0x402b17
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
lea ecx, [ebp - 0x2c]
push ebx
push ecx
push eax
mov edi, eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push edi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x402b46
push str.Failed_to_write_line_to_export_file.
push 0x416f90
call fcn.0040214f
pop ecx
pop ecx
inc dword [ebp - 0x18]
lea ecx, [ebp - 0x48]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Freeze_void_]
mov edi, dword [ebp - 0x44]
lea ecx, [ebp - 0x48]
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Freeze_void_]
mov ecx, dword [ebp - 0x40]
mov eax, edi
add ecx, edi
neg eax
sbb eax, eax
and eax, ecx
lea ecx, [ebp - 0x48]
push eax
push dword [ebp - 0x44]
call dword [sym.imp.MSVCP60.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::erase_char___char__]
mov ecx, dword [ebp - 0x34]
mov eax, dword [ecx]
call dword [eax + 8]
mov eax, dword [ebp - 0x14]
push 5
imul eax, eax, 0x64
cdq
idiv esi
pop edi
mov ecx, eax
cdq
idiv edi
test edx, edx
jne 0x402bca
mov eax, dword [ebp - 0x20]
push ecx
lea ecx, [eax + 0x38]
call fcn.0040efe3
push 1
push ebx
push ebx
lea eax, [ebp - 0x64]
push ebx
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x402bca
lea eax, [ebp - 0x64]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x64]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
jmp 0x402ba1
inc dword [ebp - 0x14]
mov edi, dword [ebp - 0x20]
jmp 0x402a3d
push 1
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 5
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
push 1
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], bl
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
jmp 0x402c77
mov al, byte [ebp + 0xb]
push ebx
lea ecx, [ebp - 0x58]
mov byte [ebp - 0x58], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov esi, str.Invalid_delimiter_specified.
push esi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push esi
lea ecx, [ebp - 0x58]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
lea eax, [ebp - 0x58]
lea ecx, [ebp - 0x98]
push eax
mov byte [ebp - 4], 1
call dword [sym.imp.MSVCP60.dll_public:_void___thiscall_std::runtime_error::constructor_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea eax, [ebp - 0x98]
push 0x411a10
push eax
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [ebp - 0x78]
mov eax, dword [ecx]
call dword [eax + 4]
push eax
push 0x416f90
call fcn.0040214f
pop ecx
mov eax, 0x402c75
pop ecx
ret
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x1c], ebx
je 0x402c89
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x20]
cmp byte [eax + 0x34], 1
jne 0x402c9d
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x402ca5
lea ecx, [eax + 0x38]
call fcn.0040f00b
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 4