Function at 0x502590
Capabilities:
Check os version
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5d87a9
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x610
mov eax, dword [0x644904]
push edi
mov dword [ebp - 0x10], eax
xor eax, eax
mov ecx, 0x25
lea edi, [ebp - 0xc0]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0xc0]
push eax
mov dword [ebp - 0xc0], 0x94
call dword [sym.imp.KERNEL32.DLL_GetVersionExA]
cmp dword [ebp - 0xb0], 2
jne 0x502bd0
cmp dword [ebp - 0xbc], 6
je 0x502bd0
mov eax, dword [ebp + 8]
push esi
xor esi, esi
cmp eax, esi
je 0x502bcf
cmp byte [eax], 0
je 0x502bcf
mov dword [ebp - 0x5e8], esi
mov dword [ebp - 0x5e4], esi
mov dword [ebp - 0x5e0], esi
push 1
push esi
push 0x5fcb44
lea ecx, [ebp - 0x5ec]
push ecx
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.tengine.dll_int___cdecl_TDU_ConvertStringToVector_char_const___class_std::vector_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____class_std::allocator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_______char_const___int__int_]
add esp, 0x14
lea ecx, [ebp - 0x5ec]
call fcn.004b47e0
test al, al
je 0x502662
lea ecx, [ebp - 0x5ec]
mov dword [ebp - 4], 0xffffffff
call fcn.0040c220
jmp 0x502bcf
mov byte [ebp - 0x1c4], 0
xor eax, eax
mov ecx, pe_nt_image_headers32
lea edi, [ebp - 0x1c3]
rep stosd dword es:[edi], eax
push ebx
stosw word es:[edi], ax
push 0x104
lea edx, [ebp - 0x1c4]
push edx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.DLL_GetSystemDirectoryA]
push 0x60a7f8
lea eax, [ebp - 0x1c4]
push eax
call dword [sym.imp.shlwapi.dll_PathAppendA]
xor ebx, ebx
mov dword [ebp - 0x5d8], ebx
mov dword [ebp - 0x5d4], esi
mov dword [ebp - 0x5d0], esi
lea ecx, [ebp - 0x1c4]
push 0x5fdc54
push ecx
mov byte [ebp - 4], 1
call dword [sym.imp.msvcr71.dll_fopen]
add esp, 8
cmp eax, esi
mov dword [ebp - 0x5c8], eax
jne 0x5026ee
lea ecx, [ebp - 0x5ec]
mov dword [ebp - 4], 0xffffffff
call fcn.0040c220
jmp 0x502bce
test byte [eax + 0xc], 0x10
jne 0x502836
mov bl, 7
lea ebx, [ebx]
mov edx, dword [ebp - 0x5c8]
xor eax, eax
mov byte [ebp - 0x5c4], 0
mov ecx, 0xff
lea edi, [ebp - 0x5c3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push edx
stosb byte es:[edi], al
lea eax, [ebp - 0x5c4]
push 0x400
push eax
call dword [sym.imp.msvcr71.dll_fgets]
add esp, 0xc
lea ecx, [ebp - 0x5c4]
push ecx
lea ecx, [ebp - 0x61c]
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
lea edx, [ebp - 0x61c]
push edx
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 4
call fcn.00501760
add esp, 8
lea ecx, [ebp - 0x61c]
mov byte [ebp - 4], 6
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [ebp - 0x80]
call fcn.005018c0
lea ecx, [ebp - 0x2c]
push ecx
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], bl
call dword [sym.imp.msvcp71.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__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea edx, [ebp - 0x80]
push edx
lea ecx, [ebp - 0x5dc]
call fcn.00502480
cmp dword [ebp - 0x18], esi
je 0x502805
push esi
lea ecx, [ebp - 0x2c]
call dword [sym.imp.msvcp71.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::operator___unsigned_int_]
cmp byte [eax], 0x23
je 0x502805
mov dword [ebp - 0x5f8], esi
mov dword [ebp - 0x5f4], esi
mov dword [ebp - 0x5f0], esi
push 1
push 1
push 0x60134c
lea eax, [ebp - 0x5fc]
push eax
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 8
call dword [sym.imp.msvcp71.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Myptr_void_]
push eax
call dword [sym.imp.tengine.dll_int___cdecl_TDU_ConvertStringToVector_char_const___class_std::vector_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____class_std::allocator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_______char_const___int__int_]
add esp, 0x14
lea ecx, [ebp - 0x5fc]
call fcn.0040a660
cmp eax, 2
je 0x502891
lea ecx, [ebp - 0x5fc]
mov byte [ebp - 4], bl
call fcn.0040c220
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 6
call fcn.00501920
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 1
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov edx, dword [ebp - 0x5c8]
test byte [edx + 0xc], 0x10
je 0x502700
mov ebx, dword [ebp - 0x5d8]
mov eax, edx
push eax
call dword [sym.imp.msvcr71.dll_fclose]
add esp, 4
mov dword [ebp - 0x600], esi
mov dword [ebp - 0x5f8], esi
mov dword [ebp - 0x5f4], esi
mov dword [ebp - 0x5f0], esi
push esi
lea ecx, [ebp - 0x5ec]
mov byte [ebp - 4], 9
call fcn.0040a660
push eax
lea ecx, [ebp - 0x600]
call fcn.00502510
mov edi, dword [ebp - 0x5e8]
mov dword [ebp - 0x5cc], esi
mov esi, ebx
test ebx, ebx
jne 0x50290a
xor eax, eax
jmp 0x502923
lea ecx, [ebp - 0x5dc]
call fcn.00501600
mov ecx, dword [ebp - 0x5f8]
mov edi, dword [ebp - 0x5d8]
dec eax
imul eax, eax, 0x54
add eax, edi
push ecx
lea ecx, [eax + 0x1c]
call dword [sym.imp.msvcp71.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__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
mov esi, dword [ebp - 0x5f8]
lea ecx, [ebp - 0x5dc]
add esi, 0x1c
call fcn.00501600
dec eax
imul eax, eax, 0x54
add eax, edi
push esi
lea ecx, [eax + 0x38]
call dword [sym.imp.msvcp71.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__::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const__]
lea ecx, [ebp - 0x5fc]
mov byte [ebp - 4], bl
call fcn.0040c220
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 6
call fcn.00501920
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 1
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
xor esi, esi
jmp 0x50281e
mov ecx, dword [ebp - 0x5d4]
sub ecx, ebx
mov eax, 0x30c30c31
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [ebp - 0x5cc], eax
jge 0x502a04
mov eax, dword [esi + 0x4c]
test eax, eax
je 0x5029f6
xor ebx, ebx
mov dword [ebp - 0x5c8], ebx
test edi, edi
jne 0x50294a
xor eax, eax
jmp 0x502965
mov ecx, dword [ebp - 0x5e4]
sub ecx, edi
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jge 0x5029f0
mov eax, dword [ebp - 0x5c8]
lea ecx, [esi + 0x38]
add edi, eax
call dword [sym.imp.msvcp71.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Myptr_void_]
push eax
mov ecx, edi
call dword [sym.imp.msvcp71.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Myptr_void_]
push eax
call dword [sym.imp.msvcr71.dll__strcmpi]
add esp, 8
test eax, eax
je 0x5029ad
mov eax, dword [ebp - 0x5c8]
mov edi, dword [ebp - 0x5e8]
inc ebx
add eax, 0x1c
mov dword [ebp - 0x5c8], eax
jmp 0x502942
push 0x60a7e4
mov ecx, esi
call dword [sym.imp.msvcp71.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__::operator_char_const__]
lea ecx, [esi + 0x38]
push ecx
mov ecx, esi
call dword [fcn.005ea328]
mov ecx, dword [ebp - 0x5f8]
xor eax, eax
mov eax, ebx
mov edx, eax
shr edx, 5
and eax, 0x1f
lea edx, [ecx + edx*4]
mov ecx, eax
mov eax, dword [edx]
mov edi, 1
shl edi, cl
or eax, edi
mov dword [edx], eax
mov edi, dword [ebp - 0x5e8]
mov ebx, dword [ebp - 0x5d8]
inc dword [ebp - 0x5cc]
add esi, 0x54
jmp 0x502882
mov eax, dword [ebp - 0x600]
xor esi, esi
test eax, eax
jle 0x502aa3
xor edi, edi
mov ecx, dword [ebp - 0x5f8]
xor eax, eax
mov eax, esi
mov edx, eax
shr edx, 5
lea edx, [ecx + edx*4]
and eax, 0x1f
mov ecx, 1
mov dword [ebp - 0x5cc], ecx
mov ecx, eax
mov eax, dword [ebp - 0x5cc]
shl eax, cl
test dword [edx], eax
jne 0x502a91
lea ecx, [ebp - 0x80]
call fcn.005018c0
push 0x60a7e4
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 0xa
call dword [sym.imp.msvcp71.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__::operator_char_const__]
mov eax, dword [ebp - 0x5e8]
add eax, edi
push eax
lea ecx, [ebp - 0x80]
call dword [fcn.005ea328]
lea ecx, [ebp - 0x80]
push ecx
lea ecx, [ebp - 0x5dc]
call fcn.00502480
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], 9
call fcn.00501920
mov ebx, dword [ebp - 0x5d8]
mov eax, dword [ebp - 0x600]
inc esi
add edi, 0x1c
cmp esi, eax
jl 0x502a16
lea edx, [ebp - 0x1c4]
push 0x600190
push edx
call dword [sym.imp.msvcr71.dll_fopen]
add esp, 8
mov dword [ebp - 0x5c8], eax
xor edi, edi
mov esi, ebx
test ebx, ebx
jne 0x502aca
xor eax, eax
jmp 0x502ae3
mov ecx, dword [ebp - 0x5d4]
sub ecx, ebx
mov eax, 0x30c30c31
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp edi, eax
jge 0x502b0b
mov ecx, esi
call dword [sym.imp.msvcp71.dll_public:_char____thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Myptr_void_]
push eax
mov eax, dword [ebp - 0x5c8]
push 0x60018c
push eax
call dword [sym.imp.msvcr71.dll_fprintf]
add esp, 0xc
inc edi
add esi, 0x54
jmp 0x502ac2
mov ecx, dword [ebp - 0x5c8]
push ecx
call dword [sym.imp.msvcr71.dll_fclose]
mov eax, dword [ebp - 0x5f8]
add esp, 4
test eax, eax
je 0x502b2e
push eax
call sub.msvcr71.dll_void___cdecl_operator_delete_void__
add esp, 4
test ebx, ebx
je 0x502b93
cmp ebx, dword [ebp - 0x5d4]
mov esi, ebx
mov dword [ebp - 0x5cc], esi
je 0x502b8a
mov bl, 0xb
lea edi, [esi + 0x1c]
mov dword [ebp - 0x5c8], edi
lea ecx, [edi + 0x1c]
mov byte [ebp - 4], 0xc
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, edi
mov byte [ebp - 4], bl
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, esi
mov byte [ebp - 4], 0
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov eax, dword [ebp - 0x5d4]
add esi, 0x54
cmp esi, eax
mov dword [ebp - 0x5cc], esi
jne 0x502b44
mov ebx, dword [ebp - 0x5d8]
push ebx
call sub.msvcr71.dll_void___cdecl_operator_delete_void__
add esp, 4
mov esi, dword [ebp - 0x5e8]
test esi, esi
mov dword [ebp - 4], 0xffffffff
je 0x502bce
mov edi, dword [ebp - 0x5e4]
cmp esi, edi
je 0x502bc5
mov edi, edi
mov ecx, esi
call dword [sym.imp.msvcp71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
add esi, 0x1c
cmp esi, edi
jne 0x502bb0
mov esi, dword [ebp - 0x5e8]
push esi
call sub.msvcr71.dll_void___cdecl_operator_delete_void__
add esp, 4
pop ebx
pop esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop edi
call fcn.005c8895
mov esp, ebp
pop ebp
ret