Function at 0x509744
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x148
mov eax, dword [0x5c4e68]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
push edi
push 6
pop ecx
xor eax, eax
lea edi, [ebp - 0x1f]
mov byte [ebp - 0x20], 0
rep stosd dword es:[edi], eax
push 0x103
mov byte [ebp - 0x128], al
xor edi, edi
lea eax, [ebp - 0x127]
push edi
push eax
mov dword [ebp - 0x144], esi
call fcn.005117f0
add esp, 0xc
mov edx, esi
mov dword [ebp - 0x138], edi
call fcn.004c3b34
test eax, eax
jne 0x509d64
cmp ebx, edi
je 0x509d64
cmp dword [ebx + 0x90], edi
je 0x5097c9
cmp dword [ebx + 0x8c], edi
jle 0x5097c9
push str.:5:LoadSales___has_detected_a_potential_memory_leak:_Extended_emp_sales_data_has_not_been_freed_
call fcn.00426c01
pop ecx
push 0x300c
push edi
push ebx
call fcn.005117f0
add esp, 0xc
push esi
mov ecx, 0x104
lea eax, [ebp - 0x128]
call fcn.004c3b66
pop ecx
mov edx, eax
call fcn.004c470f
mov eax, edx
push eax
mov esi, 0x532eb0
call fcn.004c3c75
mov esi, eax
neg esi
sbb esi, esi
inc esi
pop ecx
mov dword [ebp - 0x130], esi
call fcn.0048a53c
test eax, eax
je 0x50981d
mov dword [ebp - 0x130], edi
mov esi, edi
cmp esi, edi
mov dword [ebp - 0x140], edi
je 0x50995c
push edi
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x20]
push eax
push 0x19
pop eax
call fcn.004621ac
add esp, 0x18
lea edx, [ebp - 0x20]
call fcn.004c3b34
test eax, eax
jne 0x50986b
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.004c48c1
test eax, eax
pop ecx
pop ecx
je 0x50986b
mov dword [ebp - 0x140], 1
call fcn.00512297
push eax
push edi
push edi
call fcn.0048a119
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x128]
push str._stemp_d.sls
push eax
call fcn.00511173
add esp, 0x10
cmp dword [ebp - 0x140], edi
je 0x5098b0
cmp dword [ebp + 0x10], edi
je 0x5098b0
push 0x286
push str..GetSalesSa7.c
push 0x40
call fcn.0046c07a
add esp, 0xc
call fcn.004f16be
mov esi, dword [ebp - 0x144]
lea edx, [ebp - 0x128]
mov ecx, esi
mov dword [ebp - 0x134], eax
call fcn.0042a80f
cmp eax, edi
jne 0x509947
push 0x4e20
mov ecx, esi
call fcn.0042adc7
test eax, eax
pop ecx
jne 0x509904
cmp dword [ebp - 0x140], edi
je 0x509d64
cmp dword [ebp + 0x10], edi
je 0x509d64
push 0x40
call fcn.0046cf18
jmp 0x509d63
call fcn.004f16be
sub eax, dword [ebp - 0x134]
cmp eax, 0x1388
jae 0x509932
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 0x128]
mov ecx, esi
call fcn.0042a80f
cmp eax, edi
jne 0x509947
lea eax, [ebp - 0x128]
push eax
push esi
push str.:7:LoadSales___FAILED_to_CopyFileSafe___s_____s___0__
call fcn.00426c01
add esp, 0xc
cmp dword [ebp - 0x140], edi
je 0x50995c
cmp dword [ebp + 0x10], edi
je 0x50995c
push 0x40
call fcn.0046cf18
pop ecx
push 0x29c
push str..GetSalesSa7.c
mov edx, 0x530488
lea ecx, [ebp - 0x128]
call fcn.0042d2c6
mov esi, eax
cmp esi, edi
pop ecx
pop ecx
mov dword [ebp - 0x134], esi
je 0x509d64
push esi
push 1
lea eax, [ebp - 0x138]
push 4
push eax
call fcn.00511c63
add esp, 0x10
cmp eax, 1
jne 0x509d43
mov ecx, dword [ebp - 0x138]
cmp ecx, edi
je 0x509d43
mov edi, 0x300c
cmp ecx, edi
jbe 0x5099d3
push edi
push ecx
push str.:7:LoadSales___will_fail:_SALESPARAMS_has_decreased_in_size_from__d_to__d.
call fcn.00426c01
mov ecx, edi
add esp, 0xc
mov dword [ebp - 0x138], ecx
push esi
add ecx, 0xfffffffc
push ecx
lea eax, [ebx + 4]
push 1
push eax
call fcn.00511c63
mov edi, eax
mov eax, dword [ebp - 0x138]
xor esi, esi
add esp, 0x10
add edi, 4
mov dword [ebx], eax
mov dword [ebx + 0x90], esi
call fcn.0050b871
cmp eax, 0x96
jle 0x509a2e
call fcn.0048a53c
test eax, eax
je 0x509a1c
call fcn.0050b871
cmp eax, 0x12c0
jle 0x509a2e
call fcn.0050b871
push eax
push str.:8:LoadSalesSub___has_detected_a_potential_memory_leak____d_units_
call fcn.00426c01
pop ecx
pop ecx
mov eax, dword [ebx + 0x8c]
cmp eax, esi
mov dword [ebp - 0x13c], esi
jle 0x509b50
cmp eax, 0x1f4
jle 0x509a51
push eax
push str.:7:LoadSales___FAILED:_iNumIndividualEmps___d_is_corrupt_
jmp 0x509a74
shl eax, 6
push eax
call fcn.00513703
cmp eax, esi
pop ecx
mov dword [ebx + 0x90], eax
jne 0x509a80
mov eax, dword [ebx + 0x8c]
shl eax, 6
push eax
push str.:7:LoadSales___FAILED:_malloc__ld__FAILED_to_allocate_individual_employee_details_
call fcn.004265da
pop ecx
pop ecx
jmp 0x509b50
cmp dword [ebx + 0x8c], esi
mov dword [ebp - 0x13c], 1
mov dword [ebp - 0x12c], esi
jle 0x509b50
push dword [ebp - 0x134]
lea eax, [ebp - 0x138]
push 1
push 4
push eax
call fcn.00511c63
add esp, 0x10
cmp eax, 1
jne 0x509b17
mov eax, dword [ebp - 0x138]
test eax, eax
je 0x509b37
cmp eax, 0x40
ja 0x509b37
push dword [ebp - 0x134]
add eax, 0xfffffffc
push 1
push eax
mov eax, dword [ebx + 0x90]
lea eax, [esi + eax + 4]
push eax
call fcn.00511c63
mov edx, dword [ebx + 0x90]
add esp, 0x10
cmp eax, 1
push 0x40
pop ecx
mov dword [esi + edx], ecx
jne 0x509b24
add edi, dword [ebp - 0x138]
inc dword [ebp - 0x12c]
mov eax, dword [ebp - 0x12c]
add esi, ecx
cmp eax, dword [ebx + 0x8c]
jl 0x509a9c
jmp 0x509b4e
push str.:7:LoadSales___FAILED:_fread___failed_to_load_the_EMPSALESPARAMS_dwSize.
call fcn.004265da
pop ecx
jmp 0x509b47
push dword [ebp - 0x12c]
push str.:7:LoadSales___FAILED:_fread___failed_to_load_emp_index__d.
call fcn.004265da
pop ecx
jmp 0x509b21
push 0x40
push eax
push str.:7:LoadSales___FAILED:_The_EMPSALESPARAMS_dwSize__ld_is_invalid___Current_size_is__ld.
call fcn.004265da
add esp, 0xc
and dword [ebp - 0x13c], 0
xor esi, esi
mov ecx, dword [ebp - 0x134]
call fcn.0042d70e
cmp dword [ebp - 0x130], esi
je 0x509b6e
lea eax, [ebp - 0x128]
call fcn.0042a76b
mov ecx, dword [ebx]
xor eax, eax
neg ecx
cmp edi, esi
mov dword [ebp - 0x12c], esi
mov dword [ebp - 0x134], eax
jle 0x509bf0
mov dword [ebp - 0x130], ebx
sub dword [ebp - 0x130], ecx
cmp eax, 4
jb 0x509b9a
cmp eax, 8
jb 0x509bdf
cmp eax, 0x90
jl 0x509ba8
cmp eax, 0x94
jl 0x509bdf
add eax, ecx
cmp eax, esi
jl 0x509bcf
cmp dword [ebp - 0x13c], esi
je 0x509bdf
mov edx, dword [ebx + 0x8c]
shl edx, 6
cmp eax, edx
jge 0x509bdf
mov edx, dword [ebx + 0x90]
movzx eax, byte [eax + edx]
jmp 0x509bd9
mov edx, dword [ebp - 0x130]
movzx eax, byte [edx + eax]
add dword [ebp - 0x12c], eax
mov eax, dword [ebp - 0x134]
inc eax
cmp eax, edi
mov dword [ebp - 0x134], eax
jl 0x509b90
add dword [ebp - 0x12c], edi
cmp dword [ebp - 0x13c], esi
mov dword [ebx + 0xc], esi
mov dword [ebx + 0x10], esi
mov dword [ebx + 0x20], esi
jne 0x509c24
mov eax, dword [ebx + 0x90]
cmp eax, esi
mov dword [ebx + 0x8c], esi
je 0x509c1e
push eax
call fcn.00511758
pop ecx
mov dword [ebx + 0x90], esi
mov eax, dword [ebp - 0x12c]
lea edi, [ebx + 4]
cmp eax, dword [edi]
mov dword [ebx], 0x300c
je 0x509d2d
cmp dword [0x6e2bdc], esi
mov eax, dword [ebx + 0x90]
mov dword [ebx + 0x8c], esi
jne 0x509ce8
cmp eax, esi
je 0x509c5e
push eax
call fcn.00511758
pop ecx
cmp dword [ebp - 0x140], esi
mov dword [ebx + 0x90], esi
mov dword [ebp - 0x130], esi
je 0x509c97
cmp dword [ebp + 0x10], esi
jne 0x509c97
push esi
push 0x40
call fcn.0046bfbf
test eax, eax
pop ecx
pop ecx
je 0x509c97
push 0x40
mov dword [ebp - 0x130], 1
call fcn.0046cf18
pop ecx
push 0x368
mov edi, str..GetSalesSa7.c
push edi
push 0x40
call fcn.00469252
add esp, 0xc
cmp dword [ebp - 0x130], esi
je 0x509cc4
push 0x36a
push edi
push 0x40
call fcn.0046c07a
add esp, 0xc
push dword [ebp + 0x10]
mov dword [0x6e2bdc], 1
push dword [ebp - 0x144]
push ebx
call fcn.00509744
add esp, 0xc
mov dword [0x6e2bdc], esi
jmp 0x509d66
cmp eax, esi
je 0x509cf3
push eax
call fcn.00511758
pop ecx
mov al, byte [0x5dd922]
inc byte [0x5dd922]
cmp al, 0xa
mov dword [ebx + 0x90], esi
jae 0x509d64
push dword [ebp - 0x12c]
movzx eax, byte [0x5dd922]
push dword [edi]
push dword [ebp - 0x144]
push eax
push str.:5:__d_of_10:_LoadSales___s___FAILED:_The_checksum_failed:_Should_be__ld__but_was_calculated_to_be__ld.
call fcn.004265da
add esp, 0x14
jmp 0x509d64
mov ebx, dword [ebx + 0x90]
cmp ebx, esi
je 0x509d3e
mov esi, ebx
call fcn.0050b7fe
xor eax, eax
inc eax
jmp 0x509d66
mov ecx, esi
call fcn.0042d70e
push edi
lea ecx, [ebp - 0x128]
call fcn.0042b397
pop ecx
push eax
push str.:7:LoadSales___FAILED_to_read_the_size_of_the_sales_file.__GetFileSize_____ld.
call fcn.004265da
pop ecx
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0051291c
leave
ret