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

Disassembly:
push 0xffffffffffffffff
push 0x556deb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x238
push ebx
push edi
mov edi, ecx
xor ebx, ebx
mov dword [esp + 0x24], edi
cmp dword [edi + 4], ebx
jne 0x5380f2
or eax, 0xffffffff
jmp 0x538755
mov eax, dword [esp + 0x250]
cmp eax, ebx
jne 0x538104
push ebx
call dword [sym.imp.USER32.dll_GetDC]
push ebp
push esi
push eax
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov esi, dword [esp + 0x264]
mov ebp, eax
mov dword [esp + 0x44], ebp
lea eax, [esi + 0x1000]
push eax
call dword [sym.imp.GDI32.dll_CreateFontIndirectA]
mov ecx, dword [esi + 0x103c]
lea edx, [esp + 0x6c]
push ecx
push edx
mov ecx, edi
mov dword [esp + 0x60], eax
call sym.VisualBoyAdvance.exe_public:_struct_tagRGBQUAD___thiscall_CxImage::RGBtoRGBQUAD_unsigned_long_int_
mov eax, dword [esi + 0x1048]
lea ecx, [esp + 0x38]
push eax
push ecx
mov ecx, edi
call sym.VisualBoyAdvance.exe_public:_struct_tagRGBQUAD___thiscall_CxImage::RGBtoRGBQUAD_unsigned_long_int_
mov eax, dword [esi + 0x1040]
cmp eax, 1
je 0x53816f
cmp eax, ebx
je 0x53816f
cmp eax, 2
je 0x53816f
mov dword [esi + 0x1040], 1
cmp byte [esi + 0x1051], 0x32
jbe 0x53817f
mov byte [esi + 0x1051], 0xa
fld dword [esi + 0x104c]
fcomp qword [0x55a9b0]
fnstsw ax
test ah, 0x41
je 0x5381a5
fld dword [esi + 0x104c]
fcomp qword [0x55a9c8]
fnstsw ax
test ah, 1
je 0x5381ab
mov dword [esi + 0x104c], ebx
mov eax, dword [esp + 0x58]
cmp eax, ebx
jne 0x5381bb
push 0x11
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
push ebp
call dword [sym.imp.GDI32.dll_SelectObject]
push 0xffffff
push ebp
mov dword [esp + 0x48], eax
call dword [sym.imp.GDI32.dll_SetTextColor]
push ebx
push ebp
call dword [sym.imp.GDI32.dll_SetBkColor]
push 2
push ebp
call dword [sym.imp.GDI32.dll_SetBkMode]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
xor edx, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov ebx, 1
test ecx, ecx
mov dword [esp + 0x18], ecx
jle 0x53821c
mov al, byte [edx + esi]
inc edx
cmp al, 0xd
jne 0x538218
inc ebx
cmp edx, ecx
jl 0x53820f
lea edx, [esp + 0x48]
push 0xc00
push edx
push ecx
push esi
push ebp
call dword [sym.imp.USER32.dll_DrawTextA]
mov al, byte [esi + 0x1014]
mov edi, dword [esp + 0x54]
test al, al
je 0x538251
mov eax, edi
mov ecx, dword [esp + 0x50]
cdq
sub eax, edx
sar eax, 1
cdq
idiv ebx
add ecx, eax
mov dword [esp + 0x50], ecx
mov cl, byte [esi + 0x1044]
xor eax, eax
test cl, cl
mov dword [esp + 0x30], eax
mov dword [esp + 0x1c], eax
je 0x5382bb
mov eax, edi
xor ecx, ecx
cdq
idiv ebx
mov cl, byte [esi + 0x1051]
mov ebx, eax
mov eax, 0x51eb851f
imul ecx, ebx
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x1c], edx
fild dword [esp + 0x1c]
fmul qword [0x55bd18]
call sub.MSVCRT.dll__ftol
mov dword [esp + 0x30], eax
mov eax, 0x55555556
imul ebx
mov eax, dword [esp + 0x50]
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
add eax, edx
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x50]
mov ecx, 0xa
lea ebx, [edx + eax*2]
lea edx, [edi + eax*2]
xor eax, eax
lea edi, [esp + 0x74]
push eax
push eax
rep stosd dword es:[edi], eax
lea eax, [esp + 0x78]
lea ecx, [esp + 0x7c]
push eax
push 0
push ecx
push ebp
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x8c], 0x28
mov dword [esp + 0x90], ebx
mov dword [esp + 0x94], edx
mov word [esp + 0x98], 1
mov word [esp + 0x9a], 0x18
call dword [sym.imp.GDI32.dll_CreateDIBSection]
push eax
push ebp
mov dword [esp + 0x28], eax
call dword [sym.imp.GDI32.dll_SelectObject]
lea edx, [ebx + ebx*2]
mov dword [esp + 0x68], eax
mov edi, dword [esp + 0x70]
lea eax, [edx*8 + 0x1f]
cdq
and edx, 0x1f
add eax, edx
mov ecx, eax
xor eax, eax
sar ecx, 5
imul ecx, dword [esp + 0x24]
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov edx, dword [esp + 0x18]
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esi + 0x1040]
lea ecx, [esp + 0x48]
or ah, 8
push eax
push ecx
push edx
push esi
push ebp
call dword [sym.imp.USER32.dll_DrawTextA]
push 0
lea ecx, [esp + 0xa4]
call sym.VisualBoyAdvance.exe_public:_void___thiscall_CxImage::constructor_unsigned_long_int_
mov eax, dword [esp + 0x20]
push 0
push eax
lea ecx, [esp + 0xa8]
mov dword [esp + 0x258], 0
call sym.VisualBoyAdvance.exe_public:_bool___thiscall_CxImage::CreateFromHBITMAP_struct_HBITMAP_____struct_HPALETTE____
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x260]
mov edi, dword [ecx + 0x10]
sub edi, eax
mov eax, dword [esi + 0x1040]
dec edi
cmp eax, 1
mov dword [esp + 0x260], edi
jne 0x5383e3
mov eax, ebx
mov ecx, dword [esp + 0x25c]
cdq
sub eax, edx
sar eax, 1
neg eax
add ecx, eax
mov dword [esp + 0x25c], ecx
jmp 0x5383ef
cmp eax, 2
jne 0x5383ef
sub dword [esp + 0x25c], ebx
mov eax, dword [esp + 0x25c]
test eax, eax
jge 0x538405
mov dword [esp + 0x25c], 0
mov al, byte [esi + 0x1044]
test al, al
je 0x53866f
xor ebp, ebp
test ebx, ebx
mov dword [esp + 0x28], ebp
jle 0x53866b
mov dword [esp + 0x18], ebx
mov eax, dword [esp + 0x1c]
cmp ebp, eax
jg 0x53845e
mov ecx, ebp
sub ecx, eax
mov edx, ecx
imul edx, ecx
fild dword [esp + 0x1c]
fadd qword [0x55a9b8]
mov ecx, eax
imul ecx, eax
sub ecx, edx
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fsqrt
fsubp st(1)
call sub.MSVCRT.dll__ftol
mov dword [esp + 0x14], eax
jmp 0x5384a7
sub ebx, eax
dec ebx
cmp ebp, ebx
jl 0x53849b
mov edx, dword [esp + 0x18]
sub edx, eax
fild dword [esp + 0x1c]
lea ecx, [edx - 1]
mov edx, ecx
imul edx, ecx
fadd qword [0x55a9b8]
mov ecx, eax
imul ecx, eax
sub ecx, edx
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fsqrt
fsubp st(1)
call sub.MSVCRT.dll__ftol
mov dword [esp + 0x14], eax
jmp 0x5384a3
mov dword [esp + 0x14], 0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x24]
xor ebx, ebx
test ecx, ecx
jle 0x53864f
cmp ebp, dword [esp + 0x1c]
jg 0x5384d0
mov edx, ecx
sub edx, eax
dec edx
cmp ebx, edx
jg 0x538646
cmp ebx, eax
jl 0x538646
mov edx, dword [esp + 0x34]
sub edx, dword [esp + 0x1c]
dec edx
cmp ebp, edx
jl 0x5384f2
mov edx, ecx
sub edx, eax
dec edx
cmp ebx, edx
jg 0x538646
cmp ebx, eax
jl 0x538646
fld dword [esi + 0x104c]
fcomp qword [0x55a9c8]
fnstsw ax
test ah, 0x41
jne 0x538619
fld dword [esi + 0x104c]
fcomp qword [0x55a9b0]
fnstsw ax
test ah, 1
je 0x538619
mov eax, dword [esp + 0x25c]
add edi, ebx
add ebp, eax
push 1
push edi
lea ecx, [esp + 0x64]
push ebp
push ecx
mov ecx, dword [esp + 0x3c]
call sym.VisualBoyAdvance.exe_public:_struct_tagRGBQUAD___thiscall_CxImage::GetPixelColor_long_int__long_int__bool_
mov eax, dword [eax]
mov edx, dword [esp + 0x38]
fld dword [esi + 0x104c]
fsubr qword [0x55a9b0]
mov dword [esp + 0x60], eax
and eax, 0xff
mov dword [esp + 0x10], eax
and edx, 0xff
fild dword [esp + 0x10]
mov dword [esp + 0x10], edx
fmul dword [esi + 0x104c]
fild dword [esp + 0x10]
fmul st(2)
faddp st(1)
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0x3a]
mov byte [esp + 0x20], al
mov eax, dword [esp + 0x62]
and ecx, 0xff
and eax, 0xff
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
mov dword [esp + 0x10], ecx
fmul dword [esi + 0x104c]
fild dword [esp + 0x10]
fmul st(2)
faddp st(1)
call sub.MSVCRT.dll__ftol
mov edx, dword [esp + 0x61]
mov byte [esp + 0x22], al
mov eax, dword [esp + 0x39]
and edx, 0xff
mov dword [esp + 0x10], edx
and eax, 0xff
fild dword [esp + 0x10]
mov dword [esp + 0x10], eax
fmul dword [esi + 0x104c]
fild dword [esp + 0x10]
fmul st(2)
faddp st(1)
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0x268]
mov byte [esp + 0x21], al
mov byte [esp + 0x23], 0
mov edx, dword [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x30]
push edx
push edi
push ebp
fstp st(0)
call sym.VisualBoyAdvance.exe_public:_void___thiscall_CxImage::SetPixelColor_long_int__long_int__struct_tagRGBQUAD__bool_
mov edi, dword [esp + 0x260]
mov ebp, dword [esp + 0x28]
jmp 0x53863e
mov eax, dword [esp + 0x268]
mov ecx, dword [esp + 0x38]
push eax
mov eax, dword [esp + 0x260]
push ecx
lea edx, [ebx + edi]
lea ecx, [eax + ebp]
push edx
push ecx
mov ecx, dword [esp + 0x3c]
call sym.VisualBoyAdvance.exe_public:_void___thiscall_CxImage::SetPixelColor_long_int__long_int__struct_tagRGBQUAD__bool_
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x24]
inc ebx
cmp ebx, ecx
jl 0x5384b5
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x34]
inc ebp
dec ecx
cmp ebp, eax
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], ecx
mov ebx, eax
jl 0x538425
mov ebp, dword [esp + 0x44]
test ebx, ebx
mov dword [esp + 0x28], 0
jle 0x5386f9
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x25c]
add edx, eax
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x24]
xor esi, esi
test eax, eax
jle 0x5386e3
mov ecx, dword [esp + 0x28]
push 1
push esi
lea edx, [esp + 0x64]
push ecx
push edx
lea ecx, [esp + 0xb0]
call sym.VisualBoyAdvance.exe_public:_struct_tagRGBQUAD___thiscall_CxImage::GetPixelColor_long_int__long_int__bool_
cmp byte [eax], 0
je 0x5386da
mov eax, dword [esp + 0x268]
mov ecx, dword [esp + 0x6c]
push eax
mov eax, dword [esp + 0x34]
mov edx, esi
push ecx
mov ecx, dword [esp + 0x34]
sub edx, eax
mov eax, dword [esp + 0x20]
add edx, edi
push edx
push eax
call sym.VisualBoyAdvance.exe_public:_void___thiscall_CxImage::SetPixelColor_long_int__long_int__struct_tagRGBQUAD__bool_
mov eax, dword [esp + 0x24]
inc esi
cmp esi, eax
jl 0x538696
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x18]
inc eax
inc edx
cmp eax, ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], edx
jl 0x53868c
mov eax, dword [esp + 0x40]
test eax, eax
je 0x538709
push eax
push ebp
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esp + 0x58]
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
push ecx
call esi
mov edx, dword [esp + 0x68]
push edx
push ebp
call dword [sym.imp.GDI32.dll_SelectObject]
push eax
call esi
push ebp
call dword [sym.imp.GDI32.dll_DeleteDC]
lea ecx, [esp + 0xa0]
mov dword [esp + 0x250], 0xffffffff
mov dword [esp + 0xa0], sym.VisualBoyAdvance.exe_const_CxImage::vftable
call sym.VisualBoyAdvance.exe_public:_bool___thiscall_CxImage::Destroy_void_
pop esi
mov eax, 1
pop ebp
mov ecx, dword [esp + 0x240]
pop edi
pop ebx
mov dword fs:[0], ecx
add esp, 0x244
ret 0x14