Function at 0x407570
Capabilities:
Access peb ldr_data

Disassembly:
sub esp, 0x10
push esi
mov esi, dword [esp + 0x20]
cmp esi, dword [esp + 0x1c]
jne 0x407587
mov eax, dword [esp + 0x18]
pop esi
add esp, 0x10
ret
cmp esi, 1
jl 0x407591
cmp esi, 4
jle 0x4075a8
push 0x71a
push str.v:kacat_bfclient_tga2png_stb_image.h
push str.req_comp___1__req_comp___4
call fcn.00422216
add esp, 0xc
push ebx
mov ebx, dword [esp + 0x28]
push ebp
mov ebp, dword [esp + 0x30]
push edi
mov edi, esi
imul edi, ebx
mov eax, edi
imul eax, ebp
add eax, eax
push eax
call fcn.0041d0fe
mov ecx, eax
add esp, 4
mov dword [esp + 0x18], ecx
test ecx, ecx
jne 0x407601
push dword [esp + 0x24]
call fcn.0041d0e3
mov ecx, dword [0x44b8a8]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebp
pop ebx
pop esi
mov dword [eax + 0xc], str.outofmem
xor eax, eax
add esp, 0x10
ret
mov edx, dword [esp + 0x24]
mov dword [esp + 0x2c], 0
test ebp, ebp
jle 0x407812
mov eax, dword [esp + 0x28]
lea ebp, [esi - 0xa]
lea esi, [edi + edi]
mov dword [esp + 0x10], edx
mov dword [esp + 0x1c], esi
mov edi, 0xffff
lea ebp, [ebp + eax*8]
imul eax, ebx
add eax, eax
mov dword [esp + 0x28], eax
mov eax, ecx
mov ecx, edx
mov dword [esp + 0x14], eax
xor edx, edx
mov esi, ecx
cmp ebp, 0x19
ja case.0x407655.3
movzx ecx, byte [ebp + 0x4079b0]
jmp dword [ecx*4 + 0x40797c]
lea edx, [ebx - 1]
test edx, edx
js 0x407678
sub edx, 1
mov cx, word [esi]
mov word [eax], cx
lea esi, [esi + 2]
mov word [eax + 2], di
lea eax, [eax + 4]
jns 0x407663
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
nop dword [eax + eax]
sub edx, 1
movzx ecx, word [esi]
mov word [eax + 4], cx
lea esi, [esi + 2]
mov word [eax + 2], cx
lea eax, [eax + 6]
mov word [eax - 6], cx
jns 0x407690
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
nop word [eax + eax]
sub edx, 1
movzx ecx, word [esi]
mov word [eax + 4], cx
lea esi, [esi + 2]
mov word [eax + 2], cx
lea eax, [eax + 8]
mov word [eax - 8], cx
mov word [eax - 2], di
jns 0x4076c0
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
nop
sub edx, 1
mov cx, word [esi]
mov word [eax], cx
lea esi, [esi + 4]
lea eax, [eax + 2]
jns 0x4076f0
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
sub edx, 1
movzx ecx, word [esi]
mov word [eax + 4], cx
lea esi, [esi + 4]
mov word [eax + 2], cx
lea eax, [eax + 6]
mov word [eax - 6], cx
jns 0x407715
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
sub edx, 1
movzx ecx, word [esi]
mov word [eax + 4], cx
lea esi, [esi + 4]
mov word [eax + 2], cx
lea eax, [eax + 8]
mov word [eax - 8], cx
mov cx, word [esi - 2]
mov word [eax - 2], cx
jns 0x407743
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edx, [ebx - 1]
test edx, edx
js 0x407678
sub edx, 1
movzx ecx, word [esi]
mov word [eax], cx
lea esi, [esi + 6]
movzx ecx, word [esi - 4]
lea eax, [eax + 8]
mov word [eax - 6], cx
movzx ecx, word [esi - 2]
mov word [eax - 4], cx
mov word [eax - 2], di
jns 0x407776
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
lea edi, [ebx - 1]
test edi, edi
js 0x4077e2
nop dword [eax + eax]
movzx ecx, word [esi + 2]
lea esi, [esi + 6]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, word [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, word [esi - 6]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov word [eax - 2], dx
jns 0x4077b0
mov edx, dword [esp + 0x2c]
mov edi, 0xffff
mov ecx, dword [esp + 0x10]
inc edx
mov eax, dword [esp + 0x14]
add ecx, dword [esp + 0x28]
add eax, dword [esp + 0x1c]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
cmp edx, dword [esp + 0x34]
jl 0x407643
mov edx, dword [esp + 0x24]
push edx
call fcn.0041d0e3
mov eax, dword [esp + 0x1c]
add esp, 4
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x10
ret
lea edi, [ebx - 1]
test edi, edi
js 0x4077e2
mov ebx, 0xffff
movzx ecx, word [esi + 2]
lea esi, [esi + 6]
imul edx, ecx, 0x96
lea eax, [eax + 4]
movzx ecx, word [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, word [esi - 6]
imul ecx, ecx, 0x4d
mov word [eax - 2], bx
add edx, ecx
shr edx, 8
sub edi, 1
mov word [eax - 4], dx
jns 0x407833
mov ebx, dword [esp + 0x30]
jmp 0x4077de
lea edi, [ebx - 1]
test edi, edi
js 0x4077e2
nop dword [eax]
movzx ecx, word [esi + 2]
lea esi, [esi + 8]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, word [esi - 4]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, word [esi - 8]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov word [eax - 2], dx
jns 0x407880
jmp 0x4077de
lea edi, [ebx - 1]
test edi, edi
js 0x4077e2
nop
movzx ecx, word [esi + 2]
lea esi, [esi + 8]
imul edx, ecx, 0x96
lea eax, [eax + 4]
movzx ecx, word [esi - 4]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, word [esi - 8]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov word [eax - 4], dx
mov cx, word [esi - 2]
mov word [eax - 2], cx
jns 0x4078c0
jmp 0x4077de
lea edx, [ebx - 1]
test edx, edx
js 0x407678
sub edx, 1
movzx ecx, word [esi]
mov word [eax], cx
lea esi, [esi + 8]
movzx ecx, word [esi - 6]
lea eax, [eax + 6]
mov word [eax - 4], cx
movzx ecx, word [esi - 4]
mov word [eax - 2], cx
jns 0x407906
mov edx, dword [esp + 0x2c]
jmp 0x4077e7
push 0x737
push str.v:kacat_bfclient_tga2png_stb_image.h
push 0x43a9f4
call fcn.00422216
push dword [esp + 0x30]
call fcn.0041d0e3
push dword [esp + 0x28]
call fcn.0041d0e3
mov ecx, dword [0x44b8a8]
add esp, 0x14
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop ebp
pop ebx
pop esi
mov dword [eax + 0xc], str.unsupported
xor eax, eax
add esp, 0x10
ret