Function at 0x40b4b0
Capabilities:
Check mutex on windows
Check os version

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x514
push ebx
mov ebx, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 0xc]
push edi
xor edx, edx
xor eax, eax
cmp ebx, edx
mov byte [esp + 0x330], dl
mov ecx, 0x43
lea edi, [esp + 0x331]
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov dword [esp + 0x2c], edx
je 0x40b4e9
mov byte [ebx], dl
mov eax, dword [ebp + 0x1c]
cmp eax, edx
je 0x40b4f2
mov dword [eax], edx
mov eax, dword [ebp + 0x20]
cmp eax, edx
je 0x40b4ff
mov dword [eax], 0xffffffff
mov eax, dword [ebp + 0x24]
cmp eax, edx
je 0x40b509
mov byte [eax], 0
lea eax, [esi + 0xc]
push eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x28], edx
mov dword [esp + 0x18], edx
call fcn.00439e40
add esp, 4
cmp eax, 3
jne 0x40b9ba
lea ebx, [esi + 0x10]
push ebx
call fcn.00439e40
add ebx, 4
push ebx
mov edi, eax
call fcn.00439e40
add esp, 8
add ebx, 4
cmp edi, 0x28
jl 0x40bb60
mov edx, dword [ebp + 0x10]
lea ecx, [eax + edi]
cmp ecx, edx
jg 0x40bb60
cmp eax, 4
jne 0x40bb60
add edi, esi
push edi
call fcn.00439e40
add esp, 4
cmp eax, 1
jne 0x40b58b
mov dx, word [0x4698e4]
mov al, byte [0x4698e6]
mov word [esp + 0x1c], dx
mov byte [esp + 0x1e], al
jmp 0x40b5aa
cmp eax, 2
jne 0x40bb30
mov cx, word [0x46d354]
mov dl, byte [0x46d356]
mov word [esp + 0x1c], cx
mov byte [esp + 0x1e], dl
push ebx
call fcn.00439e40
add ebx, 4
push ebx
mov edi, eax
call fcn.00439e40
add esp, 8
add ebx, 4
cmp edi, 0x28
jl 0x40bb12
mov edx, dword [ebp + 0x10]
lea ecx, [eax + edi]
cmp ecx, edx
jg 0x40bb12
cmp eax, 4
jne 0x40bb12
add edi, esi
push edi
call fcn.00439e40
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x20], esi
jne 0x40b606
mov ecx, 0x14
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
jmp 0x40b75a
cmp esi, 1
jne 0x40b626
mov ecx, 7
mov esi, str.KaseyaFirewallLogByPeriodSema
lea edi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov esi, dword [esp + 0x20]
jmp 0x40b75a
cmp esi, 2
jne 0x40b647
mov ecx, 7
mov esi, str.KaseyaStatisticLogByPeriodSema
lea edi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x20]
jmp 0x40b75a
cmp esi, 3
jne 0x40b681
mov edx, dword [str.KaseyaConfigLogSema]
mov eax, dword [0x46bbe8]
mov ecx, dword [0x46bbec]
mov dword [esp + 0x40], edx
mov edx, dword [0x46bbf0]
mov dword [esp + 0x44], eax
mov eax, dword [0x46bbf4]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
mov dword [esp + 0x50], eax
jmp 0x40b75a
cmp esi, 4
jne 0x40b6c7
mov ecx, dword [str.KaseyaErrorLogSema]
mov edx, dword [0x46bbd4]
mov eax, dword [0x46bbd8]
mov dword [esp + 0x40], ecx
mov ecx, dword [0x46bbdc]
mov dword [esp + 0x44], edx
mov dx, word [0x46bbe0]
mov dword [esp + 0x48], eax
mov al, byte [0x46bbe2]
mov dword [esp + 0x4c], ecx
mov word [esp + 0x50], dx
mov byte [esp + 0x52], al
jmp 0x40b75a
cmp esi, 5
jne 0x40badb
xor eax, eax
mov ecx, 0x25
lea edi, [esp + 0x298]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x298]
push ecx
mov byte [esp + 0x44], 0
mov dword [esp + 0x29c], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x40b728
cmp dword [esp + 0x2a8], 2
jne 0x40b728
cmp dword [esp + 0x29c], esi
jb 0x40b728
mov edx, dword [str.Global_]
mov eax, dword [0x46bbcc]
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
lea edi, [esp + 0x40]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40b730
mov ecx, dword [str.KaseyaAvLogSema]
mov edx, dword [0x46bbbc]
mov eax, dword [0x46bbc0]
mov dword [edi], ecx
mov ecx, dword [0x46bbc4]
mov dword [edi + 4], edx
mov dword [edi + 8], eax
mov dword [edi + 0xc], ecx
mov eax, dword [ebp + 0x20]
test eax, eax
je 0x40b763
mov dword [eax], esi
mov eax, dword [ebp + 0x24]
test eax, eax
je 0x40b780
push 0x4f
lea edx, [esp + 0x44]
push edx
mov esi, eax
push esi
call fcn.00458f80
add esp, 0xc
mov byte [esi + 0x4f], 0
push ebx
call fcn.00439e40
add ebx, 4
push ebx
mov edi, eax
call fcn.00439e40
add esp, 8
cmp edi, 0x28
mov esi, eax
jl 0x40bacf
mov ecx, dword [ebp + 0x10]
lea eax, [esi + edi]
cmp eax, ecx
jg 0x40bacf
cmp esi, 1
jl 0x40bacf
mov ecx, dword [ebp + 0xc]
lea ebx, [edi + ecx]
mov ecx, ebx
mov dword [esp + 0x10], ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40b7c5
sub ecx, edx
lea edx, [esi - 1]
cmp ecx, edx
jne 0x40b9c7
push 0x25
push ebx
call fcn.004590c0
add esp, 8
test eax, eax
je 0x40b881
test ebx, ebx
je 0x40b881
xor eax, eax
mov ecx, 0x43
lea edi, [esp + 0x330]
rep stosd dword es:[edi], eax
push 0x25
push ebx
stosw word es:[edi], ax
call fcn.004590c0
add esp, 8
test eax, eax
jne 0x40b842
push 0x10d
lea eax, [esp + 0x334]
push ebx
push eax
call fcn.00458f80
mov eax, ebx
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b830
sub eax, edx
cmp eax, 0x10e
jge 0x40b881
jmp 0x40b876
push 0x10e
lea ecx, [esp + 0x334]
push ecx
push ebx
call fcn.00449b30
add esp, 0xc
test eax, eax
je 0x40b876
push 0x10e
lea edx, [esp + 0x334]
push edx
push ebx
call fcn.0044a750
add esp, 0xc
test eax, eax
jne 0x40b881
lea ebx, [esp + 0x330]
mov dword [esp + 0x10], ebx
mov esi, dword [ebp + 0x18]
test esi, esi
je 0x40b89e
push 0x103
push ebx
push esi
call fcn.00458f80
add esp, 0xc
mov byte [esi + 0x103], 0
lea eax, [esp + 0x40]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b8a5
sub eax, edx
mov dword [esp + 0x30], eax
je 0x40b92b
lea eax, [esp + 0x40]
push eax
push 0
lea ecx, [esp + 0x3c]
push ecx
mov dword [esp + 0x40], 0xc
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 1
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, eax
test esi, esi
mov dword [esp + 0x14], esi
je 0x40b9d7
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40b92f
lea edx, [esp + 0x94]
push str.ERROR:_Failed_to_obtain_mutex_in_getFile___task._n
push edx
call fcn.00458ee7
add esp, 8
mov dword [esp + 0x90], 1
mov ebx, 0x400b
mov dword [esp + 0x14], 0
jmp 0x40bb92
mov esi, dword [esp + 0x14]
mov eax, dword [0x48bf8c]
test eax, eax
je 0x40b963
push 0x48beb8
push 0x48bf20
lea edx, [esp + 0x448]
push 0x48be50
push edx
call fcn.00435bf0
add esp, 0x10
test eax, eax
jne 0x40b963
mov dword [esp + 0x2c], 1
lea eax, [esp + 0x1c]
push eax
push ebx
call fcn.00459902
mov edi, eax
add esp, 8
test edi, edi
mov dword [esp + 0x24], edi
je 0x40ba15
push 2
push 0
push edi
call fcn.0045985d
push edi
call fcn.0045978d
push 0
mov ebx, eax
push 0
push edi
mov dword [esp + 0x34], ebx
call fcn.0045985d
add esp, 0x1c
test ebx, ebx
jl 0x40ba6b
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x40b9b3
mov dword [eax], ebx
xor ebx, ebx
jmp 0x40bb92
push 3
push eax
push str.ERROR:_getFile___received_command_task_with__d_parameters_when__d_paramaters_were_expected._n
jmp 0x40bb67
mov eax, dword [esp + 0x10]
push eax
push esi
push str.ERROR:_getFile___received_command_task_with_invalid_3rd_parameter_data__len___d__string___s_._n
jmp 0x40bb67
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x98]
push str.ERROR:_Failed_to_create_mutex_in_getFile___task_due_to_error__d._n
push eax
call fcn.00458ee7
lea ecx, [esp + 0x9c]
push ecx
mov dword [esp + 0xa0], 1
call fcn.0043e010
add esp, 0x10
mov ebx, 0x400b
jmp 0x40bb92
test esi, esi
je 0x40ba2f
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x98]
push str.ERROR:_Could_not_open__s_in_getFile___task_n
push ecx
call fcn.00458ee7
lea edx, [esp + 0x9c]
push edx
mov dword [esp + 0xa0], 1
call fcn.0043e010
add esp, 0x10
mov ebx, 0x400c
jmp 0x40bb92
push edi
call fcn.00459521
add esp, 4
test esi, esi
je 0x40ba8e
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push eax
push ecx
lea edx, [esp + 0x9c]
push str.ERROR:_File__s_has_length_of__d_bytes_in_getFile___task_n
push edx
call fcn.00458ee7
lea eax, [esp + 0xa0]
push eax
mov dword [esp + 0xa4], 1
call fcn.0043e010
add esp, 0x14
mov ebx, 0x400f
jmp 0x40bb92
push esi
push edi
push str.ERROR:_getFile___received_command_task_with_invalid_3rd_parameter_data__offset__0x_08x_and_len__0x_08x_._n
jmp 0x40bb67
mov eax, dword [esp + 0x20]
push eax
lea ecx, [esp + 0x98]
push str.ERROR:_getFile___received_command_task_with_invalid_2nd_parameter_data__value___d_._n
push ecx
call fcn.00458ee7
lea edx, [esp + 0x9c]
push edx
mov dword [esp + 0xa0], 1
call fcn.0043e010
add esp, 0x10
jmp 0x40bb8f
push eax
push edi
lea eax, [esp + 0x9c]
push str.ERROR:_getFile___received_command_task_with_invalid_2nd_parameter_data__offset__0x_08x_and_len__0x_08x_._n
push eax
call fcn.00458ee7
lea ecx, [esp + 0xa0]
push ecx
jmp 0x40bb7c
push eax
lea edx, [esp + 0x98]
push str.ERROR:_getFile___received_command_task_with_invalid_1st_parameter_data__value___d_._n
push edx
call fcn.00458ee7
lea eax, [esp + 0x9c]
push eax
mov dword [esp + 0xa0], 1
call fcn.0043e010
add esp, 0x10
jmp 0x40bb8f
push eax
push edi
push str.ERROR:_getFile___received_command_task_with_invalid_1st_parameter_data__offset__0x_08x_and_len__0x_08x_._n
lea ecx, [esp + 0xa0]
push ecx
call fcn.00458ee7
lea edx, [esp + 0xa0]
push edx
mov dword [esp + 0xa4], 1
call fcn.0043e010
add esp, 0x14
or ebx, 0xffffffff
mov edi, dword [esp + 0x18]
add edi, 0x28
mov dword [esp + 0x28], edi
inc edi
push edi
mov dword [esp + 0x34], ebx
call fcn.00459619
mov esi, eax
add esp, 4
test esi, esi
jne 0x40bc17
mov eax, dword [esp + 0x24]
push eax
call fcn.00459521
mov esi, dword [esp + 0x18]
add esp, 4
test esi, esi
je 0x40bbd4
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x28]
push ecx
push edx
lea eax, [esp + 0x9c]
push str.ERROR:_getFile___failed_to_allocate__d_bytes_to_return_file__s_n
push eax
call fcn.00458ee7
lea ecx, [esp + 0xa0]
push ecx
mov dword [esp + 0xa4], 1
call fcn.0043e010
add esp, 0x14
mov eax, 0x4099
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
push esi
push 0xc0000006
rep stosb byte es:[edi], al
call fcn.00439e70
lea eax, [esi + 4]
push eax
push ebx
call fcn.00439e70
mov edi, dword [ebp + 0xc]
lea ecx, [edi + 4]
push ecx
call fcn.00439e40
lea edx, [esi + 8]
push edx
push eax
call fcn.00439e70
add edi, 8
push edi
call fcn.00439e40
lea ecx, [esi + 0xc]
push ecx
push eax
call fcn.00439e70
lea edx, [esi + 0x10]
push edx
push 2
call fcn.00439e70
lea edi, [esi + 0x14]
lea eax, [esi + 0x24]
push edi
push 0x24
mov dword [esp + 0x48], eax
call fcn.00439e70
add edi, 4
push edi
push 4
call fcn.00439e70
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x58]
add esp, 0x40
push ecx
push edx
add edi, 4
call fcn.00439e70
mov edx, dword [esp + 0x18]
add edx, 4
push edi
push 0x28
mov dword [esp + 0x20], edx
call fcn.00439e70
add esp, 0x10
add edi, 4
test ebx, ebx
jne 0x40bd3f
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40bcec
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
push eax
push ecx
push 1
push edx
call fcn.00459489
add esp, 0x10
mov ebx, eax
jmp 0x40bcee
xor ebx, ebx
mov eax, dword [esp + 0x24]
push eax
call fcn.00459521
add esp, 4
test ebx, ebx
je 0x40bd25
mov eax, dword [esp + 0x20]
cmp eax, 1
je 0x40bd1c
cmp eax, 2
je 0x40bd1c
cmp eax, 3
je 0x40bd1c
cmp eax, 4
je 0x40bd1c
cmp eax, 5
jne 0x40bd25
mov ecx, dword [esp + 0x10]
mov byte [ebx + ecx], 0
inc ebx
push edi
push ebx
call fcn.00439e70
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x30]
sub ebx, ecx
add esp, 8
add eax, ebx
mov dword [esp + 0x28], eax
mov edi, dword [esp + 0x14]
test edi, edi
je 0x40bd55
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40bd6d
lea edx, [esp + 0x440]
push edx
call fcn.00435790
add esp, 4
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 8]
mov edx, dword [esp + 0x28]
push str.getFile__
push 0x20
push eax
push ecx
push edx
push esi
call fcn.00409630
mov edi, dword [esp + 0x48]
add esp, 0x18
test edi, edi
jne 0x40bd94
mov edi, eax
push esi
call fcn.0045932f
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret