Function at 0x4ba690
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x4c
mov edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x60]
push ebx
push ebp
imul ecx, dword [edx + 0x1c], 0x4c
mov ebp, dword [edx + 0x24]
mov ebx, dword [edx + 0x28]
push esi
mov esi, dword [esp + 0x60]
push edi
imul edi, dword [edx + 0x20], 0x98
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x14]
mov dword [esp + 0x34], ebp
mov dword [esp + 0x24], ebx
add edi, dword [ecx + eax + 0x1c]
mov eax, dword [esp + 0x68]
mov dword [esp + 0x1c], edi
test byte [eax], 2
je 0x4ba738
mov ecx, dword [esp + 0x78]
cmp ecx, 6
jae 0x4ba70a
cmp dword [esp + 0x80], 1
jne 0x4ba700
push 6
push ecx
push str.opj_t2_encode_packet__:_only__u_bytes_remaining_in_output_buffer.__u_needed._n
push 1
push dword [esp + 0x94]
call fcn.004ac8e0
add esp, 0x14
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x4c
ret
mov edx, dword [esp + 0x70]
sub ecx, 6
mov dword [esp + 0x14], ecx
mov dword [edx], 0x40091ff
movzx eax, byte [esi + 0x349]
mov byte [edx + 4], al
movzx eax, byte [esi + 0x348]
mov byte [edx + 5], al
lea eax, [edx + 6]
mov dword [esp + 0x10], eax
jmp 0x4ba740
mov eax, dword [esp + 0x78]
mov dword [esp + 0x14], eax
test ebx, ebx
jne 0x4ba80a
mov eax, dword [esp + 0x1c]
add edi, 0x1c
mov dword [esp + 0x6c], edi
mov dword [esp + 0x64], ebx
cmp dword [eax + 0x18], ebx
jbe 0x4ba808
push edi
call fcn.004b3540
add esp, 4
test eax, eax
jne 0x4ba7e7
lea ebx, [ebp*4]
add ebx, ebp
mov ebp, dword [edi + 0x14]
push dword [ebp + ebx*8 + 0x20]
call fcn.004bc250
push dword [ebp + ebx*8 + 0x24]
call fcn.004bc250
mov eax, dword [ebp + ebx*8 + 0x14]
add esp, 8
imul eax, dword [ebp + ebx*8 + 0x10]
xor esi, esi
mov dword [esp + 0x50], eax
test eax, eax
je 0x4ba7e3
xor edi, edi
jmp 0x4ba7b0
mov ecx, dword [ebp + ebx*8 + 0x18]
mov eax, dword [esp + 0x6c]
mov dword [ecx + edi + 0x28], 0
mov eax, dword [eax + 0x1c]
sub eax, dword [ecx + edi + 0x1c]
push eax
push esi
push dword [ebp + ebx*8 + 0x24]
call fcn.004bc290
inc esi
lea edi, [edi + 0x34]
add esp, 0xc
cmp esi, dword [esp + 0x50]
jb 0x4ba7b0
mov edi, dword [esp + 0x6c]
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x64]
add edi, 0x24
mov ecx, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x6c], edi
cmp eax, dword [ecx + 0x18]
jb 0x4ba760
mov edi, ecx
jmp 0x4ba80a
mov edi, eax
call fcn.004cd400
mov ebx, eax
mov dword [esp + 0x64], ebx
test ebx, ebx
je 0x4ba700
mov ecx, dword [esp + 0x14]
push ecx
push dword [esp + 0x14]
push ebx
call fcn.004cd570
push 1
push 1
push ebx
call fcn.004cd670
lea eax, [edi + 0x1c]
add esp, 0x18
mov dword [esp + 0x44], eax
xor ecx, ecx
mov dword [esp + 0x50], ecx
mov dword [esp + 0x40], eax
cmp ecx, dword [edi + 0x18]
jae 0x4bab36
push eax
call fcn.004b3540
add esp, 4
test eax, eax
jne 0x4bab21
mov ebx, dword [esp + 0x40]
lea edx, [ebp*4]
add edx, ebp
xor edi, edi
mov dword [esp + 0x38], edx
mov ebx, dword [ebx + 0x14]
mov dword [esp + 0x48], ebx
mov ebp, dword [ebx + edx*8 + 0x14]
imul ebp, dword [ebx + edx*8 + 0x10]
mov esi, dword [ebx + edx*8 + 0x18]
mov dword [esp + 0x54], ebp
test ebp, ebp
je 0x4ba8c8
add esi, 4
cmp dword [esi + 0x24], 0
jne 0x4ba8c0
mov eax, dword [esp + 0x24]
lea ecx, [eax + eax*2]
mov eax, dword [esi]
cmp dword [eax + ecx*8], 0
je 0x4ba8c0
push dword [esp + 0x24]
push edi
push dword [ebx + edx*8 + 0x20]
call fcn.004bc290
mov edx, dword [esp + 0x44]
add esp, 0xc
inc edi
add esi, 0x34
cmp edi, ebp
jb 0x4ba896
mov eax, dword [ebx + edx*8 + 0x18]
mov dword [esp + 0x30], 0
test ebp, ebp
je 0x4bab1d
mov ecx, dword [esp + 0x24]
lea ebx, [eax + 0x20]
lea edx, [eax + 8]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], edx
lea ebp, [ecx + ecx*2]
shl ebp, 3
lea ecx, [eax + 0x28]
add eax, 4
mov dword [esp + 0x58], ebp
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x2c], eax
mov edx, dword [eax]
xor esi, esi
add edx, ebp
xor edi, edi
xor ebp, ebp
mov dword [esp + 0x3c], edx
mov dword [esp + 0x4c], ebp
cmp dword [ecx], esi
jne 0x4ba940
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x48]
inc eax
push eax
mov eax, dword [esp + 0x3c]
push dword [esp + 0x34]
push dword [ecx + eax*8 + 0x20]
push dword [esp + 0x70]
call fcn.004bbfc0
add esp, 0x10
jmp 0x4ba956
xor eax, eax
cmp dword [edx], eax
push 1
setne al
push eax
push dword [esp + 0x6c]
call fcn.004cd670
add esp, 0xc
mov eax, dword [esp + 0x3c]
cmp dword [eax], esi
jne 0x4ba97b
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x6c]
add eax, 0x34
add dword [esp + 0x20], 0x34
add ecx, 0x34
add dword [esp + 0x18], 0x34
jmp 0x4baafa
mov eax, dword [esp + 0x6c]
cmp dword [eax], esi
jne 0x4ba9aa
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x48]
push 0x3e7
push dword [esp + 0x34]
mov dword [ebx], 3
push dword [ecx + eax*8 + 0x24]
push dword [esp + 0x70]
call fcn.004bbfc0
add esp, 0x10
mov ebx, dword [esp + 0x3c]
push dword [ebx]
push dword [esp + 0x68]
call fcn.004bb230
mov eax, dword [esp + 0x74]
add esp, 8
mov ebx, dword [ebx]
mov ecx, dword [esp + 0x20]
mov edx, dword [eax]
add ebx, edx
mov dword [esp + 0x28], ebx
mov ecx, dword [ecx]
lea eax, [edx + edx*2]
cmp edx, ebx
jae 0x4baa3b
lea ebx, [eax*8 + 0x14]
mov eax, dword [esp + 0x28]
add ebx, ecx
add edi, dword [ebx - 4]
inc esi
test byte [ebx], 1
jne 0x4ba9f2
dec eax
cmp edx, eax
jne 0x4baa2b
xor eax, eax
cmp edi, 1
jle 0x4baa08
lea esp, [esp]
sar edi, 1
inc eax
cmp edi, 1
jg 0x4baa00
xor ecx, ecx
cmp esi, 1
jle 0x4baa18
nop
sar esi, 1
inc ecx
cmp esi, 1
jg 0x4baa10
mov esi, dword [esp + 0x18]
sub eax, dword [esi]
sub eax, ecx
inc eax
cmp ebp, eax
jg 0x4baa27
mov ebp, eax
xor edi, edi
xor esi, esi
mov eax, dword [esp + 0x28]
inc edx
add ebx, 0x18
cmp edx, eax
jb 0x4ba9e4
mov dword [esp + 0x4c], ebp
lea ebx, [ebp - 1]
test ebx, ebx
js 0x4baa5a
mov ebp, dword [esp + 0x64]
push 1
push 1
push ebp
call fcn.004cd670
add esp, 0xc
dec ebx
jns 0x4baa46
mov ebp, dword [esp + 0x4c]
push 1
push 0
push dword [esp + 0x6c]
call fcn.004cd670
mov eax, dword [esp + 0x78]
add esp, 0xc
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov ebx, dword [eax]
add dword [edx], ebp
mov ecx, dword [ecx]
lea eax, [ebx + ebx*2]
cmp ebx, dword [esp + 0x28]
jae 0x4baae0
lea ebp, [ecx + 0x14]
lea ebp, [ebp + eax*8]
lea esp, [esp]
add edi, dword [ebp - 4]
inc esi
test byte [ebp], 1
jne 0x4baaad
mov eax, dword [esp + 0x6c]
mov ecx, dword [eax]
mov eax, dword [esp + 0x3c]
mov eax, dword [eax]
dec eax
add eax, ecx
cmp ebx, eax
jne 0x4baad6
xor ecx, ecx
cmp esi, 1
jle 0x4baabc
sar esi, 1
inc ecx
cmp esi, 1
jg 0x4baab4
mov eax, dword [edx]
add eax, ecx
push eax
push edi
push dword [esp + 0x6c]
call fcn.004cd670
mov edx, dword [esp + 0x24]
add esp, 0xc
xor edi, edi
xor esi, esi
inc ebx
add ebp, 0x18
cmp ebx, dword [esp + 0x28]
jb 0x4baa90
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x6c]
add eax, 0x34
add dword [esp + 0x20], 0x34
add ecx, 0x34
add edx, 0x34
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
inc edx
mov ebp, dword [esp + 0x58]
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], edx
cmp edx, dword [esp + 0x54]
jb 0x4ba906
mov edi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x40]
inc ecx
mov ebp, dword [esp + 0x34]
add eax, 0x24
jmp 0x4ba842
mov ebx, dword [esp + 0x64]
push ebx
call fcn.004cd430
add esp, 4
push ebx
test eax, eax
jne 0x4bab5a
call fcn.004cd410
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
call fcn.004cd5a0
mov esi, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
add esi, eax
sub ebp, eax
mov dword [esp + 0x14], esi
push ebx
mov dword [esp + 0x1c], ebp
call fcn.004cd410
mov eax, dword [esp + 0x70]
add esp, 8
test byte [eax], 4
je 0x4babce
cmp ebp, 2
jae 0x4babbb
cmp dword [esp + 0x80], 1
jne 0x4ba700
push 2
push ebp
push str.opj_t2_encode_packet__:_only__u_bytes_remaining_in_output_buffer.__u_needed._n
push 1
push dword [esp + 0x94]
call fcn.004ac8e0
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov word [esi], 0x92ff
add esi, 2
sub ebp, 2
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x7c]
test ebp, ebp
je 0x4bac03
cmp dword [ebp + 0xc], 0
je 0x4bac03
mov ecx, dword [ebp + 0x58]
mov eax, esi
imul esi, dword [esp + 0x60], 0x250
mov edi, dword [ebp + 8]
sub eax, dword [esp + 0x70]
shl edi, 5
cdq
mov ecx, dword [esi + ecx + 0x224]
mov dword [ecx + edi + 8], eax
mov dword [ecx + edi + 0xc], edx
mov edi, dword [esp + 0x44]
xor eax, eax
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x6c], eax
cmp eax, dword [ecx + 0x18]
jae 0x4bad23
push edi
call fcn.004b3540
add esp, 4
test eax, eax
jne 0x4bacfe
mov eax, dword [esp + 0x34]
lea ecx, [eax + eax*4]
mov eax, dword [edi + 0x14]
mov edx, dword [eax + ecx*8 + 0x14]
imul edx, dword [eax + ecx*8 + 0x10]
mov ebx, dword [eax + ecx*8 + 0x18]
xor eax, eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], edx
test edx, edx
je 0x4bacfe
mov ecx, dword [esp + 0x24]
lea edi, [ebx + 0x28]
lea ecx, [ecx + ecx*2]
shl ecx, 3
add ebx, 4
mov dword [esp + 0x58], ecx
mov esi, dword [ebx]
add esi, ecx
cmp dword [esi], 0
je 0x4bace7
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x14]
cmp eax, ecx
ja 0x4bad0f
push eax
push dword [esi + 0x10]
push dword [esp + 0x18]
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi]
add esp, 0xc
add dword [edi], eax
mov eax, dword [esi + 4]
add dword [esp + 0x10], eax
sub dword [esp + 0x14], eax
test ebp, ebp
je 0x4bacdb
cmp dword [ebp + 0xc], 0
je 0x4bacdb
imul ecx, dword [esp + 0x60], 0x250
mov eax, dword [ebp + 0x58]
mov edx, dword [ebp + 8]
fld qword [esi + 8]
shl edx, 5
add edx, dword [ecx + eax + 0x224]
fadd qword [edx + 0x18]
fst qword [edx + 0x18]
fcom qword [ebp]
fnstsw ax
test ah, 0x41
jne 0x4bacd9
fstp qword [ebp]
jmp 0x4bacdb
fstp st(0)
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x64]
mov ecx, dword [esp + 0x58]
inc eax
add ebx, 0x34
add edi, 0x34
mov dword [esp + 0x68], eax
cmp eax, edx
jb 0x4bac68
mov edi, dword [esp + 0x44]
mov eax, dword [esp + 0x6c]
inc eax
add edi, 0x24
mov dword [esp + 0x44], edi
jmp 0x4bac09
cmp dword [esp + 0x80], 1
jne 0x4ba700
push eax
jmp 0x4ba6e9
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x10]
sub ecx, dword [esp + 0x70]
pop edi
add dword [eax], ecx
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret