Function at 0x402c20
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x30
push ebx
mov eax, dword [esp + 0x38]
push ebp
push esi
push edi
push 0
push 0x80
push 3
push 0
push 0
push SysReAllocString
mov esi, ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x44], ebp
je 0x402ea7
lea ecx, [esp + 0x1c]
push 0
push ecx
lea edx, [esp + 0x38]
push 0xe
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp word [esp + 0x30], 0x4d42
je 0x402c8a
push 0
push 0
push 0x52d7c8
call fcn.0042cfd2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 4
mov eax, dword [esp + 0x3a]
lea ebx, [eax - 0xe]
push ebx
call fcn.00422378
add esp, 4
lea ecx, [esp + 0x1c]
mov edi, eax
push 0
push ecx
push ebx
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor ebp, ebp
mov bp, word [edi + 0xe]
cmp ebp, 8
je 0x402cdd
cmp ebp, 0x18
je 0x402cdd
push edi
call fcn.004223a1
add esp, 4
push 0
push 0
push 0x52d7b4
call fcn.0042cfd2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 4
mov ebx, dword [esp + 0x32]
mov eax, dword [esp + 0x3a]
sub ebx, eax
push ebx
call fcn.00422378
add esp, 4
lea edx, [esp + 0x1c]
mov dword [esp + 0x18], eax
push 0
push edx
push ebx
mov ebx, dword [esp + 0x50]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi + 8]
mov ebx, dword [edi + 4]
mov dword [esp + 0x10], eax
imul eax, ebx
lea eax, [eax + eax*2]
mov dword [esp + 0x20], ebx
push eax
call fcn.00422378
add esp, 4
cmp ebp, 0x18
mov dword [esi + 0x5c], eax
jne 0x402dd8
lea ecx, [ebx + ebx*2]
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
shl eax, 2
cmp eax, ecx
mov dword [esp + 0x44], eax
jge 0x402d58
add eax, 4
mov dword [esp + 0x44], eax
mov ebp, dword [esp + 0x10]
test ebp, ebp
jle 0x402e8a
mov ecx, dword [esp + 0x18]
xor edx, edx
inc ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ebp
test ebx, ebx
jle 0x402db1
mov dword [esp + 0x14], ebx
mov ebp, dword [esi + 0x5c]
mov al, byte [ecx + 1]
add ecx, 3
mov byte [edx + ebp], al
mov ebp, dword [esi + 0x5c]
mov al, byte [ecx - 3]
mov byte [edx + ebp + 1], al
mov ebp, dword [esi + 0x5c]
mov al, byte [ecx - 4]
mov byte [edx + ebp + 2], al
mov eax, dword [esp + 0x14]
add edx, 3
dec eax
mov dword [esp + 0x14], eax
jne 0x402d7f
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x20]
mov ebp, dword [esp + 0x28]
lea ecx, [ebx + ebx*2]
add edx, ecx
mov ecx, dword [esp + 0x24]
add ecx, eax
dec ebp
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ebp
jne 0x402d77
jmp 0x402e8a
cmp ebp, 8
jne 0x402e8a
mov eax, ebx
cdq
and edx, 3
add eax, edx
sar eax, 2
shl eax, 2
cmp eax, ebx
mov dword [esp + 0x44], eax
jge 0x402dfe
add eax, 4
mov dword [esp + 0x44], eax
mov ecx, dword [esp + 0x10]
test ecx, ecx
jle 0x402e8a
mov ecx, dword [esp + 0x18]
lea edx, [ebx + ebx*2]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x10]
xor ecx, ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], edx
xor ebp, ebp
test ebx, ebx
jle 0x402e67
mov eax, dword [esp + 0x14]
xor edx, edx
add ecx, 3
mov dl, byte [eax + ebp]
mov eax, dword [esi + 0x5c]
inc ebp
mov bl, byte [edi + edx*4 + 0x2a]
mov byte [ecx + eax - 3], bl
mov eax, dword [esi + 0x5c]
mov bl, byte [edi + edx*4 + 0x29]
mov byte [ecx + eax - 2], bl
mov eax, dword [esi + 0x5c]
mov dl, byte [edi + edx*4 + 0x28]
mov ebx, dword [esp + 0x20]
mov byte [ecx + eax - 1], dl
cmp ebp, ebx
jl 0x402e2d
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x14]
add ecx, edx
mov edx, dword [esp + 0x24]
add ebp, eax
dec edx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x14], ebp
mov dword [esp + 0x24], edx
jne 0x402e27
push edi
call fcn.004223a1
mov eax, dword [esp + 0x1c]
push eax
call fcn.004223a1
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esi + 0x54], ebx
mov dword [esi + 0x58], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 4