Function at 0x598059ee
Capabilities:
Access peb ldr_data
Get file size
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x88
mov esi, dword [0x598573a6]
mov eax, dword fs:[0x30]
mov ebx, dword [eax + 0xc]
add ebx, 0xc
lea esi, [esi]
mov ebx, dword [ebx]
mov edx, dword [ebx + 0x30]
test edx, edx
je 0x59805a1e
test esi, esi
je 0x59805a5f
movzx eax, word [edx]
test ax, ax
je 0x59805a1e
add edx, 2
xor ecx, ecx
lea esi, [esi]
lea edi, [eax - 0x41]
cmp di, 0x19
ja 0x59805a4d
add eax, 0x20
movzx eax, ax
add edx, 2
add ecx, eax
movzx eax, word [edx - 2]
test ax, ax
jne 0x59805a3e
cmp esi, ecx
jne 0x59805a1e
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x3c], eax
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0xc]
add eax, 0xc
mov eax, dword [eax]
mov ebx, dword [eax + 0x30]
test ebx, ebx
je 0x59805a71
mov ebx, dword [eax + 0x28]
mov dword [esp], 0x40
mov eax, dword [0x59857396]
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_LocalAlloc]
mov esi, dword [0x59857396]
sub esp, 8
mov edx, eax
lea ecx, [eax + esi]
test esi, esi
je 0x59805ab8
lea esi, [esi]
nop
mov byte [edx], 0
add edx, 1
cmp edx, ecx
jne 0x59805aae
movzx ecx, word [ebx]
xor edx, edx
test cx, cx
je 0x59805ad2
mov word [eax + edx*2], cx
add edx, 1
movzx ecx, word [ebx + edx*2]
test cx, cx
jne 0x59805ac2
cmp word [eax], 0
mov ebx, dword [str.crayon.iso]
je 0x59805f0e
xor ecx, ecx
jmp 0x59805af0
mov ecx, edx
lea edx, [ecx + 1]
cmp word [eax + edx*2], 0
jne 0x59805aee
add ecx, ecx
cmp word [eax + ecx], 0x5c
je 0x59805b14
xor ecx, ecx
mov word [eax + edx*2], cx
sub edx, 1
cmp word [eax + edx*2 - 2], 0x5c
jne 0x59805b03
movsx cx, byte [ebx]
lea esi, [eax + edx*2]
lea edx, [ebx + 1]
test cl, cl
je 0x59805b33
mov word [esi], cx
movsx cx, byte [edx]
add esi, 2
add edx, 1
test cl, cl
jne 0x59805b22
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x80
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x59805ef9
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileSize]
mov ebx, eax
mov eax, dword [0x598573aa]
sub esp, 8
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x1000
add bh, al
add al, 0x24
add byte [eax], al
add byte [eax], al
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_VirtualAlloc]
mov dword [ebp - 0x2c], 0
sub esp, 0x10
mov edi, eax
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x59805ef9
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x50], eax
mov eax, dword [0x598573be]
add edi, eax
mov dword [ebp - 0x58], eax
mov esi, dword [edi]
lea ebx, [edi + 8]
mov edx, edi
mov eax, dword [edi + 4]
mov dword [ebp - 0x44], eax
test esi, esi
je 0x59805c6b
lea eax, [esi - 1]
cmp eax, 2
jbe 0x59805f35
mov edi, esi
movd xmm3, dword [ebp - 0x44]
mov eax, ebx
xor ecx, ecx
shr edi, 2
pshufd xmm1, xmm3, 0
movdqu xmm0, xmmword [eax]
add ecx, 1
add eax, 0x10
paddd xmm0, xmm1
movups xmmword [eax - 0x10], xmm0
cmp edi, ecx
jne 0x59805c30
mov eax, esi
and eax, 0xfffffffc
lea ebx, [ebx + eax*4]
cmp esi, eax
je 0x59805c6b
lea ecx, [eax + 1]
mov edi, dword [ebp - 0x44]
add dword [ebx], edi
cmp esi, ecx
jbe 0x59805c6b
add dword [ebx + 4], edi
add eax, 2
cmp esi, eax
jbe 0x59805c6b
add dword [ebx + 8], edi
mov ebx, dword [0x598573d6]
lea esi, [edx + ebx]
lea eax, [esi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call fcn.5980593e
mov edi, eax
test eax, eax
je 0x59805ef9
movsx eax, byte [esi]
add esi, eax
mov dword [ebp - 0x48], eax
lea eax, [esi + 1]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call fcn.5980593e
mov dword [ebp - 0x44], eax
test eax, eax
je 0x59805ef9
movsx ecx, byte [esi]
add esi, ecx
mov dword [ebp - 0x4c], ecx
lea eax, [esi + 1]
mov dword [esp], eax
call edi
sub esp, 4
mov edx, eax
test eax, eax
je 0x59805ef9
movsx edi, byte [esi]
mov dword [ebp - 0x68], edx
mov ecx, dword [0x598573a2]
mov dword [ebp - 0x28], 0
lea eax, [esi + edi]
mov dword [ebp - 0x54], edi
mov edi, dword [eax + 4]
lea esi, [eax + ecx]
mov dword [ebp - 0x6c], ecx
mov dword [ebp - 0x60], edi
mov edi, dword [eax + 8]
mov eax, dword [edx + 0x3c]
lea ecx, [esi + edi]
mov dword [ebp - 0x64], ecx
mov ecx, dword [edx + eax + 0x2c]
mov eax, dword [0x598573ae]
mov dword [esp + 4], edi
mov dword [ebp - 0x70], ecx
add ecx, edx
lea edx, [ebp - 0x28]
mov dword [ebp - 0x3c], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], ecx
call eax
lea eax, [edi - 1]
mov edx, dword [ebp - 0x68]
sub esp, 0x10
test edi, edi
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x6c]
je 0x59805e81
add ebx, dword [ebp - 0x58]
lea eax, [ecx + ebx]
add eax, dword [ebp - 0x48]
add eax, dword [ebp - 0x4c]
add eax, dword [ebp - 0x54]
add eax, dword [ebp - 0x40]
lea ecx, [ecx + ebx + 0x10]
add ecx, dword [ebp - 0x48]
add ecx, dword [ebp - 0x4c]
add ecx, dword [ebp - 0x54]
add ecx, dword [ebp - 0x40]
cmp dword [ebp - 0x3c], ecx
mov ecx, dword [ebp - 0x70]
setae bl
lea ecx, [edx + ecx + 0x10]
cmp eax, ecx
setae cl
or bl, cl
je 0x59805f1a
cmp dword [ebp - 0x5c], 0xe
jbe 0x59805f1a
mov ebx, dword [ebp - 0x3c]
mov ecx, edi
and ecx, 0xfffffff0
mov edx, ebx
add ecx, ebx
lea esi, [esi]
lea esi, [esi]
movdqu xmm2, xmmword [eax]
add edx, 0x10
add eax, 0x10
movups xmmword [edx - 0x10], xmm2
cmp edx, ecx
jne 0x59805d9e
mov ecx, dword [ebp - 0x5c]
mov edx, edi
mov eax, dword [ebp - 0x3c]
and edx, 0xfffffff0
add esi, edx
sub ecx, edx
add eax, edx
cmp edx, edi
je 0x59805e81
movzx edx, byte [esi]
mov byte [eax], dl
test ecx, ecx
je 0x59805e81
movzx edx, byte [esi + 1]
mov byte [eax + 1], dl
cmp ecx, 1
je 0x59805e81
movzx edx, byte [esi + 2]
mov byte [eax + 2], dl
cmp ecx, 2
je 0x59805e81
movzx edx, byte [esi + 3]
mov byte [eax + 3], dl
cmp ecx, 3
je 0x59805e81
movzx edx, byte [esi + 4]
mov byte [eax + 4], dl
cmp ecx, 4
je 0x59805e81
movzx edx, byte [esi + 5]
mov byte [eax + 5], dl
cmp ecx, 5
mov ecx, 0xfffffffe
xor edx, edx
jmp 0x59805afc
mov eax, dword [ebp - 0x3c]
lea edx, [eax + edi]
movzx ecx, byte [esi]
add eax, 1
add esi, 1
mov byte [eax - 1], cl
cmp eax, edx
jne 0x59805f20
jmp 0x59805e81
xor eax, eax
jmp 0x59805c52