Function at 0x40a300
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2430
call fcn.0041db80
mov eax, dword [0x43bff0]
xor eax, esp
mov dword [esp + 0x242c], eax
mov eax, dword [esp + 0x2438]
push ebx
mov ebx, dword [esp + 0x2444]
push esi
mov esi, dword [esp + 0x243c]
mov dword [esp + 0x30], eax
mov eax, ecx
mov dword [esp + 0x18], edx
push edi
lea edx, [eax + 2]
lea ecx, [ecx]
mov di, word [eax]
add eax, 2
test di, di
jne 0x40a340
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0
push 0
push 0x200
sub eax, edx
lea edx, [esp + 0x244]
push edx
sar eax, 1
push eax
push ecx
push 0
push 1
call edi
mov byte [esp + eax + 0x238], 0
mov eax, esi
lea edx, [eax + 2]
jmp 0x40a380
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a380
push 0
push 0
push 0x100
sub eax, edx
lea ecx, [esp + 0x44]
push ecx
sar eax, 1
push eax
push esi
push 0
push 1
call edi
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push ebx
mov byte [esp + eax + 0x54], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x28], edi
jne 0x40a3e8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x242c]
xor ecx, esp
call fcn.004194fa
add esp, 0x2430
ret
push ebp
xor esi, esi
push esi
lea edx, [esp + 0x18]
push edx
lea ebp, [esp + 0x444]
push 0x1000
mov eax, ebp
push eax
lea ebx, [esp + 0x144c]
push edi
mov dword [esp + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a6e4
mov edx, dword [esp + 0x14]
cmp edx, esi
je 0x40a6e4
test edx, edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x1c], esi
jbe 0x40a610
mov edi, edi
cmp edx, 0x1000
jae 0x40a467
cmp byte [esp + edx + 0x43b], 0xa
lea eax, [esp + edx + 0x43c]
je 0x40a467
mov byte [eax], 0xa
mov edx, dword [esp + 0x14]
add edx, 1
mov dword [esp + 0x14], edx
lea ecx, [esp + edx + 0x43c]
lea eax, [esp + 0x43c]
cmp eax, ecx
jae 0x40a5d5
jmp 0x40a484
mov ebx, dword [esp + 0x18]
mov al, byte [ebp]
cmp al, 0xd
je 0x40a4a6
cmp al, 0xa
je 0x40a4a2
mov byte [ebx], al
add ebx, 1
add dword [esp + 0x1c], 1
mov dword [esp + 0x18], ebx
jmp 0x40a59a
cmp al, 0xd
jne 0x40a4e0
add ecx, 0xffffffff
cmp ebp, ecx
jae 0x40a4b6
mov cl, byte [ebp + 1]
mov byte [esp + 0x13], cl
jmp 0x40a4d6
push 0
lea edx, [esp + 0x38]
push edx
push 1
lea eax, [esp + 0x1f]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x34], 0
je 0x40a5c9
cmp byte [esp + 0x13], 0xa
jne 0x40a4e5
add ebp, 1
mov byte [esp + 0x13], 0
mov byte [ebx], 0
lea ebx, [esp + 0x13c]
lea esi, [esp + 0x143c]
call fcn.0040a210
test eax, eax
je 0x40a534
lea ecx, [esp + 0x23c]
push ecx
mov edx, ebx
push edx
call fcn.0041b902
add esp, 8
test eax, eax
jne 0x40a525
mov eax, 1
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
jmp 0x40a569
cmp dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
jmp 0x40a567
cmp dword [esp + 0x24], 0
je 0x40a569
mov ecx, dword [esp + 0x244c]
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x30]
push eax
push ecx
push edx
lea eax, [esp + 0x48]
push eax
lea edi, [esp + 0x144c]
call fcn.0040a0f0
mov edi, dword [esp + 0x3c]
add esp, 0x10
test eax, eax
jne 0x40a5c9
mov al, byte [esp + 0x13]
test al, al
lea ecx, [esp + 0x143c]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], 0
je 0x40a596
lea edx, [esp + 0x143d]
mov byte [esp + 0x143c], al
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x14]
add ebp, 1
cmp dword [esp + 0x1c], 0x1000
jl 0x40a5ba
lea eax, [esp + 0x143c]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], eax
lea ecx, [esp + edx + 0x43c]
cmp ebp, ecx
jb 0x40a480
mov esi, dword [esp + 0x30]
test esi, esi
jne 0x40a610
mov ebx, dword [esp + 0x18]
cmp dword [esp + 0x28], 0
je 0x40a5e3
cmp dword [esp + 0x24], 0
je 0x40a610
push 0
lea ecx, [esp + 0x18]
push ecx
lea ebp, [esp + 0x444]
push 0x1000
mov edx, ebp
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a610
mov edx, dword [esp + 0x14]
test edx, edx
ja 0x40a440
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40a6ca
mov edi, dword [esp + 0x38]
test edi, edi
jne 0x40a63b
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40a6eb
mov word [eax], di
jmp 0x40a6eb
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x40a6ce
mov eax, edi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a650
mov esi, dword [esp + 0x244c]
sub eax, edx
sar eax, 1
add esi, 0xffffffff
cmp esi, eax
jae 0x40a671
mov eax, esi
jmp 0x40a685
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a676
sub eax, edx
sar eax, 1
push eax
push edi
push ebx
call fcn.0041b64e
mov eax, edi
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a695
sub eax, edx
sar eax, 1
cmp esi, eax
jae 0x40a6b0
mov eax, esi
mov word [ebx + eax*2], cx
jmp 0x40a6ce
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a6b5
sub eax, edx
sar eax, 1
mov word [ebx + eax*2], cx
jmp 0x40a6ce
mov ebx, dword [esp + 0x20]
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a6d3
sub eax, edx
sar eax, 1
jmp 0x40a6ed
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x243c]
pop ebp
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004194fa
add esp, 0x2430
ret